Jump to content

[SOLVED] Reference number in list view


carinac

Recommended Posts

I am trying to get the Reference number to show in both list view and Grid view. I was able to get it to show in list view by adding this code to product-list.tpl

 

<p id="product_reference"{if empty($product.reference) || !$product.reference} style="display: none;"{/if}>
        <label>{l s='Listing #'} </label>
    <span class="editable" itemprop="sku">{$product.reference}</span>
        </p>

 

but I can't get it to show up on grid view.

 

Can anyone help?

Edited by carinac (see edit history)
Link to comment
Share on other sites

The easiest solution is to move the product reference after the product name so that it displays in both views. For example, assuming you're using the default PrestaShop theme, add your code above after the following on lines 117-119 of product-list.tpl:

						<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>
Link to comment
Share on other sites

Thank you, I had it after and not before. 

But now it does show in list but only if it has <h5> around it and it removes the title. If I remove the <H5> it removes the reference number and put back on the title....

Link to comment
Share on other sites

Nevermind I didn't put it directly before

<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>

 

Now I did and it works, thanks so much!

Link to comment
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
×
×
  • Create New...