hostricity Posted April 17, 2013 Share Posted April 17, 2013 The shopping cart is displaying "Free Shipping" even though free shipping is disabled. It calculates the shipping correctly when we get to shipping in the checkout. In fact, if a customer logs in, it immediately calculates the shipping and displays the lowest shipping cost. "Free Shipping" is disabled in the back office. How do we stop PrestaShop from displaying "Free Shipping" before the shipping has been calculated? The shipping field should be blank or say something - anything except "Free Shipping" See two images. Order - Pendulum Charts by Xeonix - Free Shipping.pdf Order - Pendulum Charts by Xeonix - shipping charges.pdf Shipping - PrestaShop Free Shipping Settings.pdf Link to comment Share on other sites More sharing options...
benjamin utterback Posted April 17, 2013 Share Posted April 17, 2013 Hello, what version of PrestaShop are you using? Link to comment Share on other sites More sharing options...
hostricity Posted April 18, 2013 Author Share Posted April 18, 2013 (edited) PrestaShop™ 1.5.4.0 - It says this in the screenshot. Sorry for the cheap shot, but I am extremely frustrated at the number of seemingly basic things in PrestaShop that don't work. ALSO: It is NOT the template. When I switch back to the default template, I still have the same problem. Edited April 18, 2013 by hostricity (see edit history) Link to comment Share on other sites More sharing options...
tdr170 Posted April 18, 2013 Share Posted April 18, 2013 (edited) OOOOOOOOoops Edited April 18, 2013 by tdr170 (see edit history) Link to comment Share on other sites More sharing options...
tdr170 Posted April 18, 2013 Share Posted April 18, 2013 (edited) The shopping cart is displaying "Free Shipping" even though free shipping is disabled. It calculates the shipping correctly when we get to shipping in the checkout. In fact, if a customer logs in, it immediately calculates the shipping and displays the lowest shipping cost. "Free Shipping" is disabled in the back office. How do we stop PrestaShop from displaying "Free Shipping" before the shipping has been calculated? The shipping field should be blank or say something - anything except "Free Shipping" See two images. Free Shipping! which appears in the cart block until the customer has added an address and shipping can be calculated. @ around line 598 in ajax-cart.js, change the script as below. Change this: if (parseFloat(jsonData.shippingCostFloat) > 0 || jsonData.nbTotalProducts < 1) $('.ajax_cart_shipping_cost').text(jsonData.shippingCost); else if (typeof(freeShippingTranslation) != 'undefined') $('.ajax_cart_shipping_cost').html(freeShippingTranslation); To This: if (parseFloat(jsonData.shippingCostFloat) == 0 && parseInt(jsonData.nbTotalProducts) >= 0) $('.ajax_cart_shipping_cost').text(jsonData.shippingCost); else $('.ajax_cart_shipping_cost').text(jsonData.shippingCost); Hello, what version of PrestaShop are you using? Seem Familiar !!! LOL Edited April 18, 2013 by tdr170 (see edit history) 1 Link to comment Share on other sites More sharing options...
benjamin utterback Posted April 18, 2013 Share Posted April 18, 2013 Hi hostricity, no problem. I did overlook that. Try tdr170's solution, let us know if it works for you? ; Seem Familiar !!! LOL I don't know what you mean Tod? I was just asking what version Link to comment Share on other sites More sharing options...
hostricity Posted April 19, 2013 Author Share Posted April 19, 2013 (edited) No, this did not fix it. Even if it did, I'd be concerned about some other problem causing this which should concern me. This isn't a known bug in Prestashop is it? If the code has to be hacked, I can figure that out, but I want to understand what is going on that requires the code to be hacked - unless it is a known bug. Edited April 19, 2013 by hostricity (see edit history) Link to comment Share on other sites More sharing options...
tdr170 Posted April 19, 2013 Share Posted April 19, 2013 (edited) No, this did not fix it. Even if it did, I'd be concerned about some other problem causing this which should concern me. This isn't a known bug in Prestashop is it? This does fix it as I can show in my site I applied this change and the Free shipping changed to $0.00. If you applied this fix correctly and turned force compile on and cache off you should see the change. If the cart still does not change use your FTP and clear all files form your smarty cache and compile folder with the exception of any index.php files you may find. ../cache/smarty/ cache & compile I have a feeling that yours has not changed due to your browser loading a cahed page without the change. Yes this is a known issue not not necessarily a bug. I have used this for some time and there are no issues concerning this fix, and the ajax-cart lines are the cause. Edited April 19, 2013 by tdr170 (see edit history) 1 Link to comment Share on other sites More sharing options...
hostricity Posted April 19, 2013 Author Share Posted April 19, 2013 (edited) This does fix it as I can show in my site I applied this change and the Free shipping changed to $0.00. If you applied this fix correctly and turned force compile on and cache off you should see the change. If the cart still does not change use your FTP and clear all files form your smarty cache and compile folder with the exception of any index.php files you may find. ../cache/smarty/ cache & compile I have a feeling that yours has not changed due to your browser loading a cahed page without the change. Yes this is a known issue not not necessarily a bug. I have used this for some time and there are no issues concerning this fix, and the ajax-cart lines are the cause. Thank you for your explicit response. I'll look at it further and am sure I can get it working. I do have caching off, etc., but... OK. HERE'S The problem: The ajax-cart.js file is over-ridden by another ajax-cart.js file in my theme. When I test with the default theme, it works correctly. Patching the ajax-cart.js file in the theme now... Edited April 19, 2013 by hostricity (see edit history) Link to comment Share on other sites More sharing options...
naimisa Posted April 24, 2013 Share Posted April 24, 2013 Just comment the line which shows the Shipping ; File path: ~\themes\default\modules\blockcart\blockcart.tpl <p id="cart-prices"> <!-- <span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span> <span>{l s='Shipping' mod='blockcart'}</span> <br/> {if $show_wrapping} {assign var='cart_flag' value='Cart::ONLY_WRAPPING'|constant} <span id="cart_block_wrapping_cost" class="price cart_block_wrapping_cost">{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, $cart_flag)}{else}{convertPrice price=$cart->getOrderTotal(true, $cart_flag)}{/if}</span> <span>{l s='Wrapping' mod='blockcart'}</span> <br/> {/if} !--> Then your cart will be... Thanks, Hanafi. Link to comment Share on other sites More sharing options...
tdr170 Posted April 24, 2013 Share Posted April 24, 2013 Just comment the line which shows the Shipping ; File path: ~\themes\default\modules\blockcart\blockcart.tpl <p id="cart-prices"> <!-- <span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span> <span>{l s='Shipping' mod='blockcart'}</span> <br/> {if $show_wrapping} {assign var='cart_flag' value='Cart::ONLY_WRAPPING'|constant} <span id="cart_block_wrapping_cost" class="price cart_block_wrapping_cost">{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, $cart_flag)}{else}{convertPrice price=$cart->getOrderTotal(true, $cart_flag)}{/if}</span> <span>{l s='Wrapping' mod='blockcart'}</span> <br/> {/if} !--> Then your cart will be... Thanks, Hanafi. We don't want to remove the shipping all together just don't want it to say Free shipping. The fix I posted above does this. Link to comment Share on other sites More sharing options...
Goldmaverick Posted April 27, 2013 Share Posted April 27, 2013 I have the same issue. This seems like something Prestashop should've fixed?! Link to comment Share on other sites More sharing options...
tdr170 Posted April 27, 2013 Share Posted April 27, 2013 (edited) OK just doing some testing and found that you can change both the header cart and the cart summery Free shipping right in the BO. Just go to localization, translations there are two areas that need to be translated. First go to Front office translations click on your flag, scroll down and find shopping-cart and add the Free shipping! translation to your choice and then click Update translations. $0.00 what I used. Now go to Installed modules translations, scroll down and find Module: Blockcart and change the Free shipping! translation to your choice. $0.00 what I used. This works and no need to edit and change any files. Edited April 27, 2013 by tdr170 (see edit history) Link to comment Share on other sites More sharing options...
kenkokafe Posted June 3, 2013 Share Posted June 3, 2013 tdr170 thx for the fix. now i got a question sort of related due to the actual shipping charges. I have started this topic: http://www.prestashop.com/forums/topic/251979-two-issues/page__p__1253833#entry1253833 see if you could help thansk many thanks for this solution Link to comment Share on other sites More sharing options...
khinester Posted July 10, 2013 Share Posted July 10, 2013 The shopping cart is displaying "Free Shipping" even though free shipping is disabled. It calculates the shipping correctly when we get to shipping in the checkout. In fact, if a customer logs in, it immediately calculates the shipping and displays the lowest shipping cost. "Free Shipping" is disabled in the back office. How do we stop PrestaShop from displaying "Free Shipping" before the shipping has been calculated? The shipping field should be blank or say something - anything except "Free Shipping" See two images. go to Carriers and make sure that all checkboxes are checked for Group Access especially Guest, Default and Visitor. this then works fine for PS 1.5.4.1 Link to comment Share on other sites More sharing options...
williambesson Posted October 16, 2013 Share Posted October 16, 2013 Hello Unfortunately I am encountering the same issue here. I have put the fix in place in ajax-cart.js but no luck. (I have forced compile) I can't do the translations thing as I am over the limit and my host won't up the limit for security reasons. I am just thinking of something. As you can see on my screenshots I have these two carrier appearing. What about removing the "free" carrier in my db. Would that create a mess? Thanks for your time Guillaume Link to comment Share on other sites More sharing options...
Evgenii Pavlov Posted March 24, 2018 Share Posted March 24, 2018 up Link to comment Share on other sites More sharing options...
Mercader Virtual Posted March 19, 2019 Share Posted March 19, 2019 (edited) This is the solution for PS 1.7 in relation to showing "Free" when the shipping is not even yet calculated, that is, we still don't know if we are gonna be able to offer free shipping (rules are not yet applied). So the solution was to check if there are any items in the cart. If there aren't, that means that shipping hasn't been calculated at all, so we can just show $0.00. (Notice the static dollar sign, not great but at least it works for single currency shops, just put the correct sign. Multi-currency carts should find a fix to dynamically change the sign, maybe adding variable in CartPresenter.php). Edit this file: themes/<your_theme>/templates/checkout/_partials/cart-detailed-totals.tpl Replace: <span class="value">{$subtotal.value}</span> With: {if $subtotal.type === 'shipping' && $cart.products_count==0} <span class="value">$0.00</span> {else} <span class="value">{$subtotal.value}</span> {/if} Edited March 19, 2019 by mysticav (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