Steveio Posted April 13, 2017 Share Posted April 13, 2017 Hi, I am wanting to display 'product references' on the 'product-list' pages exactly as they are by default on individual product pages. I have tried adding the code in red below to the themes > default-bootstrap > product-list.tpl file. It displays the text 'Reference:' but not the respective reference number. <h5 itemprop="name">{if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}<a class="product-name" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" >{$product.name|truncate:45:'...'|escape:'html':'UTF-8'}</a></h5> <p id="product_reference_products_list"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}><label>{l s='ref:'} </label><span class="editable" itemprop="sku">{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span></p> Does anyone know what I might be doing wrong? Thanks Link to comment Share on other sites More sharing options...
vekia Posted April 13, 2017 Share Posted April 13, 2017 product list does not have object $product instead it has $product as an array this means that you can reach elements with something like this :$product.reference (instead $product->reference) Link to comment Share on other sites More sharing options...
Steveio Posted April 18, 2017 Author Share Posted April 18, 2017 Great, thanks, that did the job. 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