rbboyl Posted September 29, 2008 Share Posted September 29, 2008 Hi everyone, new to the forums. I've done a search and didn't see anyone who has experienced this issue. My oscommerce site is www.99jewels.com If you click on a parent category, it displays all sub categories with name and picture in the products area of the site. However, if you notice the link/cPath that it leads you to is incorrect. The first sub-category is always linked to index.php (I've tried changing the sort order and it's still the same) and then the rest of the sub-categories are all off by one number in the child category id number. Example: Click on the parent category "Diamond Charms" in the left category box. The first sub-category is "Good Luck". If you notice, the link for "Good Luck" in the left box is "cPath=14_17" (which is correct) while the link for "Good Luck" in the main product box is to "index.php". You'll also notice that the next sub-category "Love and Flowers" links to "cPath=14_17" which is the path for Good Luck. As you go through each sub-category, you'll see that the cPaths are off by one. I'm not sure how to fix this problem. I've looked at the database and all the parent and child category ids are correct. Has anybody encountered this issue and know where to start troubleshooting? Link to comment Share on other sites More sharing options...
rbboyl Posted October 1, 2008 Author Share Posted October 1, 2008 bump. Anybody? I think I need to make a change in index.php, but I'm not sure what. Link to comment Share on other sites More sharing options...
Guest Posted October 10, 2008 Share Posted October 10, 2008 I have the same problem and would very much appreciate some help with it Link to comment Share on other sites More sharing options...
Sardonic76 Posted October 30, 2008 Share Posted October 30, 2008 Please help!!! Having the same problem. :huh: Link to comment Share on other sites More sharing options...
cchayer Posted November 28, 2008 Share Posted November 28, 2008 I have the same problem, what a pain! Link to comment Share on other sites More sharing options...
cchayer Posted November 28, 2008 Share Posted November 28, 2008 I think I fixed it. If anybody wants to try this and let me know if it works. I can't see how it would break anything else... in index.php, lines 97-107 in my installation, may be different because of modules I have installed, but look for: while ($categories = tep_db_fetch_array($categories_query)) { $p_pic_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>'; $p_name_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a>'; $rows++; $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; The problem is the $cPath_new = tep_get_path($categories['categories_id']); , it should be set before you print out your first subcategory, so move it up a few lines like so: while ($categories = tep_db_fetch_array($categories_query)) { $cPath_new = tep_get_path($categories['categories_id']); $p_pic_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>'; $p_name_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a>'; $rows++; $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; Link to comment Share on other sites More sharing options...
Nathalie979 Posted December 31, 2008 Share Posted December 31, 2008 Hi i had the same problem, linked fine in the navigation only on the thumbnail page it stuffed up. I tried Curtis's fix it works great, thanks heaps! Link to comment Share on other sites More sharing options...
wun Posted March 10, 2009 Share Posted March 10, 2009 Curtis, this worked perfect. Thanks! MS Link to comment Share on other sites More sharing options...
Coocks Posted March 31, 2009 Share Posted March 31, 2009 Thanks for the fix ! It also worked for me. Been searching for an answer for the past hours. How did it broke anyway? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.