${function() {
const variantData = data.variant || {"id":"0bb29012-4cfd-4b5d-b287-2f63e1bcd047","product_id":"e081d337-e4a4-4c4b-9539-3d7bd640a57e","title":"Silver","weight_unit":"kg","inventory_quantity":993,"sku":"S009-Silver","barcode":"","position":3,"option1":"Silver","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/77890501bd8e63c2901975509c61d730.jpeg","path":"77890501bd8e63c2901975509c61d730.jpeg","width":400,"height":400,"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=0bb29012-4cfd-4b5d-b287-2f63e1bcd047","available_quantity":999999999,"options":[{"name":"Color","value":"Silver"}],"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 `
`;
}()}