
Originally Posted by
DrByte
Try replacing that line with this one:
Code:
$products_all_query_raw = preg_replace('/, ' . TABLE_PRODUCTS_DESCRIPTION . ' pd(\s*)WHERE/', ', ' . TABLE_HIDE_CATEGORIES . ' h, ' . TABLE_PRODUCTS_DESCRIPTION . ' pd WHERE p.master_categories_id = h.categories_id AND (h.visibility_status < 2 OR h.visibility_status IS NULL) AND', $products_all_query_raw);
Made the change..
Here's what it looks like.. I think I got it right.. Right??
PHP Code:
<?php
// Begin hideCategories code
$products_all_query_raw = preg_replace('/, ' . TABLE_PRODUCTS_DESCRIPTION . ' pd(\s*)WHERE/', ', ' . TABLE_HIDE_CATEGORIES . ' h, ' . TABLE_PRODUCTS_DESCRIPTION . ' pd WHERE p.master_categories_id = h.categories_id AND (h.visibility_status < 2 OR h.visibility_status IS NULL) AND', $products_all_query_raw);
$products_all_split = new splitPageResults($products_all_query_raw, MAX_DISPLAY_PRODUCTS_ALL);
// End hideCategories code
?>
I got this:
1054 Unknown column 'p.master_categories_id' in 'on clause'
in:
[select count(p.products_id) as total FROM zen_products p LEFT JOIN zen_manufacturers m ON (p.manufacturers_id = m.manufacturers_id), zen_products_description pd LEFT JOIN zen_hide_categories h ON (p.master_categories_id = h.categories_id) WHERE (h.visibility_status < 2 OR h.visibility_status IS NULL) AND p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 ]
