Zen_j1 Posted May 12, 2017 Share Posted May 12, 2017 How to hide price Price when Price is 0.00 of product in prestashop default theme 1.6.1.x on product page and quick view window. Link to comment Share on other sites More sharing options...
BalzoT Posted May 12, 2017 Share Posted May 12, 2017 On the product.tpl line 264 there is this code <span id="our_price_display" class="price" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice|floatval}</span> you can change it to {if $productPrice > 0 }<span id="our_price_display" class="price" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice|floatval}</span>{/if} 1 Link to comment Share on other sites More sharing options...
Zen_j1 Posted May 12, 2017 Author Share Posted May 12, 2017 On the product.tpl line 264 there is this code <span id="our_price_display" class="price" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice|floatval}</span> you can change it to {if $productPrice > 0 }<span id="our_price_display" class="price" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice|floatval}</span>{/if} You are my Hero Is there a way to Freeze/Disable Add to cart button for Non Logged in customer and to show message please login to Add to cart. I know there is free module which hide price and add to cart button. I do not want to hide price for product having price greater than zero (0). Need to show price but disable add to cart button Link to comment Share on other sites More sharing options...
BalzoT Posted May 12, 2017 Share Posted May 12, 2017 On product.tpl line 390 change this <p id="add_to_cart" class="buttons_bottom_block no-print"> <button type="submit" name="Submit" class="exclusive"> <span>{if $content_only && (isset($product->customization_required) && $product->customization_required)}{l s='Customize'}{else}{l s='Add to cart'}{/if}</span> </button> </p> to ... <p id="add_to_cart" class="buttons_bottom_block no-print"> <button type="submit" name="Submit" class="exclusive" {if !$is_logged}disabled{/if}> <span>{if $content_only && (isset($product->customization_required) && $product->customization_required)}{l s='Customize'}{else}{l s='Add to cart'}{/if}</span> </button> </p> that way your button won't trigger. But you will have to figure a different styling cause it will make the customers confused. I suggest you also add something like {if !$is_logged}<span>Log in to add to Cart</span>{/if} before the button 1 Link to comment Share on other sites More sharing options...
Zen_j1 Posted May 13, 2017 Author Share Posted May 13, 2017 (edited) Thank you so much it work 100% Edited May 13, 2017 by Zen_j1 (see edit history) Link to comment Share on other sites More sharing options...
italaccessori Posted May 16, 2017 Share Posted May 16, 2017 Hi, we can hide a price also in product list.tpl, shopping cart.tpl and shopping cart product line.tpl. Can someone help us, how to modify this files? Thanks Franto Link to comment Share on other sites More sharing options...
BalzoT Posted May 16, 2017 Share Posted May 16, 2017 Hi there, it is the same logic everywhere. You go to the file you want to change. Find the line that the price is outputted and add a check if it is larger than 0 before you display the value. For example. Product list.tpl line 69 is <span itemprop="price" class="price product-price"> {hook h="displayProductPriceBlock" product=$product type="before_price"} {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} </span> change it to <span itemprop="price" class="price product-price"> {hook h="displayProductPriceBlock" product=$product type="before_price"} {$product.price > 0} {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} {/if} </span> Same goes for the other files 2 Link to comment Share on other sites More sharing options...
italaccessori Posted May 16, 2017 Share Posted May 16, 2017 (edited) ok Edited May 16, 2017 by italaccessori (see edit history) Link to comment Share on other sites More sharing options...
italaccessori Posted May 18, 2017 Share Posted May 18, 2017 Hi there, it is the same logic everywhere. You go to the file you want to change. Find the line that the price is outputted and add a check if it is larger than 0 before you display the value. For example. Product list.tpl line 69 is <span itemprop="price" class="price product-price"> {hook h="displayProductPriceBlock" product=$product type="before_price"} {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} </span> change it to <span itemprop="price" class="price product-price"> {hook h="displayProductPriceBlock" product=$product type="before_price"} {$product.price > 0} {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} {/if} </span> Same goes for the other files Thank You very much!!! Franto Link to comment Share on other sites More sharing options...
bvaghani Posted May 25, 2017 Share Posted May 25, 2017 (edited) How to use this in prestashop 1.7 version? We want to show "Price on request" message if price is "€0.00". Edited May 25, 2017 by bvaghani (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted June 5, 2017 Share Posted June 5, 2017 If you want to do it configurable by product, category, etc. or by customer, group, etc. you can use this module https://addons.prestashop.com/en/order-management/26993-hide-price-and-disallow-purchase-of-products.html Link to comment Share on other sites More sharing options...
gumi Posted February 24, 2018 Share Posted February 24, 2018 How can I hide or disable the add to cart button if price is 0.I resolved the hide price if 0,I changed to call for price but the add to cart button is active.Can u help me please? Thank you. Link to comment Share on other sites More sharing options...
mellsaid Posted August 31, 2018 Share Posted August 31, 2018 Hello Guys, sorry to revive this discussion. Any one had solution for 1.7.4? We want to hide price or show POA in product page, category page and checkout. We use a request a quote module so we still want the customer to be able to add the price to their basket so they can submit the quote request, but want to change the price from 0 to POA desperately. Any pointers will be appreciated. Link to comment Share on other sites More sharing options...
Knowband Plugins Posted September 1, 2018 Share Posted September 1, 2018 22 hours ago, mellsaid said: Hello Guys, sorry to revive this discussion. Any one had solution for 1.7.4? We want to hide price or show POA in product page, category page and checkout. We use a request a quote module so we still want the customer to be able to add the price to their basket so they can submit the quote request, but want to change the price from 0 to POA desperately. Any pointers will be appreciated. Edit the themes/classic/templates/catalog/_partials/miniatures/product.tpl & search for <span itemprop="price" class="price">{$product.price}</span> and replace this line with {if $product.price eq "0"} <span itemprop="price" class="price">POA</span> {else} <span itemprop="price" class="price">{$product.price}</span> {/if} This change will change the price 0 to POA in the home page, category page etc page. For product page, you need to make changes in the other file. Kindly first check the changes on the home page & category page & confirm. 1 Link to comment Share on other sites More sharing options...
daysprng Posted September 5, 2018 Share Posted September 5, 2018 (edited) On 01.09.2018 at 8:01 PM, Knowband Plugins said: Edit the themes/classic/templates/catalog/_partials/miniatures/product.tpl & search for <span itemprop="price" class="price">{$product.price}</span> and replace this line with {if $product.price eq "0"} <span itemprop="price" class="price">POA</span> {else} <span itemprop="price" class="price">{$product.price}</span> {/if} This change will change the price 0 to POA in the home page, category page etc page. For product page, you need to make changes in the other file. Kindly first check the changes on the home page & category page & confirm. Thanks. But it doesn't work in Prestashop 1.7.2.2. Edited September 5, 2018 by daysprng (see edit history) Link to comment Share on other sites More sharing options...
Knowband Plugins Posted September 5, 2018 Share Posted September 5, 2018 My mistake. $product.price is the amount with the currency so the comparison will not work. Replace {if $product.price eq "0"} with this in the above code & check again (Clear the cache from the backend) {if $product.price_amount eq "0"} 2 Link to comment Share on other sites More sharing options...
daysprng Posted September 6, 2018 Share Posted September 6, 2018 It works. Thanks a lot!!! 1 Link to comment Share on other sites More sharing options...
Abdallh Posted December 10, 2018 Share Posted December 10, 2018 On 5/12/2017 at 2:14 PM, BalzoT said: On the product.tpl line 264 there is this code <span id="our_price_display" class="price" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice|floatval}</span> you can change it to {if $productPrice > 0 }<span id="our_price_display" class="price" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice|floatval}</span>{/if} I cant find this file to perform modification Link to comment Share on other sites More sharing options...
Ennkko Posted May 23, 2019 Share Posted May 23, 2019 On 9/1/2018 at 8:01 PM, Knowband Plugins said: This change will change the price 0 to POA in the home page, category page etc page. For product page, you need to make changes in the other file. Kindly first check the changes on the home page & category page & confirm. Hello, KP. What changes and in what file I need to make for change 0 price on product page? Link to comment Share on other sites More sharing options...
RawArt Posted December 18, 2019 Share Posted December 18, 2019 I also have this problem and from the discussion I didn't understand how exactly to hide price in prestashop 1.7.6.2 if the price is 0. I would like to hide in main product page, in category product listing and in the quick view. But I don't know in which product.tpl put this code: {if $product.price_amount eq "0"} <p> </p> {else} {block name='product_prices'} {include file='catalog/_partials/product-prices.tpl'} {/block} {/if} I have a custom theme, not classic. 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