Gaëtan Posted July 2, 2014 Share Posted July 2, 2014 Hi, I'm searching how to display product unit price in product list frontend on prestashop 1.6 I try to add this code in themes/mytheme/product-list.tpl (This is the code I found in themes/mytheme/product.tpl...) {if !empty($product->unity) && $product->unit_price_ratio > 0.000000} {math equation="pprice / punit_price" pprice=$productPrice 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} But it does'nt work... and I don't know why... After that, I would like to add in product list : quantity box (with + and -) like in product page... But, it's the same problem, it does'nt work. Could someone help me please ? Link to comment Share on other sites More sharing options...
safa Posted July 3, 2014 Share Posted July 3, 2014 (edited) try this code in product-list.tpl. i used this code for 1.5 project and not tested 1.6 if not work say me. {if $product.unit_price_ratio} {l s="Unit Price = "} {math equation="b/a" a=$product.unit_price_ratio b=$product.price_without_reduction assign=realunit} {convertPrice price=$realunit} {$product.unity} {/if} Edited July 3, 2014 by safa (see edit history) Link to comment Share on other sites More sharing options...
Gaëtan Posted July 3, 2014 Author Share Posted July 3, 2014 Thanks for your reply, but nothing happened with this code.... no changes on my frontend. I can't understand how the code in tpl files works... even if I add just <p>TEST</p>.... it don't appear in frontend... why ? Is there others files where we have to add code to display something in frontend? It happen something only if I delete a large part of code. Link to comment Share on other sites More sharing options...
vekia Posted July 3, 2014 Share Posted July 3, 2014 Thanks for your reply, but nothing happened with this code.... no changes on my frontend. I can't understand how the code in tpl files works... even if I add just <p>TEST</p>.... it don't appear in frontend... why ? Is there others files where we have to add code to display something in frontend? It happen something only if I delete a large part of code. hello it's probably because of caching in your shop. go to preferences > performance tab and clear shop cache (there is a button for that) you can even disable it and turn on force compile (do it temporarily, while you work on your template) Link to comment Share on other sites More sharing options...
Gaëtan Posted July 3, 2014 Author Share Posted July 3, 2014 Yes, I know that I can clear the cache.... I do it when I update files. This is not the cause. Link to comment Share on other sites More sharing options...
Alugart Posted August 7, 2014 Share Posted August 7, 2014 Cant get myself around this issue either. Gaetan - i have the same issue, like you do, and i tried both things you did - and I have the same problem. I messaged to Nemo1 about this issue, but have not got a reply yet... Please post here if there is a solution!!!! >.< Link to comment Share on other sites More sharing options...
checkinglive Posted October 12, 2016 Share Posted October 12, 2016 @ safa. Kudos.. This did work for me.. Thank You.. 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