I've got the same trouble as topic starter has.
I didn't found any solution on this forum. I've googled hard and as a result I've found this:
ddmin.com/zen-cart_zen_get_products_category_id-bug/
It is in Chinese, but google translated it pretty well:
translate.google.com/translate?js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&sl=auto&tl=en&u=http%3A%2F%2Fwww.ddmin.com%2Fzen-cart_zen_get_products_category_id-bug%2F
But in my situation variable $current_category_id wasn't NULL, but 4.
In this case I didn't found anything better than disabling IF.
So my zen_get_products_category_id function looks so:
PHP Code:
function zen_get_products_category_id($products_id) {
global $db;
/* ori
$the_products_category_query = "select products_id, master_categories_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'";
$the_products_category = $db->Execute($the_products_category_query);
return $the_products_category->fields['master_categories_id'];
*/
//bof category icon display fix, by Yury
//if (! $the_products_category->fields['master_categories_id']) {
$d_p2c_cid = $db->Execute('SELECT categories_id FROM `' . TABLE_PRODUCTS_TO_CATEGORIES . '` WHERE products_id="' . $products_id . '"')->fields['categories_id'];
$the_products_category->fields['master_categories_id'] = $d_p2c_cid;
//echo $d_p2c_cid;
//}
return $d_p2c_cid;
//eof category icon display fix, by Yury
}
The site is Ok now, there are no secretes with that. Here I am - http://cellchaos.com
I'm tired with this fix, and now I don't wish to find out why my $current_category_id wasn't NULL
Please let me know if there are better solutions...
Bookmarks