So as has been reported by others, the search does not work for me either on my test store.. I don't know why, and it's over my head to fix, so I'm not going to attempt it.. If someone else wants to tackle this, they can feel free to do so.. In the meantime I will submit the updated fileset that works with Zen Cart v1.5 with this caveat clearly documented..
knuckle-101:
Try the file header_php.php file attached see if that works for you. This is unedited without any other mods installed. I take no credit or responsibility, backup your original first.
Simply upload it to includes/modules/pages/advanced_search_result/header_php.php it is for 1.5.1 version
[Attachment no longer available]
Danielle:
I've installed the latest version of this mod (2.1) and it looks like it includes the changes below. However, when I search, I get no results, even for categories that are not hidden. If I put back the original advanced_search_result/header_php.php file, the products all show up, but it includes the products from the hidden categories. I have checked and rechecked all the files and I just don't know what is causing this problem.
kamelion0927:
Alrighty, I think I've got it.
MAKE A BACKUP BEFORE YOU MAKE THIS CHANGE BECAUSE THIS ISN'T AN OVERRIDE FILE and it worked for me, but I'm not 100% sure it is correct.
In includes/modules/pages/advanced_search_result/header.php, find
$from_str = "FROM (" . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_MANUFACTURERS . " m
USING(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c )
LEFT JOIN " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd
ON mtpd.products_id= p2c.products_id
AND mtpd.language_id = :languagesID";
> and change to
> ```php
$from_str = "FROM (" . TABLE_HIDE_CATEGORIES . " h, " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_MANUFACTURERS . " m
USING(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c )
LEFT JOIN " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd
ON mtpd.products_id= p2c.products_id
AND mtpd.language_id = :languagesID";
Then find
// Notifier Point
$zco_notifier->notify('NOTIFY_SEARCH_FROM_STRING');
$where_str = " WHERE (p.products_quantity > 0
AND p.products_status = 1
AND p.products_id = pd.products_id
AND pd.language_id = :languagesID
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id ";
> and change to
> ```php
// Notifier Point
$zco_notifier->notify('NOTIFY_SEARCH_FROM_STRING');
$where_str = " WHERE (p.products_quantity > 0
AND p.products_status = 1
AND p.products_id = pd.products_id
AND pd.language_id = :languagesID
AND p.products_id = p2c.products_id
and (p.master_categories_id = h.categories_id and h.visibility_status !=2)
AND p2c.categories_id = c.categories_id ";
All I did was utilize the code from hideCategories/includes/modules/sideboxes/my_template/whats_new.php and adapted it to fit the search code.
Hopefully it will continue to work and not cause issues with any of my other mods but I would appreciate feedback from someone who knows code as to whether it is the appropriate way to handle this situation.
Thanks!
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.