Jump to content

[Free Module] Spend X To Get Free Shipping


Recommended Posts

The easiest way is to change the value here: {if $remaining_to_spend > 0}  from 0 to something. This is not exactly order value, but if you know your free shipping threshold you can easily calculate what needs to be entered here.

It's in views/templates/hook/gmgetfreeshipping.tpl file

Share this post


Link to post
Share on other sites
14 minutes ago, Daresh said:

The easiest way is to change the value here: {if $remaining_to_spend > 0}  from 0 to something. This is not exactly order value, but if you know your free shipping threshold you can easily calculate what needs to be entered here.

It's in views/templates/hook/gmgetfreeshipping.tpl file

remaining_to_spend = order value + shipping fee?

 

Share this post


Link to post
Share on other sites

Hi there, i found a little problem when customer add a voucher to cart.. info from gmgetfreeshipping.tpl on cart page is working fine, {convertPrice price=$remaining_to_spend} is showing price correctly..

the problem is on.. {convertPrice price=$free_shipping} is not showing correct quantity added manually to blockcart.tpl as module author says "here"

so, my solution to blockcart.tpl are assign differents variables on blockcart.tpl with the same results module assign to gmgetfreeshipping.tpl..

at the end of the .cart-prices div:


{assign var='free_shiper' value=$cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)}
{assign var='free_shipen' value=Configuration::get('PS_SHIPPING_FREE_PRICE')}
{$free_shipping_mod = $free_shipen - $free_shiper}
<p class="free_shipping_not_enough {if $free_shipping <= 0} hidden{/if}">{l s='Spend another' mod='blockcart'} <span class="free_shipping_float">{convertPrice price=$free_shipping_mod}</span> {l s='to get free shipping for your order!' mod='blockcart'}</p>

before the .button-container div:

{assign var='free_shiper' value=$cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)}
{assign var='free_shipen' value=Configuration::get('PS_SHIPPING_FREE_PRICE')}
{$free_shipping_mod = $free_shipen - $free_shiper}
<div class="layer_cart_row">
<p class="free_shipping_not_enough {if $free_shipping <= 0} hidden{/if}">{l s='Spend another' mod='blockcart'} <span class="free_shipping_float">{convertPrice price=$free_shipping_mod}</span> {l s='to get free shipping for your order!' mod='blockcart'}</p>
</div>

 

Also you can insert those codes between other instruccions.. just try..

{if $shipping_cost_float === 0}
	<!-- Nothing here if you dont like, try adding some divs for check results.. -->
{else}
	<!-- Paste order in next line and past all this code to positions we are talking about -->
{assign var='free_shiper' value=$cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)}
{assign var='free_shipen' value=Configuration::get('PS_SHIPPING_FREE_PRICE')}
{$free_shipping_mod = $free_shipen - $free_shiper}
....
{/if}

 

Hope help someone, just let me know if i am the only one facing this issue.. thanks, regards.

 

  • Like 1

Share this post


Link to post
Share on other sites
  • 4 months later...
On 12/27/2015 at 8:57 PM, Daresh said:

This module displays the "Spend another X to get free shipping for your order" message in the cart just below the product's list, updates the value while adding / substracting product quantity.

 

(demo)

 

post-653890-0-87377300-1451246677_thumb.png

 

Works for Prestashop 1.5.x and 1.6.x.

 

I would be very greatfull to anyone using this module for sharing his translation with me so I can update it to be ready to work out of the box for many languages.

 

gmgetfreeshipping.zip

Hi Daresh, before everything, thanks for sharing. Then are you planing to make it work also for the Ps 1.7 Version?

Share this post


Link to post
Share on other sites

Hi!

I just uploaded the module to work for prestashop 1.7. Please check out the first post in this topic.

It implements a Widget interface so you can attach it to any hook that you like, or add {widget name='gmgetfreeshipping'} code anywhere in your template, for example in the modal.tpl of the ps_shoppingcart module.

Please test and let me know if it works fine for you.

[demo on my PS 1.7 installation]

Edited by Daresh (see edit history)
  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

Here the Italian translation that you have asked in the first post.

Get free shipping = Ricevi spedione gratuita

Display Spend another X to get free shipping message = Mostra spendi altri X per ricevere la spedizione gratuita

Spend another = Spendi altri

to get free shipping for your order! = per avere la spedizione gratuita!

Also a tip. This is a really usefull plugin but the place where the shipment discount is visualized is a little bit hidden.

Is it possible to show the discount shipment written inside the box in attach. Maybe should be better if the written is visualized in the add to cart popup and in the places shown in the images attach.

There will be really perfect. Don't you think?

Immagine.png

 

Immagine1.png

