<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: How to show &#8220;spend X to get Free Shipping&#8221; in Prestashop</title>
	<atom:link href="http://nemops.com/prestashop-show-free-shipping/feed/" rel="self" type="application/rss+xml" />
	<link>http://nemops.com/prestashop-show-free-shipping/</link>
	<description>Prestashop Tutorials, Modules and More!</description>
	<lastBuildDate>Fri, 10 Mar 2023 23:25:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.35</generator>
	<item>
		<title>By: Martin Kokeš</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-46257</link>
		<dc:creator><![CDATA[Martin Kokeš]]></dc:creator>
		<pubDate>Thu, 11 Feb 2016 11:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-46257</guid>
		<description><![CDATA[Hello, I have made an upgrade from PS 1.4 to 1.6 and this works for me in my custom template

{assign var=&#039;freeshipping_price&#039; value=Configuration::get(&#039;PS_SHIPPING_FREE_PRICE&#039;)}

                {if $freeshipping_price}

                    {assign var=&#039;freeshipping_price_converted&#039; value={toolsConvertPrice price=$freeshipping_price}}

                    {math equation=&#039;a-b&#039; a=$total_price b=$total_shipping assign=&#039;total_without_shipping&#039;}

                    {math equation=&#039;a-b&#039; a=$freeshipping_price_converted b=$total_without_shipping assign=&#039;remaining_to_spend&#039;}

                    {if $remaining_to_spend &gt; 0 &amp;&amp; $freeshipping_price_converted &gt;= 0 &amp;&amp; !$isVirtualCart}

                        

                            {l s=&#039;Remaining amount to be added to your cart in order to obtain free shipping:&#039;}

                            {convertPrice price=$remaining_to_spend}

                        

                    {/if}

                {/if}

                {addJsDef freeshipping_price_converted=$freeshipping_price_converted&#124;intval}

================ cart-summary.js in your template =============
at the end of function updateCartSummary add this BEFORE the ending bracket }:

// REMAINING AMOUNT TO SPEND FOR FREE SHIPPING

        if(json.total_products_wt &gt;= freeshipping_price_converted) {

            // hide spend more to get free shipping

            $(&#039;#free-shipping-block&#039;).fadeOut();

        } else {

            // show spend more to get free shipping

            $(&#039;#free-shipping-block&#039;).fadeIn();

        }]]></description>
		<content:encoded><![CDATA[<p>Hello, I have made an upgrade from PS 1.4 to 1.6 and this works for me in my custom template</p>
<p>{assign var=&#8217;freeshipping_price&#8217; value=Configuration::get(&#8216;PS_SHIPPING_FREE_PRICE&#8217;)}</p>
<p>                {if $freeshipping_price}</p>
<p>                    {assign var=&#8217;freeshipping_price_converted&#8217; value={toolsConvertPrice price=$freeshipping_price}}</p>
<p>                    {math equation=&#8217;a-b&#8217; a=$total_price b=$total_shipping assign=&#8217;total_without_shipping&#8217;}</p>
<p>                    {math equation=&#8217;a-b&#8217; a=$freeshipping_price_converted b=$total_without_shipping assign=&#8217;remaining_to_spend&#8217;}</p>
<p>                    {if $remaining_to_spend &gt; 0 &amp;&amp; $freeshipping_price_converted &gt;= 0 &amp;&amp; !$isVirtualCart}</p>
<p>                            {l s=&#8217;Remaining amount to be added to your cart in order to obtain free shipping:&#8217;}</p>
<p>                            {convertPrice price=$remaining_to_spend}</p>
<p>                    {/if}</p>
<p>                {/if}</p>
<p>                {addJsDef freeshipping_price_converted=$freeshipping_price_converted|intval}</p>
<p>================ cart-summary.js in your template =============<br />
at the end of function updateCartSummary add this BEFORE the ending bracket }:</p>
<p>// REMAINING AMOUNT TO SPEND FOR FREE SHIPPING</p>
<p>        if(json.total_products_wt &gt;= freeshipping_price_converted) {</p>
<p>            // hide spend more to get free shipping</p>
<p>            $(&#8216;#free-shipping-block&#8217;).fadeOut();</p>
<p>        } else {</p>
<p>            // show spend more to get free shipping</p>
<p>            $(&#8216;#free-shipping-block&#8217;).fadeIn();</p>
<p>        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavel Andrei</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-46081</link>
		<dc:creator><![CDATA[Pavel Andrei]]></dc:creator>
		<pubDate>Sat, 22 Aug 2015 11:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-46081</guid>
		<description><![CDATA[The right answer for Amount X to spend until free shipping in the header message (blockcart.tpl) with ajax and all good is here: https://www.prestashop.com/forums/topic/268269-show-remaining-amount-to-free-shipping-in-cart/?p=1399766


Works great under PS 1.6.
Thank you.]]></description>
		<content:encoded><![CDATA[<p>The right answer for Amount X to spend until free shipping in the header message (blockcart.tpl) with ajax and all good is here: <a href="https://www.prestashop.com/forums/topic/268269-show-remaining-amount-to-free-shipping-in-cart/?p=1399766" rel="nofollow">https://www.prestashop.com/forums/topic/268269-show-remaining-amount-to-free-shipping-in-cart/?p=1399766</a></p>
<p>Works great under PS 1.6.<br />
Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavel Andrei</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-46080</link>
		<dc:creator><![CDATA[Pavel Andrei]]></dc:creator>
		<pubDate>Sat, 22 Aug 2015 10:02:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-46080</guid>
		<description><![CDATA[Hi NemoPS,

I&#039;m working on a prestashop store now and getting problems with this &quot;Need to buy some X more to get free shipping&quot;.

For the shoping-cart.tpl module that you described it works just fine, but for the blockcart.tpl in Modules (for display a message in header) it&#039;s a pain.

I get some results with this snipet:

{if 200-$total &gt; 0}

You should by products in ammount of 
&lt;strong&gt;
{200-$total} Curency
&lt;/strong&gt; 
and you will get FREE SHIPPING!

{else}


{/if}

The script is not optimised at all and I would like to have yours working on the blockcart too but have not managed to change it acording to what you said here https://www.prestashop.com/forums/topic/348398-free-tutorial-how-to-show-%E2%80%9Cspend-x-to-get-free-shipping%E2%80%9D/:

@ghost4life
{$total}
And this as shipping amt
{$shipping_cost}



Thanks a lot and hope you can help me manage this.
Best regards.]]></description>
		<content:encoded><![CDATA[<p>Hi NemoPS,</p>
<p>I&#8217;m working on a prestashop store now and getting problems with this &#8220;Need to buy some X more to get free shipping&#8221;.</p>
<p>For the shoping-cart.tpl module that you described it works just fine, but for the blockcart.tpl in Modules (for display a message in header) it&#8217;s a pain.</p>
<p>I get some results with this snipet:</p>
<p>{if 200-$total &gt; 0}</p>
<p>You should by products in ammount of<br />
<strong><br />
{200-$total} Curency<br />
</strong><br />
and you will get FREE SHIPPING!</p>
<p>{else}</p>
<p>{/if}</p>
<p>The script is not optimised at all and I would like to have yours working on the blockcart too but have not managed to change it acording to what you said here <a href="https://www.prestashop.com/forums/topic/348398-free-tutorial-how-to-show-%E2%80%9Cspend-x-to-get-free-shipping%E2%80%9D/" rel="nofollow">https://www.prestashop.com/forums/topic/348398-free-tutorial-how-to-show-%E2%80%9Cspend-x-to-get-free-shipping%E2%80%9D/</a>:</p>
<p>@ghost4life<br />
{$total}<br />
And this as shipping amt<br />
{$shipping_cost}</p>
<p>Thanks a lot and hope you can help me manage this.<br />
Best regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergio</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-45980</link>
		<dc:creator><![CDATA[Sergio]]></dc:creator>
		<pubDate>Tue, 28 Apr 2015 07:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-45980</guid>
		<description><![CDATA[This code needs to be able to update each time increasing number of products .. and also if you remove products .. as would be done ?
Only updated reloading the page.]]></description>
		<content:encoded><![CDATA[<p>This code needs to be able to update each time increasing number of products .. and also if you remove products .. as would be done ?<br />
Only updated reloading the page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NemoPS</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-45952</link>
		<dc:creator><![CDATA[NemoPS]]></dc:creator>
		<pubDate>Wed, 25 Mar 2015 13:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-45952</guid>
		<description><![CDATA[It should be possible to translate it from the back office if you used {l s=&quot;&quot;...]]></description>
		<content:encoded><![CDATA[<p>It should be possible to translate it from the back office if you used {l s=&#8221;&#8221;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Magdalena</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-45951</link>
		<dc:creator><![CDATA[Magdalena]]></dc:creator>
		<pubDate>Wed, 25 Mar 2015 10:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-45951</guid>
		<description><![CDATA[Hi Nemo!
Tried it and works great! :) However this will be in English regardless of the language selected. How can I do if my site has 2 languages?


Thanks!]]></description>
		<content:encoded><![CDATA[<p>Hi Nemo!<br />
Tried it and works great! <img src="http://nemops.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> However this will be in English regardless of the language selected. How can I do if my site has 2 languages?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NemoPS</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-45906</link>
		<dc:creator><![CDATA[NemoPS]]></dc:creator>
		<pubDate>Mon, 09 Feb 2015 15:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-45906</guid>
		<description><![CDATA[Well unfortunately I never tried it, but can you see if it works by adding it to blockcart.tpl, in the template folder, inside the .layer_cart_product box]]></description>
		<content:encoded><![CDATA[<p>Well unfortunately I never tried it, but can you see if it works by adding it to blockcart.tpl, in the template folder, inside the .layer_cart_product box</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stan Piotrowski</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-45905</link>
		<dc:creator><![CDATA[Stan Piotrowski]]></dc:creator>
		<pubDate>Mon, 09 Feb 2015 13:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-45905</guid>
		<description><![CDATA[I can pay for thtat]]></description>
		<content:encoded><![CDATA[<p>I can pay for thtat</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mazoor</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-45825</link>
		<dc:creator><![CDATA[mazoor]]></dc:creator>
		<pubDate>Thu, 04 Dec 2014 16:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-45825</guid>
		<description><![CDATA[Try this one:


{assign var=&#039;freeshipping_price&#039; value=Configuration::get(&#039;PS_SHIPPING_FREE_PRICE&#039;)}
{if $freeshipping_price}

{assign var=&#039;freeshipping_price_converted&#039; value={toolsConvertPrice price=$freeshipping_price}}
{math equation=&#039;a-b&#039; a=$total_price b=$total_shipping assign=&#039;total_without_shipping&#039;}
{math equation=&#039;a-b&#039; a=$freeshipping_price_converted b=$total_without_shipping assign=&#039;remaining_to_spend&#039;}
{if $remaining_to_spend &gt; 0}
{l s=&#039;Get FREE shipping for this order&#039;}
{l s=&#039;Your total (without shipping) is&#039;} {convertPrice price=$total_without_shipping}

{l s=&#039;You will be eligible for free shipping if you spend another&#039;} {convertPrice price=$remaining_to_spend}
{/if}


var freeshipping_price_converted = {$freeshipping_price_converted}
$(&#039;#total_product&#039;).bind(&#039;DOMNodeInserted DOMSubtreeModified DOMNodeRemoved&#039;, function(event) {
//var curreny_str = $(&#039;#totalSpend.value&#039;).html().charAt(0);
var total_without_shipping = $(&#039;#total_product&#039;).html();
total_without_shipping = parseFloat(total_without_shipping.replace(&#039;$&#039;,&#039;&#039;)).toFixed(2);
var remaining_to_spend = (freeshipping_price_converted - total_without_shipping).toFixed(2);
if(remaining_to_spend &gt; 0) {
$(&#039;#remaingSpendContainer&#039;).show();
$(&#039;#totalSpend .value&#039;).html(total_without_shipping);
$(&#039;#remaingSpend .value&#039;).html(remaining_to_spend);
} else {
$(&#039;#remaingSpendContainer&#039;).hide();
}
});

{/if}]]></description>
		<content:encoded><![CDATA[<p>Try this one:</p>
<p>{assign var=&#8217;freeshipping_price&#8217; value=Configuration::get(&#8216;PS_SHIPPING_FREE_PRICE&#8217;)}<br />
{if $freeshipping_price}</p>
<p>{assign var=&#8217;freeshipping_price_converted&#8217; value={toolsConvertPrice price=$freeshipping_price}}<br />
{math equation=&#8217;a-b&#8217; a=$total_price b=$total_shipping assign=&#8217;total_without_shipping&#8217;}<br />
{math equation=&#8217;a-b&#8217; a=$freeshipping_price_converted b=$total_without_shipping assign=&#8217;remaining_to_spend&#8217;}<br />
{if $remaining_to_spend &gt; 0}<br />
{l s=&#8217;Get FREE shipping for this order&#8217;}<br />
{l s=&#8217;Your total (without shipping) is&#8217;} {convertPrice price=$total_without_shipping}</p>
<p>{l s=&#8217;You will be eligible for free shipping if you spend another&#8217;} {convertPrice price=$remaining_to_spend}<br />
{/if}</p>
<p>var freeshipping_price_converted = {$freeshipping_price_converted}<br />
$(&#8216;#total_product&#8217;).bind(&#8216;DOMNodeInserted DOMSubtreeModified DOMNodeRemoved&#8217;, function(event) {<br />
//var curreny_str = $(&#8216;#totalSpend.value&#8217;).html().charAt(0);<br />
var total_without_shipping = $(&#8216;#total_product&#8217;).html();<br />
total_without_shipping = parseFloat(total_without_shipping.replace(&#8216;$&#8217;,&#8221;)).toFixed(2);<br />
var remaining_to_spend = (freeshipping_price_converted &#8211; total_without_shipping).toFixed(2);<br />
if(remaining_to_spend &gt; 0) {<br />
$(&#8216;#remaingSpendContainer&#8217;).show();<br />
$(&#8216;#totalSpend .value&#8217;).html(total_without_shipping);<br />
$(&#8216;#remaingSpend .value&#8217;).html(remaining_to_spend);<br />
} else {<br />
$(&#8216;#remaingSpendContainer&#8217;).hide();<br />
}<br />
});</p>
<p>{/if}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jaxTus</title>
		<link>http://nemops.com/prestashop-show-free-shipping/comment-page-1/#comment-45775</link>
		<dc:creator><![CDATA[jaxTus]]></dc:creator>
		<pubDate>Fri, 17 Oct 2014 01:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=2107#comment-45775</guid>
		<description><![CDATA[UPDATE:
You need to change outer container div id to &#039;remaingSpendContainer&#039; as  there was a conflict with 
also added show() and hide() on the  outer container div when the free shipping value is reached.
Updated code below:


{assign var=&#039;freeshipping_price&#039; value=Configuration::get(&#039;PS_SHIPPING_FREE_PRICE&#039;)}
    {if $freeshipping_price}
        
            {assign var=&#039;freeshipping_price_converted&#039; value={toolsConvertPrice price=$freeshipping_price}}
            {math equation=&#039;a-b&#039; a=$total_price b=$total_shipping assign=&#039;total_without_shipping&#039;}
            {math equation=&#039;a-b&#039; a=$freeshipping_price_converted b=$total_without_shipping assign=&#039;remaining_to_spend&#039;}
            {if $remaining_to_spend &gt; 0}
                {l s=&#039;Get FREE shipping for this order&#039;}
                {l s=&#039;Your total (without shipping) is&#039;} {convertPrice price=$total_without_shipping}
                &lt;strong&gt;{l s=&#039;You will be eligible for free shipping if you spend another&#039;} {convertPrice price=$remaining_to_spend}&lt;/strong&gt;
            {/if}
        
        
        
            var freeshipping_price_converted = {$freeshipping_price_converted}
            $(&#039;#total_product&#039;).bind(&#039;DOMNodeInserted DOMSubtreeModified DOMNodeRemoved&#039;, function(event) {
                var curreny_str = $(&#039;#totalSpend .value&#039;).html().charAt(0);
                var total_without_shipping = $(&#039;#total_product&#039;).html();
                total_without_shipping = parseFloat(total_without_shipping.replace(&#039;$&#039;,&#039;&#039;)).toFixed(2);
                var remaining_to_spend = (freeshipping_price_converted - total_without_shipping).toFixed(2);
                if(remaining_to_spend &gt; 0) {
                    $(&#039;#remaingSpendContainer&#039;).show();
                    $(&#039;#totalSpend .value&#039;).html(curreny_str.concat(total_without_shipping));
                    $(&#039;#remaingSpend .value&#039;).html(curreny_str.concat(remaining_to_spend));
                } else {
                    $(&#039;#remaingSpendContainer&#039;).hide();
                }
            });
        
    {/if}]]></description>
		<content:encoded><![CDATA[<p>UPDATE:<br />
You need to change outer container div id to &#8216;remaingSpendContainer&#8217; as  there was a conflict with<br />
also added show() and hide() on the  outer container div when the free shipping value is reached.<br />
Updated code below:</p>
<p>{assign var=&#8217;freeshipping_price&#8217; value=Configuration::get(&#8216;PS_SHIPPING_FREE_PRICE&#8217;)}<br />
    {if $freeshipping_price}</p>
<p>            {assign var=&#8217;freeshipping_price_converted&#8217; value={toolsConvertPrice price=$freeshipping_price}}<br />
            {math equation=&#8217;a-b&#8217; a=$total_price b=$total_shipping assign=&#8217;total_without_shipping&#8217;}<br />
            {math equation=&#8217;a-b&#8217; a=$freeshipping_price_converted b=$total_without_shipping assign=&#8217;remaining_to_spend&#8217;}<br />
            {if $remaining_to_spend &gt; 0}<br />
                {l s=&#8217;Get FREE shipping for this order&#8217;}<br />
                {l s=&#8217;Your total (without shipping) is&#8217;} {convertPrice price=$total_without_shipping}<br />
                <strong>{l s=&#8217;You will be eligible for free shipping if you spend another&#8217;} {convertPrice price=$remaining_to_spend}</strong><br />
            {/if}</p>
<p>            var freeshipping_price_converted = {$freeshipping_price_converted}<br />
            $(&#8216;#total_product&#8217;).bind(&#8216;DOMNodeInserted DOMSubtreeModified DOMNodeRemoved&#8217;, function(event) {<br />
                var curreny_str = $(&#8216;#totalSpend .value&#8217;).html().charAt(0);<br />
                var total_without_shipping = $(&#8216;#total_product&#8217;).html();<br />
                total_without_shipping = parseFloat(total_without_shipping.replace(&#8216;$&#8217;,&#8221;)).toFixed(2);<br />
                var remaining_to_spend = (freeshipping_price_converted &#8211; total_without_shipping).toFixed(2);<br />
                if(remaining_to_spend &gt; 0) {<br />
                    $(&#8216;#remaingSpendContainer&#8217;).show();<br />
                    $(&#8216;#totalSpend .value&#8217;).html(curreny_str.concat(total_without_shipping));<br />
                    $(&#8216;#remaingSpend .value&#8217;).html(curreny_str.concat(remaining_to_spend));<br />
                } else {<br />
                    $(&#8216;#remaingSpendContainer&#8217;).hide();<br />
                }<br />
            });</p>
<p>    {/if}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
