Ciao ragazzi, vorrei inserire nella index al posto dei prodotti appena inseriti, le categorie e le loro sottocategorie con le relative thumb.
In pvt posso mandare link a richiesta.
fatemi sapere, pago il disturbo!
Categorie e sotto categorie nella home?
Moderatore: mod Generali
Re: Categorie e sotto categorie nella home?
qualcosa del genere
è da adattare al tuo negozio ovviamente
è da adattare al tuo negozio ovviamente
Codice: Seleziona tutto
<?php
// ################## End Added Enable Disable Categorie #################
// $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
// ################## End Added Enable Disable Categorie #################
$number_of_categories = tep_db_num_rows($categories_query);
while ($categories = tep_db_fetch_array($categories_query)) {
$cPath_new = tep_get_path($categories['categories_id']);
echo '<span class="DACREARE"> <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'
. tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) .
'<br />' . $categories['categories_name'] . '</a> </span>' . "\n";
}
?>
Home page personale http://www.magnino.net
SVN aggiornamenti http://code.google.com/p/oswai/source/browse/#svn/trunk
SVN aggiornamenti http://code.google.com/p/oswai/source/browse/#svn/trunk
Re: Categorie e sotto categorie nella home?
mi restituisce l'errore:
1054 - Unknown column 'c.categories_status' in 'where clause'
select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from categories c, categories_description cd where c.categories_status = '1' and c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '2' order by sort_order, cd.categories_name
1054 - Unknown column 'c.categories_status' in 'where clause'
select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from categories c, categories_description cd where c.categories_status = '1' and c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '2' order by sort_order, cd.categories_name
Re: Categorie e sotto categorie nella home?
ci sono 2 query
la prima se non hai il mod enable/disable category
la seconda se l'hai
commenta la seconda e de-commenta la prima
la prima se non hai il mod enable/disable category
la seconda se l'hai
commenta la seconda e de-commenta la prima
Home page personale http://www.magnino.net
SVN aggiornamenti http://code.google.com/p/oswai/source/browse/#svn/trunk
SVN aggiornamenti http://code.google.com/p/oswai/source/browse/#svn/trunk