JOYOR customized switch
${function() {
const variantData = data.variant || {"id":"61cde542-996d-4192-acea-f0ec94439ca4","product_id":"77194413-1fc6-4d57-b1af-4403cd999bba","title":"T6","weight_unit":"kg","inventory_quantity":0,"sku":"T6 \u5f00\u5173","barcode":"","position":1,"option1":"T6","option2":"","option3":"","note":"","image":null,"wholesale_price":[{"price":20.98,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"20.98","retail_price":"0","available":true,"url":"\/products\/joyor-switch?variant=61cde542-996d-4192-acea-f0ec94439ca4","available_quantity":999999999,"options":[{"name":"instrument +switch","value":"T6"}],"off_ratio":0,"flashsale_info":[],"sales":2};
const saveType = "percentage";
const productLabelDiscountOn = true;
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