Home / Prestashop Module Tutorials / Leo Feature Module / Leo Feature Module: Spend X to get Free Shipping – Prestashop 1.7 Tutorial
Spend X to get free shipping - Leo feature module tutorial
Spend X to get free shipping - Leo feature module tutorial

Leo Feature Module: Spend X to get Free Shipping – Prestashop 1.7 Tutorial

Hi,

Today I will guide you on how to add text:

Spend X to get free shipping in the 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 Leo Theme

Check Also

Leotheme Black Friday 2022

Prestashop Theme and Module Black Friday and Cyber Monday Sales Leotheme 2022 30% Off

Prestashop Leotheme Black Friday 2022 Promotion! Dear valued customers, Black Friday and Cyber Monday Sales …

Leave a Reply