Your cart is reserved for
${data.mm} m
${data.ss} s
!
${data.line_items.map(item => {
const renderDiscountApp = () => {
const isEmpty = item.discount_applications && item.discount_applications.length < 1;
const isNotExist = !item.discount_applications;
if (isEmpty || isNotExist) {
return ""
}
return `
${
(item.discount_applications || []).map(discount_item => {
const discount_item_amount = discount_item.discount_amount || discount_item.amount || '';
return `
${discount_item.title}
(- )
`
}).join('')
}
`
}
return `
${item.options.map(o => `
${o.name}: ${o.value}
`).join('')}
${(item.parsedProperties || []).map((propertie)=>{
if (propertie.isImage){
return `
${propertie.name}: View image `
}else{
return `
${propertie.name}: ${propertie.value}
`
}
}).join('')}
${renderDiscountApp()}
`;
}).join('')}
${function() {
const freeAmount = 399;
const totalPrice = (data && data.total_price) || (data && data.cart && data.cart.total_price) || 0;
const amountDiff = freeAmount - totalPrice;
const percentDiff = (amountDiff > 0 ? (totalPrice / freeAmount * 100).toFixed(2) : 100) + '%';
const spendTip = "Buy {amount} more to enjoy FREE Shipping";
let tipText = "Your order is free delivery";
if (amountDiff > 0 && spendTip) {
tipText = spendTip.replace('{amount}', ` `);
}
return `
`;
}()}
${function() {
return `
Add order note
Add order note
`;
}()}
${data.total_discount > 0 ? (
`
Save
${data.discount_applications.length > 0 && data.discount_applications.map(item => {
return `
${item.title}:
`
}).join('')}
Save
`
) : ''}
Check out
Taxes and shipping calculated at checkout