sotlordrahl:
This is how I hacked up the zen-cart code to have the ability to unfold ANY or ALL categories to display sub-cats on all pages, not just the index page:
open 'includes/classes/category_tree.php'
- change line 137
change
if (zen_not_null($cPath)) {
TO =>
if (zen_not_null($cPath) or 1) {
- insert code in lines 141-145
ORIGINAL
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
insert =>
$cPath_array = array(#,#);
in between the reset and while commands.
equals the category ID you wish to be unfolded... you can have it only unfold one, or all... all would be #,#,#,#,# and so on until you have all the ID's inside the parenthesis.
END RESULT
reset($cPath_array);
$cPath_array = array(1,2,5,7);
while (list($key, $value) = each($cPath_array)) {
hope this helps some people, my buddy and I spent 2 hours trying to figure this one out. tried to add some hyphens in here for reading pleasure and such... do not insert the page breaks I made. ENJOY!!!
Any questions let me know, this is what worked for me.
Hi there! I made this change to includes/classes/category_tree.php and it ALMOST works except that the link for one of the subcategories is incorrect. It directs to the product listing of another subcategory.
Women (cPath=18)
-- Sandals (cPath=18_21)
-- Fur Accessories (cPath=18_22 - properly pulls up the page with additional subcategories for items like gloves, etc)
Men (cPath=17)
-- Sandals (cPath=18_17_19 - but still links properly to the men's sandals)
-- Fur Accessories (cPath=18_17_20 - but DOES NOT properly link to the men's page with additional subcats for items like slippers, etc but rather links to the WOMEN'S)
Please, help! I've been trying to fix this for hours. I hope someone has a fix out there! Thank you.
My cPath_array is : $cPath_array = array(18,17,21,19,20,22);
Using zencart v 1.3.9h