${function() {
const variantData = data.variant || {"id":"257484b3-cd24-4d28-b58b-3459991a8a1c","product_id":"40bb6afb-deca-4c4a-9d4b-2e7f727ac0ed","title":"Orange-One Size","weight_unit":"kg","inventory_quantity":0,"sku":"2307016-Accessories-Orange-One Size","barcode":"","position":1,"option1":"Orange","option2":"One Size","option3":"","note":"","image":null,"wholesale_price":[{"price":13.98,"min_quantity":1}],"weight":"0","compare_at_price":"16.98","price":"13.98","retail_price":"16.98","available":true,"url":"\/products\/fashion-casual-outdoor-comfortable-sunshade-baseball-cap?variant=257484b3-cd24-4d28-b58b-3459991a8a1c","available_quantity":999999999,"options":[{"name":"Color","value":"Orange"},{"name":"Size","value":"One Size"}],"off_ratio":18,"flashsale_info":[],"sales":0};
const saveType = "percentage";
const saveText = "Save {{saved_amount}}";
const productLabelDiscountOn = true;
return `
-
${saveText.replace('\{\{saved_amount\}\}',
saveType == 'percentage'
? variantData.off_ratio + '%'
: ``
)}
`;
}()}
${function(){
const tipText = "Please select a {{ name }}".replace(/\{\{\s+name\s+\}\}/g, data);
return `${tipText}
`
}()}
${function(){
const tipText = "Please select a {{ name }}".replace(/\{\{\s+name\s+\}\}/g, data);
return `${tipText}
`
}()}
Product was out of stock.
Product is unavailable.
Sku : 2307016-Accessories-Orange-One Size
${function(){
const variantData = data.variant || {"id":"257484b3-cd24-4d28-b58b-3459991a8a1c","product_id":"40bb6afb-deca-4c4a-9d4b-2e7f727ac0ed","title":"Orange-One Size","weight_unit":"kg","inventory_quantity":0,"sku":"2307016-Accessories-Orange-One Size","barcode":"","position":1,"option1":"Orange","option2":"One Size","option3":"","note":"","image":null,"wholesale_price":[{"price":13.98,"min_quantity":1}],"weight":"0","compare_at_price":"16.98","price":"13.98","retail_price":"16.98","available":true,"url":"\/products\/fashion-casual-outdoor-comfortable-sunshade-baseball-cap?variant=257484b3-cd24-4d28-b58b-3459991a8a1c","available_quantity":999999999,"options":[{"name":"Color","value":"Orange"},{"name":"Size","value":"One Size"}],"off_ratio":18,"flashsale_info":[],"sales":0};
return `
Sku : ${variantData && variantData.sku}
Weight : ${variantData && variantData.weight}${variantData && variantData.weight_unit}
`
}()}
${function() {
const postageFreeAmount = 9.9;
const custom_text = "free shipping for orders over {amount} (buy>1 item)";
const totalPrice = +data.total_price;
const diffPrice = postageFreeAmount - totalPrice;
const percentDiff = (diffPrice > 0 ? (totalPrice / postageFreeAmount * 100) : 100) + '%';
let tipText = "Your order is free delivery";
if (diffPrice > 0) {
tipText = custom_text.replace('{amount}', `
`);
}
return `
`;
}()}
${function() {
const minDays = parseInt('7');
const maxDays = parseInt('15');
const customText = "Estimated Delivery\uff1a{min_date} - {max_date}";
const minDate = new Date(Date.now() + (minDays * 86400000));
const maxDate = new Date(Date.now() + (maxDays * 86400000));
const formatDate = (minDate.getFullYear() == maxDate.getFullYear() && minDate.getFullYear() == new Date().getFullYear())
? new Intl.DateTimeFormat('en', { month: 'short', day: '2-digit' })
: new Intl.DateTimeFormat('en', { month: 'short', day: '2-digit', year: 'numeric' });
const tipText = customText.replace(/\{min_date\}/g, '' + formatDate.format(minDate) + '')
.replace(/\{max_date\}/g, '' + formatDate.format(maxDate) + '');
return `
`;
}()}