Forums / Basic Configuration / Setting new products for specific month

Setting new products for specific month

Views: 570

Results 1 to 3 of 3
20 Jul 2011, 2:51 AM
#1
rogercruise avatar

rogercruise

New Zenner

Join Date:
Jul 2011
Posts:
14
Plugin Contributions:
0

Setting new products for specific month

I want to set new products box to display a specific month without changing. For example, new products box is set to display products uploaded in June and even now it is July, the new products box will keep showing the June products.
How to achieve this? Someone told me to define a constant with SQL query, but I don't how to do this. Please help me with this. Thank you very much.

20 Jul 2011, 3:02 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Setting new products for specific month

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Jul 2011, 3:09 AM
#3
rogercruise avatar

rogercruise

New Zenner

Join Date:
Jul 2011
Posts:
14
Plugin Contributions:
0

Re: Setting new products for specific month

Thanks for your reply. But I am not asking for expired date for new products. I would like to constraint the new products box to show a specific month without changing along with time.

I think I have find the define of New products as below. Could anybody help modify this code and set to show products uploaded in June? Thanks.

// get define of New Products
function zen_get_products_new_timelimit($time_limit = false) {
if ($time_limit == false) {
$time_limit = SHOW_NEW_PRODUCTS_LIMIT;
}
switch (true) {
case ($time_limit == '0'):
$display_limit = '';
break;
case ($time_limit == '1'):
$display_limit = " and date_format(p.products_date_added, '%Y%m') >= date_format(now(), '%Y%m')";
break;
case ($time_limit == '7'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 7';
break;
case ($time_limit == '14'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 14';
break;
case ($time_limit == '30'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 30';
break;
case ($time_limit == '60'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 60';
break;
case ($time_limit == '90'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 90';
break;
case ($time_limit == '120'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 120';
break;
}
return $display_limit;
}