lee the bean Posted December 2, 2015 Posted December 2, 2015 from update 2.3.4 catalog/includes/functions/general.php around line 918 // Construct a category path to the product what does this line 934/935 do (it don't look right - but I'm not a php expert) if (tep_not_null($cPath)) $cPath .= '_'; $cPath .= $category['categories_id'];
burt Posted December 2, 2015 Posted December 2, 2015 Nothing wrong with that. if (tep_not_null($cPath)) $cPath .= '_'; $cPath .= $category['categories_id']; is the same as: if (tep_not_null($cPath)) { $cPath .= '_'; } $cPath .= $category['categories_id']; The second line of code is nothing to do with the "if" ...
Jack_mcs Posted December 2, 2015 Posted December 2, 2015 @@lee the bean It's building the category ID. It first checks if the category ID exists and, if so, adds an underscore to it. Then it adds the category ID to that. So you end up with an ID of something like 23 or 23_45, or whatever the numbers would be. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
lee the bean Posted December 3, 2015 Author Posted December 3, 2015 Thanks guys, I found the alternate syntax on http://php.net/manual/en/control-structures.alternative-syntax.php I think we need a test and redirect for an empty category id ie /product_info.php?cPath=&products_id=1594. This can cause a 'back button' link problem, as the cPath parameter is added. As we may be aware Bing loves to add parameters where none should be, and doesn't always get them correct as reported below: http://answers.microsoft.com/en-us/bing/forum/bing_other-bing_dev/bing-crawlers-never-drop-crawling-a-non-existing/9c56f5f2-4d80-4095-87b2-99ffdb346785 (can't find an answered button on post - but this is question is answered - thanks)
Jack_mcs Posted December 3, 2015 Posted December 3, 2015 The function the code you mentioned already checks for an existing ID. But that is different than the 404/410 problem you mention. See my Header Status Handler to fix that. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Recommended Posts
Archived
This topic is now archived and is closed to further replies.