Jump to content

Get a custom product_attributes in product.tpl?


rboyart

Recommended Posts

Hello,

 

I am creating my prestashop e-commerce for second hand clothing.

I would like to see the status of the cloths in the product page, for that, I created a custom attribute (quality) with four values (not bad, good, very good, Excelent !)

I'm trying to change the product.tpl file, but I don't know how to call the variable (custom attribute) that I just created in the back office.

 

Thank you for your help

Link to comment
Share on other sites

hey,

 

thanks for the information.

 

i asked:

have you defined product combinations ? you have to add this attribute to combinations

this is neessary, because without combinations - new attribute will not appear

Link to comment
Share on other sites

Hey Vekia,

 

Sorry I didn't answer your question, I didn't realize it. I was trying to figure out how make this work.

I don't need combination, because it is attribute of the cloth, I just want to mark the state of the cloth ( good, excellent, etc).

Combinations will be good if I could sell different state of the same cloth...

But with your help, I'm now showing the attribute in the specifications of the product. ( see image attach ) :)

 

img1.jpg

 

 

 

 

I must now do the styling.

 

I saw in product.tpl, that this part is calling my custom attribute values :

 

<!-- product's features -->
    <ul id="idTab2" class="bullet">
    {foreach from=$features item=feature}
	    {if isset($feature.value)}
		    <li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li>
	    {/if}
    {/foreach}
    </ul>

 

Which is the good way to change the HTML layout, to respect the core of prestashop and at the same time to fill my style requirements, can i simple move the blocks in my template product.tpl?

 

Thanks for your help

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