Jump to content

Replace Product Reference with Product ID on Product Page


Rebel Tech

Recommended Posts

Morning Morning

 

Any chance anyone has a solution:

 

I am trying to change the Product Reference on the Product Page from the product_reference to product_id.

 

The original code in theme/mytheme/product.tpl

<p id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}>
					<label>{l s='Reference:'} </label>
					<span class="editable" itemprop="sku">{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span>
				</p>

I changed it to 

<p id="product_id"{if empty($product->id) || !$product->id} style="display: none;"{/if}>
					<label>{l s='Reference:'} </label>
					<span class="editable" itemprop="sku">{if !isset($groups)}{$product->id|escape:'html':'UTF-8'}{/if}</span>
				</p>

However the reference shows as blank now.

 

Any advise? 

Link to comment
Share on other sites

Don't use escape string function on integer.

 

Still getting blank when I use integer

<p id="product_id"{if empty($product->id) || !$product->id} style="display: none;"{/if}>
					<label>{l s='Reference:'} </label>
					<span class="editable" itemprop="sku">{if !isset($groups)}{$product->id}{/if}</span>
				</p>
Edited by Rebel Tech (see edit history)
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...