${function() {
const variantData = data.variant || {"id":"0fb2d2c9-29cd-4348-9152-59973cf4e48e","product_id":"38d7a9d4-caed-4876-811a-ad236bbe9b2b","title":"Daily-0.00 Plano","weight_unit":"kg","inventory_quantity":1339,"sku":"CZ004D22610D-000","barcode":"","position":1,"option1":"Daily","option2":"0.00 Plano","option3":"","note":"","image":null,"wholesale_price":[{"price":28,"min_quantity":1}],"weight":"0","compare_at_price":"28","price":"28","retail_price":"28","available":true,"url":"\/products\/sweet-brown-barbie-daily-monthly-half-yearly?variant=0fb2d2c9-29cd-4348-9152-59973cf4e48e","available_quantity":1339,"options":[{"name":"Duration","value":"Daily"},{"name":"Diopter","value":"0.00 Plano"}],"off_ratio":0,"flashsale_info":[],"sales":13};
const saveType = "amount";
const saveText = "Save {{saved_amount}}";
const productLabelDiscountOn = false;
return `
-
${saveText.replace('\{\{saved_amount\}\}',
saveType == 'percentage'
? variantData.off_ratio + '%'
: ` `
)}
`;
}()}
Duration
Daily
Monthly
Half Yearly
${function(){
const tipText = "Please select a {{ name }}".replace(/\{\{\s+name\s+\}\}/g, data);
return `${tipText}
`
}()}
Diopter
0.00 Plano
-1.00
-1.25
-1.50
-1.75
-2.00
-2.25
-2.50
-2.75
-3.00
-3.25
-3.50
-3.75
-4.00
-4.25
-4.50
-4.75
-5.00
-5.50
-6.00
-6.50
-7.00
-7.50
-8.00
${function(){
const tipText = "Please select a {{ name }}".replace(/\{\{\s+name\s+\}\}/g, data);
return `${tipText}
`
}()}
Add to cart
$28.00
${function(){
const wholesale_enabled = false;
const qty = data.quantity || 1;
const currentSelectVariant = data.variant;
const defaultVariant = (data.product && data.product.variants && data.product.variants[0]);
const productVariant = {"id":"0fb2d2c9-29cd-4348-9152-59973cf4e48e","product_id":"38d7a9d4-caed-4876-811a-ad236bbe9b2b","title":"Daily-0.00 Plano","weight_unit":"kg","inventory_quantity":1339,"sku":"CZ004D22610D-000","barcode":"","position":1,"option1":"Daily","option2":"0.00 Plano","option3":"","note":"","image":null,"wholesale_price":[{"price":28,"min_quantity":1}],"weight":"0","compare_at_price":"28","price":"28","retail_price":"28","available":true,"url":"\/products\/sweet-brown-barbie-daily-monthly-half-yearly?variant=0fb2d2c9-29cd-4348-9152-59973cf4e48e","available_quantity":1339,"options":[{"name":"Duration","value":"Daily"},{"name":"Diopter","value":"0.00 Plano"}],"off_ratio":0,"flashsale_info":[],"sales":13};
const variantData = currentSelectVariant || defaultVariant || productVariant;
const wholesale_price = variantData.wholesale_price || [];
if(wholesale_enabled && wholesale_price.length > 0) {
let wholesaleIndex = wholesale_price.findIndex(item => {
return item.min_quantity > qty;
});
if(wholesaleIndex < 0){
wholesaleIndex = wholesale_price.length - 1;
}else if(wholesaleIndex > 0){
wholesaleIndex = wholesaleIndex - 1;
}
const wholesalePrice = wholesale_price[wholesaleIndex] || '';
return `
`
}else {
const price = variantData && variantData.price;
return price != undefined ? `
` : ' ';
}
}()}
Buy now
Product was out of stock.
Product is unavailable.
${function(){
const variantData = data.variant || {"id":"0fb2d2c9-29cd-4348-9152-59973cf4e48e","product_id":"38d7a9d4-caed-4876-811a-ad236bbe9b2b","title":"Daily-0.00 Plano","weight_unit":"kg","inventory_quantity":1339,"sku":"CZ004D22610D-000","barcode":"","position":1,"option1":"Daily","option2":"0.00 Plano","option3":"","note":"","image":null,"wholesale_price":[{"price":28,"min_quantity":1}],"weight":"0","compare_at_price":"28","price":"28","retail_price":"28","available":true,"url":"\/products\/sweet-brown-barbie-daily-monthly-half-yearly?variant=0fb2d2c9-29cd-4348-9152-59973cf4e48e","available_quantity":1339,"options":[{"name":"Duration","value":"Daily"},{"name":"Diopter","value":"0.00 Plano"}],"off_ratio":0,"flashsale_info":[],"sales":13};
return `
`
}()}
${function() {
const postageFreeAmount = 59;
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 `
`;
}()}