Jump to content

Question about accessories


smartrich

Recommended Posts

This is probably simple, but I'm stuck.

 

I've added some accessories, but wanted to include the model number which I have changed to part number.

 

http://192.185.4.162/~kmsafari/index.php?id_product=32&controller=product&id_lang=1 (bottom of the page)

 

In the product.tpl file I added this code:

 

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

Because I use the word "product", the part number that shows is the number of the product for that page. The word needs to be something else that identifies the accessory, but I'm not sure what.

 

Can anyone help?

 

TIA.

 

~rich

 

 

Link to comment
Share on other sites

Yes, that's the part of the code I am editing.

 

The variable accessory is the first thing I tried ... this is what I get back:

 

Notice: Trying to get property of non-object in /home1/kmsafari/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(171) : eval()'d code on line 884

Link to comment
Share on other sites

That was the second thing I tried ... with the same result.

 

Part
Notice: Trying to get property of non-object in /home1/kmsafari/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(171) : eval()'d code on line 884

Link to comment
Share on other sites

Ok figured one thing, because of use of that  id="product_reference" reference is set to main product one with jQuery.

 

Also if product have combination then reference part will be hidden so maybe delete that 

{if !isset($groups)} ...{/if}

and leave just 

{$accessory.reference|escape:'html':'UTF-8'}

Which works for me.

 

Or move that if before whole block if you want to hide it.

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