Jump to content

Label "New" Product [SOLVED]


famar
 Share

Recommended Posts

Hi,

 

you will need to change your css or tpl files, for example themes/your_theme/product_list.tpl

 

{if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}  {*remove/comment this line*}

 

Regards

 

thanks!

Share this post


Link to post
Share on other sites

  • 4 months later...

could you tell where it get from database...( i mean i need the column name and table name n of this label in db).... :)

 

you want to edit code that alexander mentioned above? sorry but i dont quite understand what you expect :(

Share this post


Link to post
Share on other sites

you want to edit code that alexander mentioned above? sorry but i dont quite understand what you expect :(

 

Now I got it...! I'm asked where the 'new' column in table regarding the product...like quantity...

 

nw i understand there is no column like that...we have to calculate from date of product added...

Share this post


Link to post
Share on other sites

Now I got it...! I'm asked where the 'new' column in table regarding the product...like quantity...

 

nw i understand there is no column like that...we have to calculate from date of product added...

 

exactly ! :)

Share this post


Link to post
Share on other sites

but i struggle to find it...coz i'm fetch all product values(like quantity,price,name,image url etc) fetch from single query...so how can i calculate it and return 1 in a single query any idea?

 

 

DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(),
 INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).'
  DAY)) > 0 AS new

  • Like 1

Share this post


Link to post
Share on other sites

DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(),
 INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).'
  DAY)) > 0 AS new

 

Thank for the reply...and exactly!

 

I got it already....

 

my code is

"SELECT ((`ps_configuration`.value)-(DATEDIFF(NOW(), `ps_product`.date_add))) AS new FROM ps_configuration,ps_product WHERE ((`ps_configuration`.name='PS_NB_DAYS_NEW_PRODUCT') AND (`ps_product`.`id_product`=$id))"

 

i worked above code for show manufacturer's products in product page...and the result would be...i got it exactly yesterday!

 

2n1f5tz.jpg

 

I'm using raw sql code for fetching full product information and values on my area...coz i'm new to php and smarty, so go for this code

 

I asking you learning platform for above mentioned courses....any suggestion?

Edited by mani313 (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More