${function() {
const variantData = data.variant || {"id":"d3698000-d517-465e-9fa1-2c2bae5a57b2","product_id":"a6de5c33-ce57-447e-b27e-30b0ed01f235","title":"Green","weight_unit":"kg","inventory_quantity":996,"sku":"","barcode":"","position":3,"option1":"Green","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/30d82b4571a9cba3f748fc8b43b5709e.jpeg","path":"30d82b4571a9cba3f748fc8b43b5709e.jpeg","width":583,"height":591,"alt":"","aspect_ratio":0.9864636209813875},"wholesale_price":[{"price":3.99,"min_quantity":1}],"weight":"0","compare_at_price":"5.64","price":"3.99","retail_price":"5.64","available":true,"url":"\/products\/vintage-earrings-1?variant=d3698000-d517-465e-9fa1-2c2bae5a57b2","available_quantity":999999999,"options":[{"name":"Color","value":"Green"}],"off_ratio":29,"flashsale_info":[],"sales":53};
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 `
`;
}()}