If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / Changing "New Product Listing" from 120 days to a higher value

Changing "New Product Listing" from 120 days to a higher value

Started by athens_collectibles on 7 Dec 2011, 10:33 AM · Views: 643

Results 1 to 7 of 7
7 Dec 2011, 10:33 AM
#1
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Changing "New Product Listing" from 120 days to a higher value

Just a quick question about maximum values in New Product Listing. There are by default 8 values from 0-120 days selectable with a radio button.

Is it safe to change the value in the database from 120 to, say 240 or would that have other implications? I have found the value in the "configuration" table of the database (configuration_key=SHOW_NEW_PRODUCTS_LIMIT) where the configuration_value is currently 120.

This is not vital but good to know. Thanks in advance for any response.

8 Dec 2011, 1:18 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Changing "New Product Listing" from 120 days to a higher value

If you do that, you will need to edit the functions_lookups.php file and change the setting in:
function zen_get_products_new_timelimit

as that is set for 120 ...

I believe that is the only change you will need to make ...

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!

8 Dec 2011, 10:08 AM
#3
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Changing "New Product Listing" from 120 days to a higher value

Thank you for your (as always) quick reply Linda.

What I did was to change the configuration_description and set_function fields in the database by adding the extra values indicated by the red underlining in the attached image. This added two extra radio buttons for 240 and 360 days to my Admin > Maximum Values > New Product Listing - Limited to ... selections.

I selected 240 from there and this was inserted in the database as expected (see the value indicated by the red arrow in the image).

Now, going to the functions_lookups.php file: I added the following to the zen_get_products_new_timelimit function which starts at line 840:

      case ($time_limit == '240'):
        $display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 240';
        break;
      case ($time_limit == '360'):
        $display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 360';
        break;

All seem to work fine but an expert confirmation that nothing wrong was done will be much appreciated. Needless to say that these changes have been made to my local host installation at the moment.

Many thanks in advance and kind regards.

8 Dec 2011, 2:01 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Changing "New Product Listing" from 120 days to a higher value

That should manage it for you on the change ...

To be sure, test your own Products to ensure that the change is functioning as expected ...

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!

8 Dec 2011, 3:38 PM
#5
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Changing "New Product Listing" from 120 days to a higher value

Yes, I have tested Linda and it functions as it's expected. Many thanks again. :smile:

4 Jan 2012, 7:19 PM
#6
maineiac13 avatar

maineiac13

New Zenner

Join Date:
Sep 2008
Posts:
98
Plugin Contributions:
0

Re: Changing "New Product Listing" from 120 days to a higher value

Just wanted to thank your for this thread... I was looking to do exactly this same thing and the step by step description is greatly appreciated and works perfectly.

4 Jan 2012, 7:41 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Changing "New Product Listing" from 120 days to a higher value

Thanks for the update that this was able to help you out ... :smile:

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!