| Autore |
Messaggio |
MondoCri Matricola

Registrato: 31 Dic 1969
Messaggi: 66
Profilo
|
Inviato:
30 Ott 2007 - 05:14 |
|
| Oggetto: Visualizzare in index le IMG delle sottocategorie |
Salve a tutti,
ho un problema per il quale non sono riuscita a trovare soluzione da sola quindi mi rivolgo a voi sperando possiate aiutarmi....
In Index.php quando entro in una categoria del catalogo, in alto visualizzo il nome della categoria e la sua immagine a destra e fino a qui tutto ok.
Il Problema nasce però in 2 casi:
o quando non ho sottocategoria ma direttamente prodotti
oppure quando apro, a mia volta la sottocategoria;
In entrambi questi casi, a Destra non visualizzo l'immagine nonostante abbia correttamente caricato la sottocategoria completa dell'immagine stessa...
Qualcuno sa come risolvere il problema???
Inoltre ho notato anche che purtroppo in una categoria non possono esserci sottocategorie e prodotti ma la presenza delle prime esclude la visualizzazione degli altri... è ovviabile questo problema? questa è solo una curiosità in quanto non è ovviamente un grande problema irrisolvibile...
Grazie milla a priori a chi potrà aiutarmi... |
|
|
Rispondi citando |
 |
|
MAXdev Info MAXdev vi informa
|
Inviato:
30 Ott 2007 - 05:14 |
|
|
|
|
 |
capretta Moderatore


Registrato: 31 Dic 1969
Messaggi: 3635
Località: ValdOrcia
Profilo
|
  Inviato:
30 Ott 2007 - 09:49 |
|
|
ciao,
si è proprio come dici: se ci sono sottocategorie E prodotti, mostra solo iprodotti:
per ovviare fai così:
- in /catalog/includes/languages/english/index.php trova:
| Codice:
|
define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
define('HEADING_TITLE', 'Let\'s See What We Have Here');
e cambia così
define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
define('CAT_HEADING_TITLE', 'Categories');
if ( ($category_depth == 'products') || ($category_depth == 'both') || (isset($_GET['manufacturers_id'])) ) {
define('HEADING_TITLE', 'Let’s See What We Have Here');
|
- le stesse modifiche le fai per il file di lingua italiano
- apri la index.php principale dello shop e a riga 16 sostituisci:
| Codice:
|
$category_depth = 'top';
con
$category_depth = (isset($_GET['manufacturers_id']) ? 'products' : 'top');
|
- più sotto:
| Codice:
|
if ($cateqories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($category_parent_query);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
cambialo così
if ($cateqories_products['total'] > 0) {
$category_depth = 'products'; // display products
}
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($category_parent_query);
if ($category_parent['total'] > 0) {
if ($category_depth == 'top') {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'both'; } // navigate through both categories & products
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
|
- riga 58::
| Codice:
|
if ($category_depth == 'nested') {
cambialo in
if (($category_depth == 'nested') || ($category_depth == 'both')) {//display categories
|
- Riga 66:
| Codice:
|
<td class="pageHeading"><?php echo HEADING_TITLE ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
cambia in
<td class="pageHeading"><?php echo CAT_HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
- riga 125:
| Codice:
|
</table></td>
<?php
} elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
cambia in
</table>
<?php
if ($category_depth == 'nested') echo '</td>';
}
if (($category_depth == 'products') || ($category_depth == 'both') || isset($_GET['manufacturers_id'])) {
// create column list of products
|
- riga 283
| Codice:
|
<?php
} else { // default page
?>
cambia con
<?php
}
if ($category_depth == 'top') { // default page
?>
|
ciao |
|
|
Rispondi citando |
 |
MondoCri Matricola

Registrato: 31 Dic 1969
Messaggi: 66
Profilo
|
  Inviato:
31 Ott 2007 - 03:45 |
|
|
Grazie mille Capretta,
funziona per il problema di avere categorie con prodotti e sottocategorie contemporaneamente!
Adesso però mi resta il problema di visualizzare accanto al nome della sottocategoria anche la sua foto... idee? |
|
|
Rispondi citando |
 |
| |