Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product List Filter


tuffbwoy

Recommended Posts

Posted

Hello All,

 

I am using OSC2.2MS2. I am just familiarizing myself with the source tree, and figured I would toss my two cents into the hat.

 

I noticed that when the manufacturer dropdown menu is used, that the "state" is preserved. Meaning that when you are viewing whichever manufacturers product listing, that if you were to use the dropdown menu again, you have the option of selecting "Please Select". Since "Please Select" obviously doesn't have a manufacturer_id, and contains an empty string value, you would end up with a page with a broken image link and no products shown. So I created a lil fix. Not sure if its the best way to go about this, but it works for me. So in the 'index.php' file I did this....

 

Where you see this:

 

// optional Product List Filter

if (PRODUCT_LIST_FILTER > 0) {
    if(isset($HTTP_GET_VARS['manufacturers_id'])) {

 

I changed to this:

// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
    if(isset($HTTP_GET_VARS['manufacturers_id']) && strlen($HTTP_GET_VARS['manufacturers_id'] > 0)) {

 

 

So now it doesn't try and display listings for a non-existent manufacturer, and customers who don't quite understand what just happen dont get scared by the "broken page". I know that for those of you who have heavily modified your installations, this probably doesn't apply, but there's still a lot of people using large blocks of code from the original 'index.php'. Hope this helps someone...

 

:thumbsup:

 

-b

Archived

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

×
×
  • Create New...