antoine184 Posted December 13, 2018 Share Posted December 13, 2018 (edited) Hello, PS 1.7.4.4, theme classic, PHP version: 7.2.12, MySQL version: 5.7.21 I know that the subject has been treated several times but not on version 1.7 (or I did not find it and I'm sorry) but when I try to follow the subject that is on another version, either the code does not work, either the files no longer exists or the content is empty On this version, I assumed that the file product-prices.tpl should be used in / shop / themes / classic / templates / catalog / _partials, I tried to put a if price! = 0 but that does not work (I tried enclosing the whole file or enclosing it {block name = 'product_unit_price'} {if $ displayUnitPrice} <p class = "product-unit-price sub"> {ls = '(% unit_price%)' d = 'Shop.Theme.Catalog' sprintf = ['% unit_price%' => $ product.unit_price_full]} </ p> {/ If} {/ Block} and it does not work) Do you have an idea? Thank you Regards Edited April 8, 2019 by antoine184 (see edit history) Link to comment Share on other sites More sharing options...
antoine184 Posted December 14, 2018 Author Share Posted December 14, 2018 Anyone? Thanks you Link to comment Share on other sites More sharing options...
musicmaster Posted December 14, 2018 Share Posted December 14, 2018 why do you have a space after the dollar? Link to comment Share on other sites More sharing options...
antoine184 Posted December 14, 2018 Author Share Posted December 14, 2018 10 minutes ago, musicmaster said: why do you have a space after the dollar? Sorry it's an error of copy/paste, there is no space in my file Link to comment Share on other sites More sharing options...
taniacr Posted December 14, 2018 Share Posted December 14, 2018 (edited) On 12/13/2018 at 1:51 PM, antoine184 said: Hello, PS 1.7.4.4, theme classic, PHP version: 7.2.12, MySQL version: 5.7.21 I know that the subject has been treated several times but not on version 1.7 (or I did not find it and I'm sorry) but when I try to follow the subject that is on another version, either the code does not work, either the files no longer exists or the content is empty On this version, I assumed that the file product-prices.tpl should be used in / shop / themes / classic / templates / catalog / _partials, I tried to put a if price! = 0 but that does not work (I tried enclosing the whole file or enclosing it {block name = 'product_unit_price'} {if $ displayUnitPrice} <p class = "product-unit-price sub"> {ls = '(% unit_price%)' d = 'Shop.Theme.Catalog' sprintf = ['% unit_price%' => $ product.unit_price_full]} </ p> {/ If} {/ Block} and it does not work) Do you have an idea? Thank you Regards Hi, How about like this: {if $product.price_amount eq "0"} <p> </p> {else} {block name='product_prices'} {include file='catalog/_partials/product-prices.tpl'} {/block} {/if} Edited December 14, 2018 by taniacr Edited sugested code (see edit history) 1 Link to comment Share on other sites More sharing options...
antoine184 Posted December 17, 2018 Author Share Posted December 17, 2018 It works! Thanks you Link to comment Share on other sites More sharing options...
RawArt Posted December 16, 2019 Share Posted December 16, 2019 (edited) On 12/17/2018 at 9:27 AM, antoine184 said: It works! Thanks you Where exaclty Did you insert it? I tried to put the code at the end of the product-prices.tpl, but the result is that product pages are no longer loading at all. EDIT: I realized that I have to insert it into product.tpl, but I don't know which one, I have so many between the classic theme and my custom theme that I bought. Edited December 18, 2019 by RawArt (see edit history) Link to comment Share on other sites More sharing options...
radu_cmr Posted March 11, 2021 Share Posted March 11, 2021 Hi, I have tried to do on my website the modifications to not display prices for the products with price 0 as it mentioned above. The problem is I don't know exactly where to insert the code... I have tried in different places but the site is not working anymore after the modification. I mention I have products available in many combinations and I want to display prices only for few of them, for the rest I want to not have the price displayed because is 0. I use Pretashop 1.7.6.7. Link to comment Share on other sites More sharing options...
radu_cmr Posted March 11, 2021 Share Posted March 11, 2021 Finally I succed to make it works, but I still have a small problem. When a product has the price 0, this is not displayed anymore, but the information "VAT not included" is still displayed. Could I do something to not have this message displayed anymore if the price is 0? Link to comment Share on other sites More sharing options...
Darius Webdevelopers Posted May 10, 2021 Share Posted May 10, 2021 On 3/11/2021 at 2:50 PM, radu_cmr said: Finally I succed to make it works, but I still have a small problem. When a product has the price 0, this is not displayed anymore, but the information "VAT not included" is still displayed. Could I do something to not have this message displayed anymore if the price is 0? So where exact you put this code? Link to comment Share on other sites More sharing options...
radu_cmr Posted May 10, 2021 Share Posted May 10, 2021 For the beginning find the file product-prices.tpl Open it with Wordpad, Notepad++ or other software Before {block name='product_price'} add {if $product.price_amount eq "0"} <p> </p> {else} Between <p> and </p> you can write something to be displayed instead of the price.. something like "Ask for price!" After this you have to close the IF, for this put {/if} after the last {/block}, but before the new block {block name='product_without_taxes'} Enclose is the file Hope this help product-prices.tpl Link to comment Share on other sites More sharing options...
Darius Webdevelopers Posted May 12, 2021 Share Posted May 12, 2021 On 5/10/2021 at 4:55 PM, radu_cmr said: For the beginning find the file product-prices.tpl Open it with Wordpad, Notepad++ or other software Before {block name='product_price'} add {if $product.price_amount eq "0"} <p> </p> {else} Between <p> and </p> you can write something to be displayed instead of the price.. something like "Ask for price!" After this you have to close the IF, for this put {/if} after the last {/block}, but before the new block {block name='product_without_taxes'} Enclose is the file Hope this help product-prices.tpl 4.63 kB · 2 downloads Thanks. But it has changes it only in product details, also need in product list. And maybe have you got solution for removing add to cart and quantity, if price is "0" ? Link to comment Share on other sites More sharing options...
radu_cmr Posted May 12, 2021 Share Posted May 12, 2021 (edited) I'm using presta shop only as catalogue, so cart not available on my website, so I can't tell you exactly what else should do. Edited May 12, 2021 by radu_cmr (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