philbb69 Posted June 30, 2015 Share Posted June 30, 2015 Bonjour, Aujourd'hui le prix de mes produits est affiché dans les produits phare, mais je souhaiterais avoir le prix / quantité (100g ou 50g). Exemple : 5€/100g. En effet, je propose différents poids par produit. Comment faire? Merci pour vos réponses Philippe Link to comment Share on other sites More sharing options...
erouvier29 Posted July 2, 2015 Share Posted July 2, 2015 Bonjour, En s'inspirant de ce qui est fait dans la fiche détaillée de produit, vous pouvez insérer ce qui suit dans /themes/xxx/product-list.tpl. Ainsi le prix/quantité, si défini, sera affiché dans toutes vos vignettes produit (produits phares et autres). {if !empty($product.unity) && $product.unit_price_ratio > 0.000000} {math equation="pprice / punit_price" pprice=$product.price punit_price=$product.unit_price_ratio assign=unit_price} <p class="unit-price"> <span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product.unity|escape:'html':'UTF-8'} </p> {hook h="displayProductPriceBlock" product=$product type="unit_price"} {/if} (typiquement en remplacement de la ligne 139 si theme = defaut-bootstrap, PS 1.6.0.14) Nota: allez ensuite faire un tour du côté des traductions FO, il devrait manquer celle de "per" pour ce template. Cordialement Link to comment Share on other sites More sharing options...
philbb69 Posted July 5, 2015 Author Share Posted July 5, 2015 Merci beacoup erouvier29, ca fonctionne parfaitement!!!!!!!!!!!! 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