${function() {
const minInventory = parseInt('10');
const maxInventory = parseInt('50');
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 `
`;
}()}
people are viewing this right now
Product was out of stock.
${function(){
const variantData = data.variant || {"id":"cd33fa99-50f1-4c75-b5a0-4685b653aa4e","product_id":"62735e89-69de-4b6b-9113-e8b41bae0c1e","title":"As shown-S","weight_unit":"kg","inventory_quantity":1000,"sku":"RB3856-As shown-S","barcode":"","position":1,"option1":"As shown","option2":"S","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/de87b3bfe2c8925bee3dc44d9a090917.jpg","path":"de87b3bfe2c8925bee3dc44d9a090917.jpg","width":1773,"height":2364,"alt":"","aspect_ratio":0.75},"wholesale_price":[{"price":35.99,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"35.99","retail_price":"0","available":true,"url":"\/products\/japanese-cranes-sea-waves-embroidered-linen-kimono-cardigandd7e710a-53d0-4777-80b4-120b18df156e-0x9y-6jxf-st6m-hzw7-tn1t-p1zf-66eu-ysrb-qk92-nmnu-jq4r-imec-a8de-ycb8-kj5l-f1qo-xl1y-xlq0-se5k-4wl3-6nlt-ihna-wzlw-9y5b-zlfr-y6vd-7byj-xxq5-4bqn-gz7m-xj4a-mzlb?variant=cd33fa99-50f1-4c75-b5a0-4685b653aa4e","available_quantity":999999999,"options":[{"name":"Color","value":"As shown"},{"name":"Size","value":"S"}],"off_ratio":"0","flashsale_info":{"variant_id":"cd33fa99-50f1-4c75-b5a0-4685b653aa4e","product_id":"","quantity":0,"discount_id":"","limit_time":0,"limit_buy":0,"user_limit_buy":0,"discount_sales":0,"discount_sales_rate":"","discount_stock":0,"ends_at":0,"starts_at":0,"allow_oversold":"","allocation_method":"","price":"35.99","compare_at_price":"","discount_price":"35.99","customary_saved_price":"","customary_off_ratio":"","discount_saved_price":"","discount_off_ratio":"0","use_before_price":false,"before_price":"","title":"","properties":"","color_setting_promotional_copy":"","discount_quantity":0,"is_need_split":false},"sales":0};
return `
Sku : ${variantData && variantData.sku}
Weight : ${variantData && variantData.weight}${variantData && variantData.weight_unit}
Barcode : ${variantData && variantData.barcode}
`
}()}
${function() {
const postageFreeAmount = 499;
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 `
`;
}()}
${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 `
`;
}()}