antonio.soleres Posted December 19, 2012 Share Posted December 19, 2012 In Prestashop 1.5.2, is there any way that in the shopping cart appears the following information: “Remaining amount to be added to your cart in order to obtain free shipping”, as appeared in version 1.4.8.2? Thanks. Link to comment Share on other sites More sharing options...
jd440 Posted January 21, 2013 Share Posted January 21, 2013 I'm looking for the same answer. Did you find the solution? Link to comment Share on other sites More sharing options...
antonio.soleres Posted January 21, 2013 Author Share Posted January 21, 2013 No. No answers and I have not find the solution. Link to comment Share on other sites More sharing options...
jd440 Posted January 21, 2013 Share Posted January 21, 2013 Thanks for your answer. So There is 2way. Find a module which offer this function Developa module which offer this function But I'm surprise a so useful function, disapear ?! Link to comment Share on other sites More sharing options...
Ranno Presta Posted June 6, 2013 Share Posted June 6, 2013 i have the same problem ,can any one help me ! Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted January 31, 2014 Share Posted January 31, 2014 This post might help: http://www.prestashop.com/forums/topic/304754-contribution-free-shipping-if-total-is-over-x-excluding-specific-categories/ Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted February 17, 2014 Share Posted February 17, 2014 Hi, I hope this will help: http://blog.belvg.com/the-minimal-order-amount-for-free-shipping.html Regards Link to comment Share on other sites More sharing options...
mefistor Posted May 30, 2014 Share Posted May 30, 2014 Thanks Alex but i don't find where to put the code i don't see the function ps 1.5.5.0 To calculate missing amount you need to do override the functionPаrentOrderCоntrоller::_аssignSummаryInfоrmаtiоns() by adding the following lines: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... if ($free_ship = Tools::convertPrice((float)(Configuration::get('PS_SHIPPING_FREE_PRICE')), new Currency((int)($this->context->cart->id_currency)))) { $discounts = $this->context->cart->getCartRules(); $total_free_ship = $free_ship - ($summary['total_products_wt'] + $summary['total_discounts']); foreach ($discounts as $discount) If ( $discount[ 'id_disсоunt_type') == 3) { $total_free_ship = 0; break; } $summary['free_ship'] = $total_free_ship; } ... In the code above, we have identified the variable free_ship, which we will use in the templateshopping-cart.tpl . The code below we have added at the end of the block <tfооt> 1 2 3 4 5 6 ... <tr class="remaining_cart_free_shipping" {if $free_ship <= 0 || $isVirtualCart} style="display: none;" {/if}> <td colspan="6" style="white-space: normal;">{l s='Remaining amount to be added to your cart in order to obtain free shipping:'}</td> <td id="free_shipping" class="price">{displayPrice price=$free_ship}</td> </tr> ... Here is the result: To ensure that our new block will appear and disappear when changing AJAX shopping cart we should override the function CаrtCоntrоller::displаyAjаx() by adding the following code before calling the hook асtiоnCаrtListOverride : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 … if ($free_ship = Tools::convertPrice((float)(Configuration::get('PS_SHIPPING_FREE_PRICE')), new Currency((int)($this->context->cart->id_currency)))) { $discounts = $this->context->cart->getCartRules(); $total_free_ship = $free_ship - ($result['summary']['total_products_wt'] + $result['summary']['total_discounts']); foreach ($discounts as $discount) If ( $discount[ 'id_disсоunt_type') == 3) { $total_free_ship = 0; break; } $result['summary']['free_ship'] = $total_free_ship; } ... This code will allow using data about the short fall of the amount required for free delivery in the theme file cart-summary.js. We’ll need to change the function updаteCаrtSummаry(jsоn)by adding these lines: 1 2 3 4 5 if (json.free_ship >= 0) { $(".remaining_cart_free_shipping").show(); } else { $(".remaining_cart_free_shipping").hide(); } Thanks for your help Link to comment Share on other sites More sharing options...
mefistor Posted May 30, 2014 Share Posted May 30, 2014 sry i found it just a strange problem form copying and pasting on notepad++, but when I type it it found :S Link to comment Share on other sites More sharing options...
Recommended Posts