${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
Le produit était en rupture de stock.
Sku : CY-!164035-C1804
Poids : 0.2kg
${function(){
const variantData = data.variant || {"id":"e834cce2-d808-42c2-a38b-e87982c113bc","product_id":"aee2e9db-d4ca-4bdb-b8dd-ec347b90ba6f","title":"COLOR\u00c9","weight_unit":"kg","inventory_quantity":0,"sku":"CY-!164035-C1804","barcode":"","position":1,"option1":"COLOR\u00c9","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/c5cebab1c871b91a18471b03fd733fd0.jpeg","path":"c5cebab1c871b91a18471b03fd733fd0.jpeg","width":1000,"height":1000,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":9.9,"min_quantity":1}],"weight":"0.2","compare_at_price":"6.43","price":"9.9","retail_price":"6.43","available":true,"url":"\/products\/laniere-de-telephone-perlant-darc-en-ciel-simple-de-bijoux-de-telephone-i7ll?variant=e834cce2-d808-42c2-a38b-e87982c113bc","available_quantity":999999999,"options":[{"name":"Couleur","value":"COLOR\u00c9"}],"off_ratio":0,"flashsale_info":[],"sales":0};
return `
Sku : ${variantData && variantData.sku}
Poids : ${variantData && variantData.weight}${variantData && variantData.weight_unit}
code à barre : ${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 = "Votre commande est la livraison gratuite";
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 `
`;
}()}