Gingerbread Candy Socks
${function() {
const variantData = data.variant || {"id":"e334f78c-7ea5-44c7-83f5-fc888faa4762","product_id":"594a2773-533c-4880-84e1-c20f7a6488b9","title":"Green-ONE SIZE","weight_unit":"kg","inventory_quantity":999,"sku":"20110951-green-onesize","barcode":"","position":1,"option1":"Green","option2":"ONE SIZE","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/475176d40b3f61c09272aa2ef27452d1.jpg","path":"475176d40b3f61c09272aa2ef27452d1.jpg","width":750,"height":563,"alt":"","aspect_ratio":1.3321492007104796},"wholesale_price":[{"price":8.9,"min_quantity":1}],"weight":"0","compare_at_price":"11.13","price":"8.9","retail_price":"11.13","available":true,"url":"\/products\/gingerbread-candy-socks?variant=e334f78c-7ea5-44c7-83f5-fc888faa4762","available_quantity":999999999,"options":[{"name":"Color","value":"Green"},{"name":"Size","value":"ONE SIZE"}],"off_ratio":20,"flashsale_info":[],"sales":0};
const saveType = "amount";
const productLabelDiscountOn = true;
return `
-
${saveType == 'percentage'
? `-${variantData.off_ratio}%`
: `- `
}
`;
}()}
Color:
Green
${function(){
const optName = "Color";
const optionValue = data.originData.selectData ? data.originData.selectData[optName].value : data.originData.value;
const optionValueText = optionValue ? (optionValue) : '';
return `${optionValueText} `;
}()}
${function(){
const tipText = "Please select a {{ name }}".replace(/\{\{\s+name\s+\}\}/g, data);
return `${tipText}
`
}()}
Size:
ONE SIZE
${function(){
const optName = "Size";
const optionValue = data.originData.selectData ? data.originData.selectData[optName].value : data.originData.value;
const optionValueText = optionValue ? (optionValue) : '';
return `${optionValueText} `;
}()}
${function(){
const tipText = "Please select a {{ name }}".replace(/\{\{\s+name\s+\}\}/g, data);
return `${tipText}
`
}()}
Add to cart
$8.90
${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":"e334f78c-7ea5-44c7-83f5-fc888faa4762","product_id":"594a2773-533c-4880-84e1-c20f7a6488b9","title":"Green-ONE SIZE","weight_unit":"kg","inventory_quantity":999,"sku":"20110951-green-onesize","barcode":"","position":1,"option1":"Green","option2":"ONE SIZE","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/475176d40b3f61c09272aa2ef27452d1.jpg","path":"475176d40b3f61c09272aa2ef27452d1.jpg","width":750,"height":563,"alt":"","aspect_ratio":1.3321492007104796},"wholesale_price":[{"price":8.9,"min_quantity":1}],"weight":"0","compare_at_price":"11.13","price":"8.9","retail_price":"11.13","available":true,"url":"\/products\/gingerbread-candy-socks?variant=e334f78c-7ea5-44c7-83f5-fc888faa4762","available_quantity":999999999,"options":[{"name":"Color","value":"Green"},{"name":"Size","value":"ONE SIZE"}],"off_ratio":20,"flashsale_info":[],"sales":0};
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":"e334f78c-7ea5-44c7-83f5-fc888faa4762","product_id":"594a2773-533c-4880-84e1-c20f7a6488b9","title":"Green-ONE SIZE","weight_unit":"kg","inventory_quantity":999,"sku":"20110951-green-onesize","barcode":"","position":1,"option1":"Green","option2":"ONE SIZE","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/475176d40b3f61c09272aa2ef27452d1.jpg","path":"475176d40b3f61c09272aa2ef27452d1.jpg","width":750,"height":563,"alt":"","aspect_ratio":1.3321492007104796},"wholesale_price":[{"price":8.9,"min_quantity":1}],"weight":"0","compare_at_price":"11.13","price":"8.9","retail_price":"11.13","available":true,"url":"\/products\/gingerbread-candy-socks?variant=e334f78c-7ea5-44c7-83f5-fc888faa4762","available_quantity":999999999,"options":[{"name":"Color","value":"Green"},{"name":"Size","value":"ONE SIZE"}],"off_ratio":20,"flashsale_info":[],"sales":0};
return `
`
}()}
${function() {
const postageFreeAmount = 69;
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 `
`;
}()}