How do I keep the gift certificates from showing up in the New Products listing?
Thanks
Larry
Printable View
How do I keep the gift certificates from showing up in the New Products listing?
Thanks
Larry
The easiest method it to go into phpMyAdmin and edit the products table for the Gift Certificates and change the products_date_added to older than your setting for the New Products in the Maximum Values ...
Quote:
New Product Listing - Limited to ...
Limit the New Product Listing to
0= All Products
1= Current Month
7= 7 Days
14= 14 Days
30= 30 Days
60= 60 Days
90= 90 Days
120= 120 Days
That works, many thanks
Larry
What can be done if your setting is set tp 0, All Products...?
Anyone have a possible solution if I'm keeping New Product Listing to All products...?
Thanks for your time,
Jim
Are all of your Gift Certificates in the same categories_id ...
If you check the master_categories_id for the Gift Certificates are they all the same?
If so, then you could exclude that master_categories_id from the SELECT for the New Products ...
Thanks for the reply Linda!
The Gift Certs are all in the same category separate from all other items.
Would your suggestion require a code modification in one or more files...?
If so, do you know which files need editing...?
Many thanks for your insight!
Jim
This is the change I made to the query statement in /includes/modules/new_products.php
starting around line 17.
Original code
Changed Code (changed in two spots and added comment line)Code:if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$new_products_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_date_added
from " . TABLE_PRODUCTS . " p
where p.products_status = 1 " . $display_limit;
} else {
$new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_date_added,
p.products_price
from " . TABLE_PRODUCTS . " p
left join " . TABLE_SPECIALS . " s
on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
TABLE_CATEGORIES . " c
where p.products_id = p2c.products_id
and p2c.categories_id = c.categories_id
and c.parent_id = '" . (int)$new_products_category_id . "'
and p.products_status = 1 " . $display_limit;
}
Code:// added p.master_categories_id != 21 to not select gift cert as new product LNG
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$new_products_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_date_added
from " . TABLE_PRODUCTS . " p
where p.master_categories_id != 21
and p.products_status = 1 " . $display_limit;
} else {
$new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_date_added,
p.products_price
from " . TABLE_PRODUCTS . " p
left join " . TABLE_SPECIALS . " s
on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
TABLE_CATEGORIES . " c
where p.products_id = p2c.products_id
and p2c.categories_id = c.categories_id
and p.master_categories_id != 21
and c.parent_id = '" . (int)$new_products_category_id . "'
and p.products_status = 1 " . $display_limit;
}
Gyphon,
Thanks for your input and code snippet!
It worked just fine; however, do you know where the code is for the New Products link in the left sidebox menu as this page displays the Gift Certs as well...
Many Thanks,
Jim
Jim,
I forgot about that one, (I have that box turned off on my store). That file would be /includes/modules/sideboxes/what_new.php starting about line 15:
Original Code
Changed Code (add one line and a comment line)Code:$random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price
from " . TABLE_PRODUCTS . " p
where p.products_status = 1 " . $display_limit . "
limit " . MAX_RANDOM_SELECT_NEW;
Hope that helpsCode://added p.master_categories_id != 21 to not select gift cert as new product LNG
$random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price
from " . TABLE_PRODUCTS . " p
where p.master_categories_id != 21
and p.products_status = 1 " . $display_limit . "
limit " . MAX_RANDOM_SELECT_NEW;
Larry