Jump to content
Daresh

[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

i found a solution

{if ($remaining_to_spend< 200) && ($remaining_to_spend > 0)}

 

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.

 

Share this post


Link to post
Share on other sites
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

Thanks for a reminder, I'll give it a look in a couple of days.

  • Thanks 1

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

Hi Daresh you are a great!!!

Many thanks for sharing your module and for the updates you release. I will try to install it today and I let you know.

Thanks again

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

Hi Daresh, yes perfect I let me help from my webmaster and now we have added in the right hooks.

Great, really useful plugin. Many many thanks for sharing it.

 

Edited by markoroots (see edit history)
  • 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
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
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

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

It's possible in carrier settings.

Share this post


Link to post
Share on other sites

I can not download the module, the link is not working :(
Is there any other place to download the module?

Thanks, Marlies

Share this post


Link to post
Share on other sites
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

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
4 minutes ago, Daresh said:

Все возможно, но не все в бесплатном модуле.

I understand, thank you for the quick answers.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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