Home / Prestashop Module Tutorials / Leo Feature Module / Spent X to get Free Ship prestashop 1.7

Spent X to get Free Ship prestashop 1.7

Hi,

Today i will guide you how to add text:

Spent X to get free ship in cart and popup cart ( only when you use leo feature module)

  1. Make sure you set

Back-office : Shipping > Preferences
find text :

2. Edit code in cart:

/themes/_THEME/templates/checkout/_partials/cart-summary-totals.tpl

add this code to any where you want to display:

{assign var=’freeshipping_price’ value=Configuration::get(‘PS_SHIPPING_FREE_PRICE’)}
{if $freeshipping_price}
{math equation=’a-b’ a=$cart.totals.total.amount b=$cart.subtotals.shipping.amount assign=’total_without_shipping’}
{math equation=’a-b’ a=$freeshipping_price b=$total_without_shipping assign=’remaining_to_spend’}
{if $remaining_to_spend > 0}
<div style=”text-align: center;color: #222222;background-color:#cce8e8;padding: 16px;line-height: 10px;padding-top: 23px;”>
{assign var=currency value=Context::getContext()->currency}
<p><strong>{l s=’Spent’} {Tools::displayPrice($remaining_to_spend,$currency)} {l s=’to get free ship!’} </strong></p>
</div>
{/if}
{/if}

2. find code:

/themes/YOURTHEME/modules/leofeature/views/templates/front/drop_down.tpl

add code to this file

{assign var=’freeshipping_price’ value=Configuration::get(‘PS_SHIPPING_FREE_PRICE’)}
{if $freeshipping_price}
{math equation=’a-b’ a=$cart.totals.total.amount b=$cart.subtotals.shipping.amount assign=’total_without_shipping’}
{math equation=’a-b’ a=$freeshipping_price b=$total_without_shipping assign=’remaining_to_spend’}
{if $remaining_to_spend > 0}
<div style=”text-align: center;color: #222222;background-color:#cce8e8;padding: 16px;line-height: 10px;padding-top: 23px;”>
{assign var=currency value=Context::getContext()->currency}
<p><strong>{l s=’Spent’} {Tools::displayPrice($remaining_to_spend,$currency)} {l s=’to get free ship!’} </strong></p>
</div>
{/if}
{/if}

 

here is result:

About admin@leotheme.com

Leave a Reply

Your email address will not be published. Required fields are marked *