Jump to content

adding to specials and whats new boxes

Recommended Posts

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 


      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)) {


      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 


Edited by Portman

Share this post

Link to post
Share on other sites

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 ......


Share this post

Link to post
Share on other sites
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')

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now