kineas Posted April 26, 2016 Share Posted April 26, 2016 (edited) Hello, I would like to display the "unit" (which is set by a feature) in the product.tpl. I can't find where to add this code in the product.tpl, however it works on product-list.tpl. Can anyone help please? :-) In order to show the unit-type the price was referring to (/kg, /unit, /piece, ...) I did two things: 1/ Create a "feature" named "unittype" in the backoffice 2/ modified the product-list.tpl by adding, just after the line "{hook h="displayProductPriceBlock" product=$product type="unit_price"}" <!-- Display Unit --> {if isset($product.features) && $product.features} {foreach from=$product.features item=feature} <tr class="{cycle values="odd,even"}"> {if $feature.name eq 'unittype'} {$feature.value|escape:'html':'UTF-8'} {/if} </tr> {/foreach} {/if} <!-- End Display Unit --> It works just fine. And I seem to put it in the wrong place on product.tpl because it never worked... Thank you in advance! Edited May 1, 2016 by kineas (see edit history) Link to comment Share on other sites More sharing options...
kineas Posted May 1, 2016 Author Share Posted May 1, 2016 I could really use someone's help here.. still no solution Link to comment Share on other sites More sharing options...
ventura Posted May 2, 2016 Share Posted May 2, 2016 In product.tpl it would be like this {if isset($features) && $features} {foreach from=$features item=feature} ....................... {/foreach} {/if} Link to comment Share on other sites More sharing options...
kineas Posted May 2, 2016 Author Share Posted May 2, 2016 (edited) Thank you! That actually makes sense. Edited May 15, 2016 by kineas (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now