${function() {
const variantData = data.variant || {"id":"c9d405b7-464f-4eeb-9648-30d529f34e17","product_id":"e081d337-e4a4-4c4b-9539-3d7bd640a57e","title":"Black","weight_unit":"kg","inventory_quantity":972,"sku":"S009-Black","barcode":"","position":1,"option1":"Black","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/ab6fbe1f325125fb4e588a1f78c9afe2.jpeg","path":"ab6fbe1f325125fb4e588a1f78c9afe2.jpeg","width":310,"height":310,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":3.99,"min_quantity":1}],"weight":"0","compare_at_price":"6.66","price":"3.99","retail_price":"6.66","available":true,"url":"\/products\/casual-necklaces?variant=c9d405b7-464f-4eeb-9648-30d529f34e17","available_quantity":999999999,"options":[{"name":"Color","value":"Black"}],"off_ratio":40,"flashsale_info":[],"sales":92};
const saveType = "amount";
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}
`
}()}
Product was out of stock.
Product is unavailable.
${function() {
const postageFreeAmount = 79;
const custom_text = "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";
if (diffPrice > 0) {
tipText = custom_text.replace('{amount}', `
`);
}
return `
`;
}()}