Category Menu with Tableau ZenCart Template not working
A client had recently installed the tableau ZenCart template on their site. Its a great template made by Numinix but the version they installed seem to have a bug with the drop down menu for the categories on the site. The client found when they edited the Category within ZenCart they stated to get duplicates of the categories appearing in the drop down menu. After a quick investigation I saw that when they edited the category the visibility status of the category it was being added to the hide_categories table within the database (as it should). These enteries in the hide_categories table seemed to be causing the duplicate name.
Some more digging lead me to the initial query within the tpl_modules_categories_tabs.php file, it seemed to be querying the Hide_Category table for no reason in the initial query. I removed this and the problem was solved, so here is the step by step guide in case anyone else has the same issue:
Open the following file from your ZenCart Installation:
Includes/templates/tableau/templates/tpl_modules_categories_tabs.php
Locate the following code (line22 on my clients site)
categories_tab_query = "SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION . " cd," . TABLE_HIDE_CATEGORIES . " cde WHERE c.categories_id = cd.categories_id AND c.parent_id= '0' AND cd.language_id='" . (int)$_SESSION['languages_id'] . "' AND c.categories_status='1' ORDER BY c.sort_order, cd.categories_name;";
replace it with this
$categories_tab_query = "SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id AND c.parent_id= '0' AND cd.language_id='" . (int)$_SESSION['languages_id'] . "' AND c.categories_status='1' ORDER BY c.sort_order, cd.categories_name;";
- wp_review_location:
- bottom
- wp_review_desc_title:
- Summary
- wp_review_color:
- #1e73be
- wp_review_fontcolor:
- #555555
- wp_review_bgcolor1:
- #e7e7e7
- wp_review_bgcolor2:
- #ffffff
- wp_review_bordercolor:
- #e7e7e7