${function() {
const variantData = data.variant || {"id":"fd47eb3d-27ad-47d7-a539-2c8f0dffc670","product_id":"c6b09007-05c2-4a4d-b904-637add58eefe","title":"White","weight_unit":"g","inventory_quantity":1,"sku":"LE51937651BAI-1","barcode":"","position":1,"option1":"White","option2":"","option3":"","note":"","image":null,"wholesale_price":[{"price":16.99,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"16.99","retail_price":"0","available":true,"url":"\/products\/magnetic-wireless-led-motion-sensor-night-light-484s?variant=fd47eb3d-27ad-47d7-a539-2c8f0dffc670","available_quantity":999999999,"options":[{"name":"Light Color","value":"White"}],"off_ratio":"0","flashsale_info":{"variant_id":"fd47eb3d-27ad-47d7-a539-2c8f0dffc670","product_id":"","quantity":0,"discount_id":"","limit_time":0,"limit_buy":0,"user_limit_buy":0,"discount_sales":0,"discount_sales_rate":"","discount_stock":0,"ends_at":0,"starts_at":0,"allow_oversold":"","allocation_method":"","price":"16.99","compare_at_price":"","discount_price":"16.99","customary_saved_price":"","customary_off_ratio":"","discount_saved_price":"","discount_off_ratio":"0","use_before_price":false,"before_price":"","title":"","properties":"","color_setting_promotional_copy":"","discount_quantity":0,"is_need_split":false},"sales":5};
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}
`
}()}
${function() {
const postageFreeAmount = 30;
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 `
`;
}()}
Product was out of stock.
Product is unavailable.