Forums / Templates, Stylesheets, Page Layout / Adding more limited days for the new products box

Adding more limited days for the new products box

Locked

Views: 1,535

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
21 Sep 2006, 9:53 AM
#1
princess avatar

princess

New Zenner

Join Date:
Apr 2005
Posts:
59
Plugin Contributions:
0

Adding more limited days for the new products box

I have now in my admin under New Product Listing - Limited to ... the following days:

Limit the New Product Listing to
0= All desc
1= Current Month
30= 30 Days
60= 60 Days
90= 90 Days
120= 120 Days

How can I add more days? for example 3 or 7 days

21 Sep 2006, 2:03 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding more limited days for the new products box

You would need to set the configuration_key SHOW_NEW_PRODUCTS_LIMIT for the number of days ...

In theory, anything not set to 0 or 1 will be that many days ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Sep 2006, 8:18 PM
#3
princess avatar

princess

New Zenner

Join Date:
Apr 2005
Posts:
59
Plugin Contributions:
0

Re: Adding more limited days for the new products box

Hi

That is what I meant what is not working, I have changed that, in the new_products.php and all other files where these lines are in, but nothing changes in the admin file.

21 Sep 2006, 8:28 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding more limited days for the new products box

Note: that this theory would only work in v1.3.5 ...

What version of Zen Cart are you running?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Sep 2006, 8:30 PM
#5
princess avatar

princess

New Zenner

Join Date:
Apr 2005
Posts:
59
Plugin Contributions:
0

Re: Adding more limited days for the new products box

Hi Ajeh,

I am using 1.2.7,

21 Sep 2006, 8:37 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding more limited days for the new products box

Well ... that isn't going to work then without a lot of coding ...

The new method uses a totally different scheme for obtaining New Products based on date to speed up the processes ...

The old method used date math in a more primative way and it really slowed things down on large sites ... or sites with poor configuration of MySQL ...

You can try a search via the Tools ... Developer's Tool Kit ... in the bottom input box for:
SHOW_NEW_PRODUCTS_LIMIT

This should locate all of the code that needs to be customized in v1.2.7 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Sep 2006, 6:21 AM
#7
princess avatar

princess

New Zenner

Join Date:
Apr 2005
Posts:
59
Plugin Contributions:
0

Re: Adding more limited days for the new products box

Ajeh:

Well ... that isn't going to work then without a lot of coding ...

The new method uses a totally different scheme for obtaining New Products based on date to speed up the processes ...

The old method used date math in a more primative way and it really slowed things down on large sites ... or sites with poor configuration of MySQL ...

You can try a search via the Tools ... Developer's Tool Kit ... in the bottom input box for:
SHOW_NEW_PRODUCTS_LIMIT

This should locate all of the code that needs to be customized in v1.2.7 ...

Hi Ajeh,

That is what I have tried before, but the admin doesn't change for some reason...

22 Sep 2006, 6:41 AM
#8
princess avatar

princess

New Zenner

Join Date:
Apr 2005
Posts:
59
Plugin Contributions:
0

Re: Adding more limited days for the new products box

I shall explain more precisely what I have done.

I have searched for every file where :

case (SHOW_NEW_PRODUCTS_LIMIT == '30'):
  $display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 30';
  break;

was in,

I have changed that to

case (SHOW_NEW_PRODUCTS_LIMIT == '3'):
  $display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 3';
  break;

But the admin doesn't change, it still shows

Limit the New Product Listing to
0= All desc
1= Current Month
30= 30 Days
60= 60 Days
90= 90 Days
120= 120 Days

When I choose 30 days hoping that that will be 3 days, then the box shows all products randomly

24 Sep 2006, 3:24 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding more limited days for the new products box

The choices do not change just because you changed the code ...

You would need to manually edit the configuration_key for that from 30 to 3 in phpMyAdmin and see if that works for you ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!