Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Include extra product fields in QUICK SEARCH


Guest

Recommended Posts

Posted

Hi, I trying to get the quick search box to included the extra product fields in its keyword search. I have used the Search Descriptions simple mod contribution to include the description in the quick search (it works great for the description) and was hoping that the same principle could be used to include the extra product fields. I have attempted to adapt it using my very limited php/sql skills and didn’t get the desired results.

 

If you are unfamiliar with the Product Extra Fields contribution it adds a new table to the database called “products_to_products_extra_fields” and there is a column in the table called “products_extra_fields_value”, this is where all the data/values I want the quick search to include are stored.

The Search Descriptions simple mod says to change line line in advanced_search_result.php:

 

FROM:

manufacturers_name like '%" . tep_db_input($keyword) . "%'";

 

TO:

manufacturers_name like '%" . tep_db_input($keyword) . "%' or pd.products_description like '%" . tep_db_input($keyword) . "%'";

 

so working on this principle I added: or p2pef.products_extra_fields_value like '%" . tep_db_input($keyword) . "%' so ended up like this:

 

manufacturers_name like '%" . tep_db_input($keyword) . "%' or pd.products_description like '%" . tep_db_input($keyword) . "%' or p2pef.products_extra_fields_value like '%" . tep_db_input($keyword) . "%'"; 

 

So far I think is correct (maybe) but the following is what I am having issues with. I believe that p2pef (products_to_products_extra_fields) column needs to be called up form the database so I change the following code in advanced_search_result.php:

 

FROM:

$from_str = "from ((" . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ";

 

TO:

$from_str = "from ((" . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, "  . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef";

 

Any ideas where I'm going wrong? Thanks.

Posted

Anybody got any suggestions for me? Doesn't matter if you don’t know if it will work for sure, just looking for some ideas to try. Anything would be appreciated.

 

Thanks.

  • 9 months later...
Posted

I have run into the same issue, If anyone has any suggestion, please feel free to post them.

Thanks

Archived

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

×
×
  • Create New...