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)
- 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: