Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

2.3.4 general.php - malformed if statement?


lee the bean

Recommended Posts

Posted

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'];

 

 

Posted

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" ...

Posted

@@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

Posted

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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...