${function() {
const variantData = data.variant || {"id":"50a44789-ef54-4ce4-a641-171561a69201","product_id":"08d645ec-58a7-41fd-bbe3-6186af3aafd5","title":"0.00(Plano)","weight_unit":"kg","inventory_quantity":745,"sku":"HW-2M-Y0","barcode":"","position":1,"option1":"0.00(Plano)","option2":"","option3":"","note":"","image":null,"wholesale_price":[{"price":49,"min_quantity":1}],"weight":"0","compare_at_price":"70","price":"49","retail_price":"70","available":true,"url":"\/products\/berry-bundle-6-months-4-pcs?variant=50a44789-ef54-4ce4-a641-171561a69201","available_quantity":745,"options":[{"name":"DIOPTER","value":"0.00(Plano)"}],"off_ratio":30,"flashsale_info":[],"sales":6};
const saveType = "amount";
const saveText = "Save {{saved_amount}}";
const productLabelDiscountOn = false;
return `
-
${saveText.replace('\{\{saved_amount\}\}',
saveType == 'percentage'
? variantData.off_ratio + '%'
: ` `
)}
`;
}()}
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
$49.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":"50a44789-ef54-4ce4-a641-171561a69201","product_id":"08d645ec-58a7-41fd-bbe3-6186af3aafd5","title":"0.00(Plano)","weight_unit":"kg","inventory_quantity":745,"sku":"HW-2M-Y0","barcode":"","position":1,"option1":"0.00(Plano)","option2":"","option3":"","note":"","image":null,"wholesale_price":[{"price":49,"min_quantity":1}],"weight":"0","compare_at_price":"70","price":"49","retail_price":"70","available":true,"url":"\/products\/berry-bundle-6-months-4-pcs?variant=50a44789-ef54-4ce4-a641-171561a69201","available_quantity":745,"options":[{"name":"DIOPTER","value":"0.00(Plano)"}],"off_ratio":30,"flashsale_info":[],"sales":6};
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":"50a44789-ef54-4ce4-a641-171561a69201","product_id":"08d645ec-58a7-41fd-bbe3-6186af3aafd5","title":"0.00(Plano)","weight_unit":"kg","inventory_quantity":745,"sku":"HW-2M-Y0","barcode":"","position":1,"option1":"0.00(Plano)","option2":"","option3":"","note":"","image":null,"wholesale_price":[{"price":49,"min_quantity":1}],"weight":"0","compare_at_price":"70","price":"49","retail_price":"70","available":true,"url":"\/products\/berry-bundle-6-months-4-pcs?variant=50a44789-ef54-4ce4-a641-171561a69201","available_quantity":745,"options":[{"name":"DIOPTER","value":"0.00(Plano)"}],"off_ratio":30,"flashsale_info":[],"sales":6};
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 `
`;
}()}