Jump to content

Display Product Reference on product page with attributes instead of attribute ref


HistoricalGarments

Recommended Posts

When I have attributes (which most of my products do), the product reference shown is that of the selected attribute.

 

I would like to show the overall product reference at all times.

 

The code in product.tpl is just:

 

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

 

 

I can't seem to find the place that makes it fetch the product attribute reference instead of the overall product reference?

Link to comment
Share on other sites

Assuming you're using the default PrestaShop v1.6.1.6 theme, it is the following code on lines 649-658 of themes/default-bootstrap/js/product.js that update the product reference when the attributes change:

	if (selectedCombination['reference'] || productReference)
	{
		if (selectedCombination['reference'])
			$('#product_reference span').text(selectedCombination['reference']);
		else if (productReference)
			$('#product_reference span').text(productReference);
		$('#product_reference:hidden').show('slow');
	}
	else
		$('#product_reference:visible').hide('slow');
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...