Jump to content

PRODUCT ID


Recommended Posts

I'm not sure why you want to add the product ID, but you can just add {$product.id_product} wherever you want to display it. You could also use {$product.reference} to display the reference of the product, which I think would be more appropriate. Anyway, change line 14 of modules/homefeatured/homefeatured.tpl (in Prestashop v1.2.5) from:

{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}



to:

{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'} ({$product.id_product})



This will add the product ID in brackets after the product name and make it part of the link. You could add it outside of the if you don't want it to be a link.

You can do a similar thing on the product listings by changing line 9 of product-list.tpl in your theme's directory (in Prestashop v1.2.5) from:

{if $product.new == 1}{l s='new'}{/if}{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}



to:

{if $product.new == 1}{l s='new'}{/if}{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'} ({$product.id_product})

Link to comment
Share on other sites

×
×
  • Create New...