Edited by markoroots (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

If you have any hook there, you may try to attach this module to that hook. Or you can insert the widget in your .tpl file to make it appear there. But I don't know how your theme works, in the Classic theme it's organized a bit different than in your theme.

  • Like 1

Share this post


Link to post
Share on other sites

I just updated the modules.

Now you can also set up your own free shipping amount in case you are not using the global prestashop setting (but for example have it set up in carriers)

Share this post


Link to post
Share on other sites
  • 3 weeks later...
On 1/17/2016 at 11:30 AM, Daresh said:

Allright, so here's what I did to make that information visible in other places, you don't need a special module for it, just to modify your theme (I've tested it with blockart module version 1.6.0)

 

Edit blockcart.tpl

 

To have the information displayed in the blockart, insert the following code around line 191 (in default theme), just after the closing {/if} for $use_taxes condition, at the end of the .cart-prices div:


<p class="free_shipping_not_enough {if $free_shipping <= 0} hidden{/if}">{l s='Spend another' mod='blockcart'} <span class="free_shipping_float">{convertPrice price=$free_shipping}</span> {l s='to get free shipping for your order!' mod='blockcart'}</p>

To have the information displayed on the popup after adding the product to cart, insert the following code just before the .button-container div (around line 320 in the default theme:


<div class="layer_cart_row">
   <p class="free_shipping_not_enough {if $free_shipping <= 0} hidden{/if}">{l s='Spend another' mod='blockcart'} <span class="free_shipping_float">{convertPrice price=$free_shipping}</span> {l s='to get free shipping for your order!' mod='blockcart'}</p>
</div>

Edit ajax-cart.js

 

This is needed to have the block update while adding/removing products.

 

Add


ajaxCart.updateFreeShipping(jsonData);

just after the:


ajaxCart.refreshVouchers(jsonData);

And add the function:


updateFreeShipping : function(jsonData) {
      if (jsonData.freeShippingFloat > 0) {
         $('.free_shipping_not_enough').removeClass('hidden');
         $('.free_shipping_float').text($.trim(jsonData.freeShipping));
      } else {
         $('.free_shipping_not_enough').addClass('hidden');
         $('.ajax_cart_shipping_cost').html(freeShippingTranslation);
      }
   },

just after the:


$('.cart_block .products dt:last').addClass('last_item');
		}
	},

Please let me know if it works.

 

post-653890-0-06038400-1453026465_thumb.png

post-653890-0-46876500-1453026564_thumb.png

post-653890-0-05437200-1453026566_thumb.png

post-653890-0-77857700-1453026566_thumb.png

post-653890-0-95878200-1453026466_thumb.png

 

 

Hi,

I know this is an old post, but the module still works in 1.6.1.23. However, I cannot get the above to work. Nothing is displayed in the dropdown cart or in the pop-up after adding to cart. Using a default-bootstrap with a few styling modifications.

Share this post


Link to post
Share on other sites
  • 2 weeks later...
On 31/12/2015 at 8:46, Daresh said:

Hola,

 

debe tener el "Envío gratuito a partir de" configurado en Envío -> Preferencias y eso debería ser todo, el módulo no tiene ninguna configuración, es posible que solo necesite traducirlo a su idioma.

hola perdona que te moleste , y como lo traduzco al español por ejemplo, gracias 

Share this post


Link to post
Share on other sites
  • 4 weeks later...
  • 2 weeks later...

Hi @Daresh

I am using your module on my ps 1.7.2. And it's working fine.

But my question is, we know that the module displays a block which shows a message to the customer to add more X for free shipping. But is it possible that when the customer gets free shipping, the carrier price is automatically reduced?

Say I have a carrier whose shipping rates is Rs 100. So when the customers get free shipping the price gets deducted automatically.

Regards,

Screenshot from 2019-05-27 20-44-24.png

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 2 weeks later...
  • 3 weeks later...
  • 4 weeks later...
On 7/8/2019 at 3:33 PM, Daresh said:

You can get this module (and many more) after subscribing to our newsletter here: http://greenmousestudio.com/en/

Hi Daresh,

Thank you very much to your kindness to gave us your effort to handle this Free Shipping module.

But some bugs was found:

I found the problem in blockcart.tpl when customer adding discount voucher, the balance is show + instead of minus.

Example:

Free Shipping when $200 or above.

Added product A = $26.00

Blockcart show: Spend another $174.00 to get free shipping for your order! (This show correct)

But:

When customer add in discount voucher -$5.00

Blockcart should show: Spend another $179.00 to get free shipping for your order!

But now Blockcart show: Spend another $169.00 to get free shipping for your order!  (Which is wrong, should be -$5.00 but now become +$5.00)

 Any idea how to fix this?

Thank you and looking forward your kind reply.

 

Share this post


Link to post
Share on other sites

Hi!

I just tested it on both PS 1.6 and 1.7 and it's fine for me. After I add some discount, the amount left to free shipping gets increased, not decreased.

Share this post


Link to post
Share on other sites
13 minutes ago, Daresh said:

Hi!

I just tested it on both PS 1.6 and 1.7 and it's fine for me. After I add some discount, the amount left to free shipping gets increased, not decreased.

Thank you to your prompt respond, please kindly refer to the sample picture attached.

cart problem.JPG

Share this post


Link to post
Share on other sites
19 minutes ago, Daresh said:

Hi!

I just tested it on both PS 1.6 and 1.7 and it's fine for me. After I add some discount, the amount left to free shipping gets increased, not decreased.

Here is correct, but the cart above is different and wrong.

 

cart problem 2.JPG

Share this post


Link to post
Share on other sites
On 7/30/2019 at 10:10 PM, Daresh said:

Hi!

I just tested it on both PS 1.6 and 1.7 and it's fine for me. After I add some discount, the amount left to free shipping gets increased, not decreased.

Hi Daresh, 

Good day to you, any finding so far about the 2 picture of problem I post here after your replied?

Thank you.

Share this post


Link to post
Share on other sites
  • 4 weeks later...
  • 4 weeks later...

Hi, is it possible to separate the widget and hook? For a hook to display for example the same content as it is now, but for the widget I would prepare another one. And duplicate the view for another hook? Thank you

Share this post


Link to post
Share on other sites
Just now, Daresh said:

Это потребует пользовательской перезаписи части кода модуля.

Thank you for your prompt reply, but is there no way to implement two conclusions with different content? Thank you

Share this post


Link to post
Share on other sites
  • 2 months later...
On 12/27/2015 at 7:57 PM, Daresh said:

(the module uses widget functionality so you can attach it to any hook, or insert {widget name='gmgetfreeshipping'} code anywhere in your template)

Hello, thanks for your module.

I am trying to attach it to another hook but it seems prestashop (1.6.1.17) does not allow it. The only one that seems available being "displayShoppingCartFooter" ...

Can you please help out?

Thanks a lot

Edited by drosophyle (see edit history)

Share this post


Link to post
Share on other sites
1 minute ago, Daresh said:

Widgets work only in prestashop 1.7.

Ok thanks. But can I hook it somewhere else? 

For instance I would like that message to appear on the cart block when I click on it, like I see in your demo?

I would also like to change the police and align it to the right side instead of left.

Any advice?

Share this post


Link to post
Share on other sites
  • 2 weeks later...
On 9/1/2018 at 10:14 PM, Aumanz said:

Hi there, i found a little problem when customer add a voucher to cart.. info from gmgetfreeshipping.tpl on cart page is working fine, {convertPrice price=$remaining_to_spend} is showing price correctly..

the problem is on.. {convertPrice price=$free_shipping} is not showing correct quantity added manually to blockcart.tpl as module author says "here"

so, my solution to blockcart.tpl are assign differents variables on blockcart.tpl with the same results module assign to gmgetfreeshipping.tpl..

at the end of the .cart-prices div:



{assign var='free_shiper' value=$cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)}
{assign var='free_shipen' value=Configuration::get('PS_SHIPPING_FREE_PRICE')}
{$free_shipping_mod = $free_shipen - $free_shiper}
<p class="free_shipping_not_enough {if $free_shipping <= 0} hidden{/if}">{l s='Spend another' mod='blockcart'} <span class="free_shipping_float">{convertPrice price=$free_shipping_mod}</span> {l s='to get free shipping for your order!' mod='blockcart'}</p>

