Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

best seller by manufacturer


Guest

Recommended Posts

I have a client who would like the best sellers box to just show a certain manufacturer's best sellers if the person shopping selects to search by manufacturer. Right now the best sellers code will show a certain catagories best sellers if there is is cpath in the URL or it shows all best sellers (limited by the number chosen in the admin) Does anyone know how to add a 3rd if statement to the best sellers code so that if there is manufacturer_id in the URL the best sellers box will just show the best sellers from that manufacturer?

 

Thanks for any help you can give me.

Link to comment
Share on other sites

Never mind, figured it out myself.

 

In case anyone else would like to use this heres the code to add to the bestsellers box php:

 

} elseif ($HTTP_GET_VARS['manufacturers_id']){

$best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name, p.manufacturers_id, p.products_ordered, p.products_price, m.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "' order by p.products_ordered DESC, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...