Portman Posted February 21, 2019 Share Posted February 21, 2019 Ok, so I'm playing around with hiding particular products from particular customers... I have made a variable $hide_product where the value 1 means the product is hidden and 0 means it is visible... I am trying to modify bm_specials.php and bm_whats_new.php so that if $hide_product = 1 that product does not show up in the box and another is selected... Im assuming it is these lines of code I need to modify, but for the life of me I can't figure it out bm_specials.php if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) { bm_whats_new.php if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { any help would be appreciated Link to comment Share on other sites More sharing options...
multimixer Posted February 21, 2019 Share Posted February 21, 2019 If you have a "hide_product" flag in your database, you can include that into the query, in the same way it is done for the products status where products_status = '1' and hide_product = '0' and ...... My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Portman Posted February 21, 2019 Author Share Posted February 21, 2019 thanks @multimixer I was trying to plug the variable in there rather than the record from the database... Link to comment Share on other sites More sharing options...
multimixer Posted February 22, 2019 Share Posted February 22, 2019 How will the system know if the product is hidden or not ? My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
milerwan Posted November 15, 2019 Share Posted November 15, 2019 On 2/21/2019 at 10:45 PM, Portman said: thanks @multimixer I was trying to plug the variable in there rather than the record from the database... @multimixer is true, you need to add a new field in the products TABLE to increment product specifics... There is no other way to make it. Osc v2.3.4 BS "custom" PHP 7.3 compatible (710 modified files => o_O') Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.