Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search by products_model


Guest

Recommended Posts

Hi Jack,

 

Thank for your reply.

 

I did have a look at your contribution but I am not sure it's exactly what I wanted.

Basically, I have a column in the products table of the database with entries like: red, white, sparkling etc.

 

So I simply want to have a drop down menu in advanced search with "red, white, sparkling" which will return the relevant entries.

 

Regards

Plamen

Link to comment
Share on other sites

Ahh, that's different from the model number. No contribution will work for you since the field you want to search for is not standard. The search can be made to include those but it would require custom coding.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

It turned out to be quite an easy solution. Just this lines of code to the file - advanced_search_results.php

 

After

 

 if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
 }

 

Add

 

  if (isset($HTTP_GET_VARS['products_model']) && tep_not_null($HTTP_GET_VARS['products_model'])) {
  $where_str .= " and p.products_model = '" . $HTTP_GET_VARS['products_model'] . "'";
}

Link to comment
Share on other sites

I'm confused on what you asked. The basic shop code would find the model number by default. But you said you didn't want to search for the model number but for a special field and now you are back to the model. If the change you made works for you and you couldn't find the model before, then your shop had been altered in some way, or maybe it is an old version. But if you do really have an extra field, then it won't work. But if it is working for you, that's all that matters.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...