Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / displaying new products in all categories

displaying new products in all categories

Locked

Views: 1,004

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
8 Feb 2007, 1:27 PM
#1
poosk avatar

poosk

Totally Zenned

Join Date:
Mar 2005
Location:
Helsinki
Posts:
477
Plugin Contributions:
0

displaying new products in all categories

I'd need to display small "new" image or text in all the product lists next to product name with products that are added within last 14 days.. I guess there must be a way to edit product list template files so it would do it? I'm no good with php but if you pick a line from new products template there's this line:
date_format(p.products_date_added, '%Y%m') >= date_format(now(), '%Y%m')";

so if you'd make it a if clause somehow so it would be
if product added within 14days (or 30 whatever)
display image
if not display nothing

Can someone php wise please tell how it could be done?

8 Feb 2007, 1:53 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: displaying new products in all categories

You have the right idea ... but the products_date_added is not part of the select statement so that field is unavailable ...

There is a function that can grab any peice of info from the products and products_descriptions table:
zen_products_lookup($your_products_id, 'products_date_added')

8 Feb 2007, 2:20 PM
#3
poosk avatar

poosk

Totally Zenned

Join Date:
Mar 2005
Location:
Helsinki
Posts:
477
Plugin Contributions:
0

Re: displaying new products in all categories

thanks ajeh for pointing that out..but I still need some help.. So, basicly I'd take the product listing module file and add the function which displays new text (or image) next to products name

but I still have no clue how to make the proper function for it...