${function() {
const type = 'hero';
const postageFreeAmount = 49.99;
const custom_text_hero = "Buy {amount} more to enjoy FREE Shipping";
const totalPrice = +data.total_price;
const diffPrice = postageFreeAmount - totalPrice;
const percentDiff = (diffPrice > 0 ? (totalPrice / postageFreeAmount * 100) : 100) + '%';
let tipText = "Your order is free delivery";
const custom_text_wind = "Buy {amount} more to enjoy FREE Shipping";
const custom_text = type === 'hero' ? custom_text_hero : custom_text_wind;
if (diffPrice > 0) {
tipText = custom_text.replace('{amount}', `
`);
}
return `
${type === 'hero' ?
`
` :
`
${tipText}
Your order is free delivery
`
}
`;
}()}