RCP90 Posted May 16, 2013 Share Posted May 16, 2013 (edited) Hello, Is there a way to make the product reference display next to a product when being viewed in a category? Currently just the short description/title displays but I would also like the reference to display. Does anyone have an idea of how to achieve this? Thank you! Edited May 17, 2013 by RCP90 (see edit history) Link to comment Share on other sites More sharing options...
kadziola.jarek Posted May 16, 2013 Share Posted May 16, 2013 Check this post http://www.prestashop.com/forums/topic/153643-product-reference-on-product-list/ 1 Link to comment Share on other sites More sharing options...
vekia Posted May 16, 2013 Share Posted May 16, 2013 Hello, Is there a way to make the product reference display next to a product when being viewed in a category? Currently just the short description/title displays but I would also like the reference to display. Does anyone have an idea of how to achieve this? Thank you! what prestashop version you use? 1 Link to comment Share on other sites More sharing options...
RCP90 Posted May 16, 2013 Author Share Posted May 16, 2013 Hello, I am using 1.5.4.1. Link to comment Share on other sites More sharing options...
vekia Posted May 16, 2013 Share Posted May 16, 2013 Hello, I am using 1.5.4.1. so it's very very easy. All you have to do is to edit produt-list.tpl file. open the themes/YOUR_THEME/product-list.tpl file and insert this: {$product.reference} anywhere you want (remember that it must be in foreach loop) for example, reference above the product name: {$product.reference} <h3><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'|truncate:35:'...'}</a></h3> 2 Link to comment Share on other sites More sharing options...
RCP90 Posted May 17, 2013 Author Share Posted May 17, 2013 Thank you very much guys for this, works perfectly. Link to comment Share on other sites More sharing options...
vekia Posted May 17, 2013 Share Posted May 17, 2013 You're welcome I've noticed that you're active here on forum, so you probably work hard with your template - so my question is: it is possible to check your website ? I am very curious what you've got;) Link to comment Share on other sites More sharing options...
RCP90 Posted May 17, 2013 Author Share Posted May 17, 2013 I PM you link Link to comment Share on other sites More sharing options...
aficionado Posted October 15, 2013 Share Posted October 15, 2013 Hello, please, I need help for the same problem, I am using 1.5.4.1 too, but I can't have reference in product list: with {$product.reference} in produt-list.tpl nothing appears... Thanks in advance! Link to comment Share on other sites More sharing options...
vekia Posted May 29, 2014 Share Posted May 29, 2014 are you sure that your product has got reference ? code that i suggested works if you dont see changes, it can be related to caching in your store, try to clear it Link to comment Share on other sites More sharing options...
[email protected] Posted August 9, 2014 Share Posted August 9, 2014 (edited) Can you help to show product weight on category page. I try to insert following {sprintf("%1\$u",$product->weight)} but it shows 0 (zero) while on product page this code works. PS: I use 1.5.4 Edited August 9, 2014 by [email protected] (see edit history) Link to comment Share on other sites More sharing options...
Alejandrosi Posted August 9, 2014 Share Posted August 9, 2014 Could it be that this don´t work for ps 1.6? I cheked the product reference in the product.tpl and it is similar as yours ---{$product.reference} --- but altought I paste it in the product list.tpl I cant make it work. This is the full code that appears in the product.tpl: <p id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}> <label>{l s='Model'} </label> <span class="editable" itemprop="sku">{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span> </p> Link to comment Share on other sites More sharing options...
Alejandrosi Posted August 14, 2014 Share Posted August 14, 2014 (edited) The {$product.reference} worksin ps1.6. The problem is when changing the view from grid to list. Tha is changed in the global.js file but not sure how as it is not a div or class. Any ideas? I used the following code: <p id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}> <label>{l s='Model'} </label> <span class="editable" itemprop="sku">{$product.reference} </span> </p> In the global.js: html += '<p id="product_reference">'+ $(element).find('.product_reference').html() + '</p>'; But when I switch from grid to list it changes to undefined Edited August 14, 2014 by Alejandrosi (see edit history) Link to comment Share on other sites More sharing options...
radus Posted November 13, 2014 Share Posted November 13, 2014 What I use on http://www.winerepublic.ro/ro/vin-alb/1697-solo-quinta-cramele-recas-5942084501903.html <!-- SKU EAN Product ID Model --> <meta itemprop="sku" content="{$product->reference|escape:'html':'UTF-8'}" /> <meta itemprop="gtin13" content="{$product->ean13|escape:'html':'UTF-8'}" /> <meta itemprop="productID" content="" /> <meta itemprop="model" content="" /> <!-- /SKU EAN Product ID Model --> Link to comment Share on other sites More sharing options...
Alejandrosi Posted November 13, 2014 Share Posted November 13, 2014 I fixed it adding the product reference into de h5 with the product name. Link to comment Share on other sites More sharing options...
FRATAKES Posted November 26, 2014 Share Posted November 26, 2014 Hello all, I upgrade from 1.5 to 1.6 and I managed to have my theme stable and working, I am having a problem when I go to a product that has combinations as the reference number is not present at the moment that loads, but when I select any option from the combinations the reference appears, the intention is to have the reference all the time visible. I remember making some changes in my 1.5 install and theme for that porpoise but I do not know what is that it has to be changed for the 1.6. Here is a link to one of the products http://store.perezsanz.com/us/index.php?id_product=385&controller=product Any help will be appreciated, please let me know if you need more information. (I am not an expert in code) Thank you! Link to comment Share on other sites More sharing options...
Alejandrosi Posted November 27, 2014 Share Posted November 27, 2014 Hello, Look for a style=display: none in the product.tpl and remove it. If not, it can be in the css file. 1 Link to comment Share on other sites More sharing options...
FRATAKES Posted November 27, 2014 Share Posted November 27, 2014 Hello, Look for a style=display: none in the product.tpl and remove it. If not, it can be in the css file. Thank you soo much for your assistance! it seems it works! I did the change in product.tpl if any help i am posting where exactly as there are more than one style= display: none in the file: <p id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}> to this: <p id="product_reference" {if isset($groups) OR !$product->reference}{/if}> Other tip, just change it in the theme you are working on and always keep a BAK Link to comment Share on other sites More sharing options...
Alejandrosi Posted November 27, 2014 Share Posted November 27, 2014 Glad you found the solution. And by the way, great job with the web! great design Link to comment Share on other sites More sharing options...
cybert11 Posted April 30, 2016 Share Posted April 30, 2016 This may be a tall order, but does this work on the accessories tab? been trying to display the product reference in there for a while Link to comment Share on other sites More sharing options...
r4di04ctiv3 Posted August 29, 2016 Share Posted August 29, 2016 Hi. What i do wrong? In Product.tpl this: <p id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}><label for="product_reference">{l s='Model:'}</label><span class="editable">{$product->reference|escape:'htmlall':'UTF-8'}</span></p> work ok, but when i copy this code in my modul2.tpl i dont see nothing , only when i delete "display: none;" i see only label 'Model:' not reference. Thank You Link to comment Share on other sites More sharing options...
Alejandrosi Posted August 29, 2016 Share Posted August 29, 2016 r4di04ctiv3, Could you share a link to your store? Link to comment Share on other sites More sharing options...
r4di04ctiv3 Posted August 30, 2016 Share Posted August 30, 2016 its ok, i found how fix it. Thank You Link to comment Share on other sites More sharing options...
tssaini987 Posted August 21, 2017 Share Posted August 21, 2017 Hi, I am using prestashop 1.7.2 and wanted to change product reference to SKU. Please help as other solution did not work as those solutions are not for version 1.7.2 Link to comment Share on other sites More sharing options...
DJAd Posted July 4, 2019 Share Posted July 4, 2019 (edited) On 5/16/2013 at 10:00 PM, vekia said: so it's very very easy. All you have to do is to edit produt-list.tpl file. open the themes/YOUR_THEME/product-list.tpl file and insert this: {$product.reference} anywhere you want (remember that it must be in foreach loop) This method worked great for me in PrestaShop 1.6. I am now testing out PrestaShop 1.7 and wanted to add the same thing. Is this possible and how do I go about it? Any help would be much appreciated. Edited July 4, 2019 by DJAd (see edit history) Link to comment Share on other sites More sharing options...
Alin Marian Posted December 7, 2022 Share Posted December 7, 2022 Any solution to this for prestashop 1.7? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now