Winter Limited Sale
${function() {
const variantData = data.variant || {"id":"e8ef769b-3dea-492f-b8b6-d68129e7e422","product_id":"9402d8d5-be75-48ea-ba0d-ace39ea2bc23","title":"180x220cm 3.5kg","weight_unit":"kg","inventory_quantity":1000,"sku":"sku2118838358643","barcode":"","position":1,"option1":"180x220cm 3.5kg","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/f62d8fbaa877814c2f17f0d35f1e5fb0.jpeg","path":"f62d8fbaa877814c2f17f0d35f1e5fb0.jpeg","width":600,"height":600,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":10.52,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"10.52","retail_price":"0","available":true,"url":"\/products\/tiyki-super-warm-lamb-quilt-winter-blanket-5kg-double-sided-velvet-quilt-thickened-warm-autumn-spring-plush-comforter-core-suitable-for-home-color-color-11-size-200x230cm-5-0kg-200x230cm-5-0kg-color-11?variant=e8ef769b-3dea-492f-b8b6-d68129e7e422","available_quantity":1000,"options":[{"name":"Size","value":"180x220cm 3.5kg"}],"off_ratio":0,"flashsale_info":[],"sales":0};
const saveType = "percentage";
const productLabelDiscountOn = true;
return `
-
${saveType == 'percentage'
? `-${variantData.off_ratio}% `
: `- `
}
`;
}()}
${function() {
const minInventory = parseInt('3');
const maxInventory = parseInt('88');
const randomInventory = Math.round(Math.random() * (maxInventory - minInventory)) + minInventory;
const customText = "Only {stock} item(s) left in stock!".replace(/\{stock\}/g, '' + randomInventory + ' ');
const barWidth = (randomInventory / maxInventory) * 100 + '%';
return `
`;
}()}
Size:
180x220cm 3.5kg
${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
$10.52
${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":"e8ef769b-3dea-492f-b8b6-d68129e7e422","product_id":"9402d8d5-be75-48ea-ba0d-ace39ea2bc23","title":"180x220cm 3.5kg","weight_unit":"kg","inventory_quantity":1000,"sku":"sku2118838358643","barcode":"","position":1,"option1":"180x220cm 3.5kg","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/f62d8fbaa877814c2f17f0d35f1e5fb0.jpeg","path":"f62d8fbaa877814c2f17f0d35f1e5fb0.jpeg","width":600,"height":600,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":10.52,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"10.52","retail_price":"0","available":true,"url":"\/products\/tiyki-super-warm-lamb-quilt-winter-blanket-5kg-double-sided-velvet-quilt-thickened-warm-autumn-spring-plush-comforter-core-suitable-for-home-color-color-11-size-200x230cm-5-0kg-200x230cm-5-0kg-color-11?variant=e8ef769b-3dea-492f-b8b6-d68129e7e422","available_quantity":1000,"options":[{"name":"Size","value":"180x220cm 3.5kg"}],"off_ratio":0,"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":"e8ef769b-3dea-492f-b8b6-d68129e7e422","product_id":"9402d8d5-be75-48ea-ba0d-ace39ea2bc23","title":"180x220cm 3.5kg","weight_unit":"kg","inventory_quantity":1000,"sku":"sku2118838358643","barcode":"","position":1,"option1":"180x220cm 3.5kg","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/f62d8fbaa877814c2f17f0d35f1e5fb0.jpeg","path":"f62d8fbaa877814c2f17f0d35f1e5fb0.jpeg","width":600,"height":600,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":10.52,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"10.52","retail_price":"0","available":true,"url":"\/products\/tiyki-super-warm-lamb-quilt-winter-blanket-5kg-double-sided-velvet-quilt-thickened-warm-autumn-spring-plush-comforter-core-suitable-for-home-color-color-11-size-200x230cm-5-0kg-200x230cm-5-0kg-color-11?variant=e8ef769b-3dea-492f-b8b6-d68129e7e422","available_quantity":1000,"options":[{"name":"Size","value":"180x220cm 3.5kg"}],"off_ratio":0,"flashsale_info":[],"sales":0};
return `
`
}()}