${function() {
const variantData = data.variant || {"id":"b256ccd5-71c6-43e6-9674-d17f0af51a43","product_id":"cbe7d4a4-79b8-4daf-83df-ed7daf74fd0a","title":"Green","weight_unit":"kg","inventory_quantity":997,"sku":"EABPCB501018","barcode":"","position":2,"option1":"Green","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/64c9088e248232940d36d29bf48ef5ff.jpeg","path":"64c9088e248232940d36d29bf48ef5ff.jpeg","width":1200,"height":1600,"alt":"","aspect_ratio":0.75},"wholesale_price":[{"price":3.99,"min_quantity":1}],"weight":"0","compare_at_price":"3.98","price":"3.99","retail_price":"3.98","available":true,"url":"\/products\/earrings-3?variant=b256ccd5-71c6-43e6-9674-d17f0af51a43","available_quantity":999999999,"options":[{"name":"Color","value":"Green"}],"off_ratio":0,"flashsale_info":[],"sales":94};
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 `
`;
}()}