before the .button-container div:


{assign var='free_shiper' value=$cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)}
{assign var='free_shipen' value=Configuration::get('PS_SHIPPING_FREE_PRICE')}
{$free_shipping_mod = $free_shipen - $free_shiper}
<div class="layer_cart_row">
<p class="free_shipping_not_enough {if $free_shipping <= 0} hidden{/if}">{l s='Spend another' mod='blockcart'} <span class="free_shipping_float">{convertPrice price=$free_shipping_mod}</span> {l s='to get free shipping for your order!' mod='blockcart'}</p>
</div>

 

Also you can insert those codes between other instruccions.. just try..


{if $shipping_cost_float === 0}
	<!-- Nothing here if you dont like, try adding some divs for check results.. -->
{else}
	<!-- Paste order in next line and past all this code to positions we are talking about -->
{assign var='free_shiper' value=$cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)}
{assign var='free_shipen' value=Configuration::get('PS_SHIPPING_FREE_PRICE')}
{$free_shipping_mod = $free_shipen - $free_shiper}
....
{/if}

 

Hope help someone, just let me know if i am the only one facing this issue.. thanks, regards.

 

Thx ! work for me but display "-" before XX € there is a way to use the plugin variable instead of PS_SHIPPING_FREE_PRICE ? 

Edited by titon222
Solved (see edit history)

Share this post


