Originally Posted by
swguy
I am not finding the referenced line in Zen Cart 1.5.6 - can you be specific about which file/line you believe to be in error?
Take a look at the file includes/functions/functions_categories.php line 502. This is the line to which it appears the OP is referencing.
However, it also appears that the functionality of what is provided is not understood. It seems that the use attempted by the OP is to always use the result ($value) of the array when really the key ($key) is likely what is needed as if the use code was something like:
Code:
$myList = zen_get_categories_products_list($this_Category);
foreach ($myList as $val) {
echo 'I expect that the products_id will be output here: ' . $val . ' but oops, this is the category path.' . PHP_EOL;
}
Instead of:
Code:
$myList = zen_get_categories_products_list($this_Category);
foreach ($myList as $key => $val) {
echo 'I expect that the products_id will be output here: ' . $key . ' and if I need the category path it is: ' . $val . PHP_EOL;
}
Similar code is in the admin side. If the proposed change were made on the catalog side, then this would affect the display of specials, sales, new product, and featered product. On the admin, I didn't look as hard, but don't see why it should be modified where it appears the goal of the OP is to identify the individual products_id that are provided and that there is no interest in the categories associated with that product.
Just my evaluation of what was posted and what the function does. I think when I first saw it I thought it unusual when inspecting the last category of a category tree, but once a category above that was used/referenced, it somewhat made more sense, a way to reference a product to its category without having to requery the database once the array was created where the array could include every product in the database.
Bookmarks