Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / show last modified products in what's new

show last modified products in what's new

Locked

Started by 100asa on 28 Sep 2007, 5:06 PM · Views: 1,485

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
28 Sep 2007, 5:06 PM
#1
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Post #1 by 100asa

It's possible to show in what's new list products with last modified within 7 days?

28 Sep 2007, 5:20 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2 by gjh42

There is a "products_last_modified" field in the products table in the database, so you could access that when building the new products listing.

28 Sep 2007, 5:32 PM
#3
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Post #3 by 100asa

where's this "new products listing" file?

29 Sep 2007, 6:48 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #4 by gjh42

Sorry, making this functionality is going to require a good knowledge of PHP coding. You will probably be best off posting in the Commercial Help Wanted forum if the feature is important to you. Or perhaps someone who already knows how to do this will come by and show you.

1 Oct 2007, 7:42 AM
#5
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Post #5 by 100asa

Thank's for help

1 Oct 2007, 5:47 PM
#6
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Post #6 by 100asa

Solved!
in includes-->modules-->pages-->products_new-->header_php.php
comment out

$display_limit = zen_get_new_date_range();

and add:

$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_last_modified) <= 7';

:clap:

5 Oct 2007, 5:56 AM
#7
ajeh avatar

ajeh

Oba-san

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

Post #7 by ajeh

That will slow you down considerably on a database of any size ...

Look at how those functions were re-written for the new products and upcoming products ...

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!

5 Oct 2007, 6:28 AM
#8
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Post #8 by 100asa

Ajeh:

That will slow you down considerably on a database of any size ...

Look at how those functions were re-written for the new products and upcoming products ...
Sorry, Idon't understand.
Why slow?
I'm using 1.3.5 version, but I don't see difference with latest version

5 Oct 2007, 3:54 PM
#9
ajeh avatar

ajeh

Oba-san

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

Post #9 by ajeh

TO_DAYS(NOW()) in a select statement must touch every record vs have the index help to touch only the records needed ...

If you were to take a database of 2000 products, you would see the TO_DAYS(NOW()) statement touch all 2000 products each time it is used even if there are only 3 products that meet the select statement ...

Using the methods we have for new products and upcoming to address the date fields you would see it touching only the 3 records ...

TO_DAYS(NOW()) slows down queries considerably ...

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!

5 Oct 2007, 4:03 PM
#10
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Post #10 by 100asa

Ajeh:

TO_DAYS(NOW()) in a select statement must touch every record vs have the index help to touch only the records needed ...

If you were to take a database of 2000 products, you would see the TO_DAYS(NOW()) statement touch all 2000 products each time it is used even if there are only 3 products that meet the select statement ...

Using the methods we have for new products and upcoming to address the date fields you would see it touching only the 3 records ...

TO_DAYS(NOW()) slows down queries considerably ...

I want only to see the products I have modified in the last 7 days:
what change I made for?