Electric Bike Horn
${function() {
const variantData = data.variant || {"id":"7bbab985-bbbf-4472-9269-ad48fc15be2a","product_id":"c98dcffe-4acb-46f2-be39-0729f09fb3db","title":"black","weight_unit":"kg","inventory_quantity":0,"sku":"\u7535\u5587\u53ed-black","barcode":"","position":1,"option1":"black","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/46d4f7398d5d7da68533877add257406.jpg","path":"46d4f7398d5d7da68533877add257406.jpg","width":720,"height":720,"alt":"Electric Bike Horn","aspect_ratio":1},"wholesale_price":[{"price":44,"min_quantity":1}],"weight":"0","compare_at_price":"88","price":"44","retail_price":"88","available":true,"url":"\/products\/electric-bike-horn?variant=7bbab985-bbbf-4472-9269-ad48fc15be2a","available_quantity":999999999,"options":[{"name":"color","value":"black"}],"off_ratio":50,"flashsale_info":[],"sales":0};
const saveType = "amount";
const productLabelDiscountOn = false;
const map = {
B: ``,
C: ``,
A: `
${saveType == 'percentage'
? `-${variantData.off_ratio}%`
: `-`
}
`
}
const price_group_arr = ["B","C","A"];
const price_str_arr = price_group_arr.map(type => map[type]);
return `
-
${price_str_arr.join('')}
`;
}()}
${function(){
const tipText = "Please select a {{ name }}".replace(/\{\{\s+name\s+\}\}/g, data);
return `${tipText}
`
}()}
Product was out of stock.
Product does not exist
${function() {
const minDays = parseInt('3');
const maxDays = parseInt('7');
const customText = "Estimated Delivery\uff1a{min_date} - {max_date}";
const minDate = new Date(Date.now() + (minDays * 86400000));
const maxDate = new Date(Date.now() + (maxDays * 86400000));
const formatDate = (minDate.getFullYear() == maxDate.getFullYear() && minDate.getFullYear() == new Date().getFullYear())
? new Intl.DateTimeFormat('en', { month: 'short', day: '2-digit' })
: new Intl.DateTimeFormat('en', { month: 'short', day: '2-digit', year: 'numeric' });
const tipText = customText.replace(/\{min_date\}/g, '' + formatDate.format(minDate) + '')
.replace(/\{max_date\}/g, '' + formatDate.format(maxDate) + '');
return `
${tipText}
`;
}()}