Link to post
Share on other sites
  • 3 weeks later...
  • 3 weeks later...
On 1/17/2016 at 11:30 AM, Daresh said:

Allright, so here's what I did to make that information visible in other places, you don't need a special module for it, just to modify your theme (I've tested it with blockart module version 1.6.0)

 

Edit blockcart.tpl

 

To have the information displayed in the blockart, insert the following code around line 191 (in default theme), just after the closing {/if} for $use_taxes condition, at the end of the .cart-prices div:


<p class="free_shipping_not_enough {if $free_shipping <= 0} hidden{/if}">{l s='Spend another' mod='blockcart'} <span class="free_shipping_float">{convertPrice price=$free_shipping}</span> {l s='to get free shipping for your order!' mod='blockcart'}</p>

To have the information displayed on the popup after adding the product to cart, insert the following code just before the .button-container div (around line 320 in the default theme:


<div class="layer_cart_row">
   <p class="free_shipping_not_enough {if $free_shipping <= 0} hidden{/if}">{l s='Spend another' mod='blockcart'} <span class="free_shipping_float">{convertPrice price=$free_shipping}</span> {l s='to get free shipping for your order!' mod='blockcart'}</p>
</div>

Edit ajax-cart.js

 

This is needed to have the block update while adding/removing products.

 

Add


ajaxCart.updateFreeShipping(jsonData);

just after the:


ajaxCart.refreshVouchers(jsonData);

And add the function:


updateFreeShipping : function(jsonData) {
      if (jsonData.freeShippingFloat > 0) {
         $('.free_shipping_not_enough').removeClass('hidden');
         $('.free_shipping_float').text($.trim(jsonData.freeShipping));
      } else {
         $('.free_shipping_not_enough').addClass('hidden');
         $('.ajax_cart_shipping_cost').html(freeShippingTranslation);
      }
   },

just after the:


$('.cart_block .products dt:last').addClass('last_item');
		}
	},

Please let me know if it works.

 

post-653890-0-06038400-1453026465_thumb.png

post-653890-0-46876500-1453026564_thumb.png

post-653890-0-05437200-1453026566_thumb.png

post-653890-0-77857700-1453026566_thumb.png

post-653890-0-95878200-1453026466_thumb.png

 

 

Thank you very much, it works like a charm! You are my hero!!

Share this post


Link to post
Share on other sites
  • 4 weeks later...

Hello Daresh.

 

I use Your module Spend X To Get Free Shipping.

 

I add it as widget.

 

Question  how to disable it on default position but has it still working as widget?

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 1 month later...

THE CORRECT ITALIAN TRANSLATION ARE:

 

Get free shipping = Ottieni la spedizione gratuita

Spend another X to get free shipping = Spendi ancora X per la spedizione gratuita

Spend another = Spendi ancora

to get free shipping for your order! = per ottenere la spedizione gratuita per il tuo ordine!

  • Thanks 1

Share this post


Link to post
Share on other sites
  • 4 months later...

Hi Daresh,
I have managed to successfully install this module in my 1.7 store both in the cart and on the product page, but I cannot make it show up in the cart popup (when the mouse is over) as you have in your demo.

What would be called the hook to which the module would have to hook? And, what is the name of the hook of the popup that appears after adding an item to the cart?

Thanks for your time. Kind regards.

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 2 months later...

I've got a problem.
I'm using ps 1.7.6.8
Module is working all right but only in cart page. When i'm trying to show it in displayTop hook it's not refreshing the value while on product page. To make it change it's required to refresh the page.

Can anybody help me? Thanks.

Edited by smexy
adding informations (see edit history)

Share this post


Link to post
Share on other sites
  • 1 month later...
Posted (edited)
vor 24 Minuten schrieb Prestan0ob:

How to display this in product page please?

you will see it in the shopping cart when you are above the set price freeshipping is displayed.

fs3.JPG

Get free shipping - GreenMouseStudio.com.png

Edited by SliderFlash (see edit history)

Share this post


Link to post
Share on other sites
1 hour ago, SliderFlash said:

you will see it in the shopping cart when you are above the set price freeshipping is displayed.

fs3.JPG

Get free shipping - GreenMouseStudio.com.png

I want to show this on product page not in cart. Thank you.

Share this post


Link to post
Share on other sites
  • 1 month later...

Hi, 

What is cousing that this module on cart page work in some hooks but in another didn't? I put same hook in top of a page next to menu and above footer. This one in top didn't work :(

Share this post


Link to post
Share on other sites
  • 1 month later...

Did I find about this too late? 

It seems a great modules, but the link to download it from the first post in this topic doens't work anymore. From where can I downnload it now for 1.7 ?

 

Share this post


Link to post
Share on other sites

You are right, now I try again and I have it downloaded.

What can I say , thank you very much Daresh!

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More