Tropical Dream Posted October 6, 2009 Share Posted October 6, 2009 Hi everyone, I need you're help to figure out something in the Prestashop configuration.In my shop, I don't want to display the price of all the items. I have 2 categories of products:- in category 1, each product have a set retail price- in category 2, the items do not have a set price (EXTREMELY customizable products and prone to competitors underpricing).Therefore, I would like to show the general product picture and description for all product categories, but for category 2, I would like the customer to contact us for the exact price.Therefore, my question is: How can I show prices for some products only and display "please call for quote" for other items? 1 Link to comment Share on other sites More sharing options...
TropischBruin Posted October 6, 2009 Share Posted October 6, 2009 There is a topic about this "somewhere" on this forums. Code is made by Hans from Spain but it has not been updated for PS 1.2.4.0See: Here. Link to comment Share on other sites More sharing options...
Tropical Dream Posted October 6, 2009 Author Share Posted October 6, 2009 thanks I see you asked for the same thing! Thanks for your help.Does anyone have a way to show prices for some products only that is compatible with 1.2.4? Link to comment Share on other sites More sharing options...
Unsought_ Posted October 18, 2009 Share Posted October 18, 2009 And does it work for you on 1.2.4. ??? Link to comment Share on other sites More sharing options...
Miha Posted November 28, 2009 Share Posted November 28, 2009 i need this too. when I set the price to 0€, it should display "call us for pricing". anyone? Link to comment Share on other sites More sharing options...
Miha Posted December 4, 2009 Share Posted December 4, 2009 I need this badly. I probably have to add a line of code to work this out, so can someone please help me? Link to comment Share on other sites More sharing options...
rocky Posted December 5, 2009 Share Posted December 5, 2009 Unfortunately, this is not an easy thing to do. Do not try this unless you are comfortable messing around with code and have backed up these files before modifying them.The way I would do it is to add the following at line 177 of classes/Tools.php (after the "$price =" line): if ($price == 0) return 'Call for price'; and modify js/tools.js in your theme's directory and add the following to the start of the formatCurrency function: if (price == 0) return 'Call for price'; This will change all $0.00 to 'Call for price', but on the product page, it will display as 'Call for price tax incl.', so you'll have to modify product.tpl and the tpls of any other modules if necessary and write something like {if $price != 0}{l s='tax incl.'}{/if}. You'll have to modify modules/blockcart/blockcart.php too, since the totals will display as 'Call for price' when nothing is in the cart. Change lines 43-47 from: 'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 5), $currency), 'show_wrapping' => floatval($params['cart']->getOrderTotal(true, 6)) > 0 ? true : false, 'wrapping_cost' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 6), $currency), 'product_total' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 4), $currency), 'total' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true), $currency), to: 'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 5), $currency) == 'Call for price' ? Tools::displayPrice(0.001, $currency) : Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 5), $currency), 'show_wrapping' => floatval($params['cart']->getOrderTotal(true, 6)) > 0 ? true : false, 'wrapping_cost' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 6), $currency) == 'Call for price' ? Tools::displayPrice(0.001, $currency) : Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 6), $currency), 'product_total' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 4), $currency) == 'Call for price' ? Tools::displayPrice(0.001, $currency) : Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 4), $currency), 'total' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true), $currency) == 'Call for price' ? Tools::displayPrice(0.001, $currency) : Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true), $currency), Hopefully, this will give you a starting point for displaying 'Call for price'. Link to comment Share on other sites More sharing options...
Miha Posted December 5, 2009 Share Posted December 5, 2009 rocky, thank you very much!I don't know where in product.tlp to put the code so that it would exclude "tax incl.". Otherwise it works great! Link to comment Share on other sites More sharing options...
rocky Posted December 6, 2009 Share Posted December 6, 2009 I'll be more specific. Change lines 195-221 of product.tpl from: {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$product->getPrice(true, $smarty.const.NULL, 2)} {l s='tax incl.'} {/if} {if $priceDisplay == 1} {convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)} {l s='tax excl.'} {/if} {if $priceDisplay == 2} {convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)} {l s='tax excl.'} {/if} {if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))} {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$product->getPriceWithoutReduct()} {l s='tax incl.'} {/if} {if $priceDisplay == 1} {convertPrice price=$product->getPriceWithoutReduct(true)} {l s='tax excl.'} {/if} to: {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$product->getPrice(true, $smarty.const.NULL, 2)} {if $price > 0}{l s='tax incl.'}{/if} {/if} {if $priceDisplay == 1} {convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)} {if $price > 0}{l s='tax excl.'}{/if} {/if} {if $priceDisplay == 2} {convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}{if $price > 0} {l s='tax excl.'}{/if} {/if} {if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))} {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$product->getPriceWithoutReduct()} {if $price > 0}{l s='tax incl.'}{/if} {/if} {if $priceDisplay == 1} {convertPrice price=$product->getPriceWithoutReduct(true)} {if $price > 0}{l s='tax excl.'}{/if} {/if} Link to comment Share on other sites More sharing options...
thethreedegrees Posted February 3, 2010 Share Posted February 3, 2010 Hi Rocky,the IF statement {if $price > 0}{l s='tax excl.'}{/if} is working for the product that I have set as 0 but it is also removing 'tax excl' or 'tax incl' from all other products. I would like for these to remainAny ideas why this would,be happening? Link to comment Share on other sites More sharing options...
rocky Posted February 4, 2010 Share Posted February 4, 2010 I can't figure out what I was thinking when I wrote that code. I can't find a $price variable. Try the following instead: {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$product->getPrice(true, $smarty.const.NULL, 2)} {if $product->getPrice(true, $smarty.const.NULL, 2) > 0}{l s='tax incl.'}{/if} {/if} {if $priceDisplay == 1} {convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)} {if $product->getPrice(false, $smarty.const.NULL, 2) > 0}{l s='tax excl.'}{/if} {/if} {if $priceDisplay == 2} {convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}{if $product->getPrice(false, $smarty.const.NULL, 2) > 0} {l s='tax excl.'}{/if} {/if} {if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))} {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$product->getPriceWithoutReduct()} {if $product->getPriceWithoutReduct() > 0}{l s='tax incl.'}{/if} {/if} {if $priceDisplay == 1} {convertPrice price=$product->getPriceWithoutReduct(true)} {if $product->getPriceWithoutReduct(true) > 0}{l s='tax excl.'}{/if} {/if} Link to comment Share on other sites More sharing options...
thethreedegrees Posted February 4, 2010 Share Posted February 4, 2010 More perfect it could not be!:-)thanks a million.Quick edit.I have disabled out of stock ordering in the BO so the cart button does not display.Final code hack is with displaying the "number of item in stock" Would like to remove this line for all products that are at 0 stock also. So to do this:In product.tpl around line 266Replace:<!-- number of item in stock --> quantity == 0)} style="display:none;"{/if}>{$product->quantity|intval}quantity > 1} style="display:none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}quantity < 2} style="display:none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'} With:<!-- number of item in stock -->quantity < 2} style="display:none;"{/if} id="quantityAvailable">{$product->quantity|intval}quantity != 1} style="display:none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}quantity < 2} style="display:none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'} What this will do is remove any stock quantity level message from items that are at 0 stock from displaying. Link to comment Share on other sites More sharing options...
sm3004 Posted February 5, 2010 Share Posted February 5, 2010 I am trying to do something very similar, but instead of displaying a call us, I want to display: "Sold Out" if the product quantity is 0 but can't get it to work...See this thread where I am asking for something similar: http://www.prestashop.com/forums/viewthread/43138/I thought adding the following code would be a solution, but it doesn't work for some reason: {if $product->quantity == 0} {l s='SOLD OUT!'} {/if} On the same page, there is the code to hide the Add to Cart button if the item is unavailable: quantity == 0} style="display:none;"{/if} id="add_to_cart" class="buttons_bottom_block"> <input type="submit" name="Submit" value="{l s='Add to cart'}" /></span> How come that works fine, yet I can't get the opposite to work??? If i use the first code, it will still display items that have quantity available if entered in the "1. Info" tab in the back office...What is the variable that displays the overall quantity of the products if it is not: $product->quantity??? Link to comment Share on other sites More sharing options...
rocky Posted February 6, 2010 Share Posted February 6, 2010 See my post here. Link to comment Share on other sites More sharing options...
Rhobur Posted July 4, 2010 Share Posted July 4, 2010 Rocky, can you help me with modifying the blockcart.php for the 1.3.1 version ? The above doesn't fit anymore now the declaration are : 'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal($usetax, 5), $currency), 'show_wrapping' => $wrappingCost > 0 ? true : false, 'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency), 'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($usetax, 4), $currency), 'total' => Tools::displayPrice($params['cart']->getOrderTotal($usetax), $currency),instead and I'm stuck with the cart showing 'ask for price'. Link to comment Share on other sites More sharing options...
BoDoPSX Posted July 8, 2010 Share Posted July 8, 2010 hiit works great on 1.25 and thanks Rocky for helpone small issue on order.php i think. when the mails arrives Discounts, Gift-wrapping and Shipping display the text not 0.any solution like in blockcart.php?thanks in advance Link to comment Share on other sites More sharing options...
camrinp Posted October 8, 2010 Share Posted October 8, 2010 Will this solution work with prestashop 1.3 since i am in dire need of this functionality Link to comment Share on other sites More sharing options...
rocky Posted October 8, 2010 Share Posted October 8, 2010 Yes, it should. Even if the code is slightly different, the principle is the same. Link to comment Share on other sites More sharing options...
OleEskildsen Posted October 14, 2010 Share Posted October 14, 2010 Are there some who have made changes to PrestaShop 1.3.2, I can not really get it to work, have made changes in Tools.php and tools.js and it works, but can not really find out where I need to change in product.js and blockcart.php Link to comment Share on other sites More sharing options...
camrinp Posted October 14, 2010 Share Posted October 14, 2010 Ill try getting it to work this afternoon if i succeed ill send u a pm and walk you through it tommarow Link to comment Share on other sites More sharing options...
OleEskildsen Posted October 14, 2010 Share Posted October 14, 2010 Ill try getting it to work this afternoon if i succeed ill send u a pm and walk you through it tommarow Sounds great Link to comment Share on other sites More sharing options...
camrinp Posted October 15, 2010 Share Posted October 15, 2010 So far managed to edit Tools.php and tools.js and now my store is showing 'Call for price'. However now lis the issue to fix blockcart module from saying that. You can see what i mean by navigating to www.thunderbayindustrial.ca . Got into block cart and am having difficulties with it since it is not nerely the same as the one rocky showed since that was 1.2 and now im using 1.3 and there has been some changes there, but i think ill be able to figure it out tommarow once i disect it a bit more(didn't have much time before work) , add me to msn(see pm) and maybe we can work this out together. Ill be up around 9 am eastern tackling this SOB hehe. Link to comment Share on other sites More sharing options...
TassaDarK Posted October 26, 2010 Share Posted October 26, 2010 Hicamrinp did you find out a final solution for ps 1.3? I think there are some people interested in this, me first.Thank you Link to comment Share on other sites More sharing options...
Rhobur Posted October 27, 2010 Share Posted October 27, 2010 I'll second that, long time since I'm looking for a solution to the issue; maybe someoneis more resourcefull about it.Regards, Link to comment Share on other sites More sharing options...
TassaDarK Posted October 27, 2010 Share Posted October 27, 2010 I have a fantastic solution for this issue for PS 1.3.1. It's based on Hans's (a spanish guy) excellent work but he did it years ago for ps 1.0. I have adapted it for 1.3.1 versión (don't tested in 1.3.2).I'll post here soon when i'm done testing. Link to comment Share on other sites More sharing options...
TassaDarK Posted October 27, 2010 Share Posted October 27, 2010 Ok, here you have a complete (and in my opinion) best solution for this matter:PS 1.3 “Enabler/disabler cart modification” (hide cart and prices from item menu in BO)Regards Link to comment Share on other sites More sharing options...
camrinp Posted November 3, 2010 Share Posted November 3, 2010 Hey for all that is wondering so far I have gotten this to work in prestashop 1.3.1 the steps are as follows:classes/Tools.php After line 229 ($price = self::ps_round($price, $c_decimals);add the following: if ($price == 0) return 'Call for price'; in modules/blockcart/blockcart.php change the corresponding array values to reflect 'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal($usetax, 5), $currency) == 'Call for price' ? '$0' : Tools::displayPrice($params['cart']->getOrderTotal($usetax, 5), $currency), 'show_wrapping' => $wrappingCost > 0 ? true : false, 'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency) == 'Call for price' ? '$0' : Tools::displayPrice($wrappingCost, $currency), 'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($usetax, 4), $currency) == 'Call for price' ? '$0' : Tools::displayPrice($params['cart']->getOrderTotal($usetax, 4), $currency), 'total' => Tools::displayPrice($params['cart']->getOrderTotal($usetax), $currency) == 'Call for price' ? '$0' : Tools::displayPrice($params['cart']->getOrderTotal($usetax), $currency), So far that is as far as i have gotten but i will post as i progress further. If you would like to see the outcome please navigate to www.thunderbayindustrial.ca , take note i do not charge for shipping therefore shipping is always 0 with my cart(i did not hard code it as zero in my code tho it still accounts for flexibility) Link to comment Share on other sites More sharing options...
TassaDarK Posted November 4, 2010 Share Posted November 4, 2010 camrinp have you tried my solution? I think the possibility to choose where show cart or not in a item basis from the BO is more reliable than based in price. Furthermore with that modification you don't show any prices or cart, only a link to the contact form. But that is only my opinion.Regards Link to comment Share on other sites More sharing options...
camrinp Posted November 8, 2010 Share Posted November 8, 2010 I did try your solution however my client wants it to behave exactly like this Link to comment Share on other sites More sharing options...
TassaDarK Posted November 8, 2010 Share Posted November 8, 2010 ahps, ok Link to comment Share on other sites More sharing options...
vietnam Posted November 30, 2010 Share Posted November 30, 2010 It seems to be a problem if you have atributeshttp://mobila-online.biz/496-aplica-de-tavan-2214-2-kids.html without atributes it`s fine.http://mobila-online.biz/chiuveta-inox-cu-2-cuve-si-picurator/314-chiuveta-inox-teka-cosmos-45-b.html with atributes not so fine. Link to comment Share on other sites More sharing options...
TassaDarK Posted November 30, 2010 Share Posted November 30, 2010 Mmmm, yeah, but i don't understand the necessity to add attributes to a item with "contact with us" button. It not gonna be a direct buy by adding to cart, you can add the different variants in the item description area. Link to comment Share on other sites More sharing options...
ab Posted April 5, 2011 Share Posted April 5, 2011 sorry, please help me, I couldn't find where is classes/Tools.php. I'm a beginner at PS. and I have basic knowledge on C programming only.Luckily I managed to do some changes at js/tools.js in the theme directory. Link to comment Share on other sites More sharing options...
cth7687 Posted May 11, 2011 Share Posted May 11, 2011 Rocky, Thanks for the good tip, ===================================================if ($price == 0) return 'Call for price'; and modify js/tools.js in your theme’s directory and add the following to the start of the formatCurrency function:if (price == 0) return 'Call for price'=================================================These code are still working on 1.4.0~, but my case, S/H and Total also showing "call for price" on My cart. Could you tell me how can I fix this? Link to comment Share on other sites More sharing options...
ScubaLessonsInc Posted August 19, 2011 Share Posted August 19, 2011 Rocky, I did this and it has worked PERFECTLY in 4 versions, however I just started getting tons of orders and decided to use the MailAlerts module. I noticed something very funny.. In the module where Discounts and Gift Wrapping should show $0, it now shows "Call for price". I am guessing this is because of this modification to make prices with $0 show "call for price" How do I exclude this from the mail alerts and emails that go to the customers confirming thier order so that the $0 show there? See attached for example to help explain. Link to comment Share on other sites More sharing options...
ScubaLessonsInc Posted August 22, 2011 Share Posted August 22, 2011 Rocky, Can you please help me with this request? You seem to be the only resident pro with knowledge of this tweak. I also attached an image of the html version of the mailalerts module showing the fields it pulls from if that may help. Please advise if I can just edit this and how to make the correction?? The fields that should be showing $0 like Discounts, Gift Wrapping, Shipping are coming up "Call for Price" which is some how because of this fix above I used to have customers call for price when I put 0$ for the price of an item. Per your code above. But I don't want that to appear on any emails to the customers. How can exclude the emails? Thanks, Tina Link to comment Share on other sites More sharing options...
deep42 Posted October 6, 2011 Share Posted October 6, 2011 I do realize this is a quite old topic, but... How would you implement the 'Call for price' feature in multiple languages? I managed to get the shop to return a text string for certain products ('Call for quote'), but how can I show a different string (the translation) when selecting another language? I tried with {l s='...'} in various combinations, but obviously in doesn't work, because the variable is not part of a .tpl file, so I could later edit its translation in the back-office. I've also tried to do a layered if($lang_iso == 1/2/3...) return '...', but that didn't work either. Any ideas? Thank you Link to comment Share on other sites More sharing options...
ScubaLessonsInc Posted October 6, 2011 Share Posted October 6, 2011 I would highly reccomend you upgrade the site to 1.4.4.1 and the products in that version have a check box to show price.. just uncheck it. Then it works like a catalog.. just add "Call for Price" and the phone number to short description. Works great. They way we did that before caused all kinds of issues in the mail alerts and in the checkout so I would not even try it. If you have an earlier version just upgrade.. I just updated all my sites and glad I did. Link to comment Share on other sites More sharing options...
deep42 Posted October 7, 2011 Share Posted October 7, 2011 That's a good idea. I actually never noticed that option. It's available in 1.4.1.0 as well. It might be a better idea, because this way you wouldn't have a shopping cart that says 'Call for price' instead of an ammount in USD/ EUR. Thank you. Link to comment Share on other sites More sharing options...
PaulScott17 Posted October 9, 2011 Share Posted October 9, 2011 Hi, Is there a way of displaying the prices in catalog mode? I would like to use the catalog mode without the shopping basket but this also removes the prices from view. Any assistance would be appreciated. Paul Version PrestaShop™ 1.4.4.1 Link to comment Share on other sites More sharing options...
ScubaLessonsInc Posted October 11, 2011 Share Posted October 11, 2011 You could put it into the short description. Link to comment Share on other sites More sharing options...
aslamweb Posted August 30, 2015 Share Posted August 30, 2015 I wanna create a online antique stuff display/store | with no online shopping option . I wanna replace price 0.0 € with call for price image I don't need cart for my display / store website. Link to comment Share on other sites More sharing options...
FanieLumia Posted October 15, 2015 Share Posted October 15, 2015 Hey guys Any update on how to achieve this 'Call for price" feature in Prestashop 1.6.1.1? The code has changed a bit since this thread started. Thanks in advance! 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