Hawaiian Shirt Lucky Box🎁🎁
${function() {
const variantData = data.variant || {"id":"f875226d-2d72-4c0a-a73b-1167ac99923a","product_id":"a3c2472a-7252-41bd-b416-7da8da308f2c","title":"S-Contains 1 hot sale shirt","weight_unit":"g","inventory_quantity":1000,"sku":"shopify-shirt-S","barcode":"","position":1,"option1":"S","option2":"Contains 1 hot sale shirt","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/72f3c795039018f62b4539c879d7bbdc.jpeg","path":"72f3c795039018f62b4539c879d7bbdc.jpeg","width":600,"height":800,"alt":"","aspect_ratio":0.75},"wholesale_price":[{"price":19.99,"min_quantity":1}],"weight":"0","compare_at_price":"39.98","price":"19.99","retail_price":"39.98","available":true,"url":"\/products\/2-random-hawaiian-shirts\ud83c\udf81\ud83c\udf81?variant=f875226d-2d72-4c0a-a73b-1167ac99923a","available_quantity":999999999,"options":[{"name":"Size","value":"S"},{"name":"Lucky Box","value":"Contains 1 hot sale shirt"}],"off_ratio":50,"flashsale_info":[],"sales":0};
const saveType = "percentage";
const productLabelDiscountOn = true;
return `
-
${saveType == 'percentage'
? `-${variantData.off_ratio}%`
: `- `
}
`;
}()}
${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 `
`;
}()}
Size:
S
${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}
`
}()}
Lucky Box:
Contains 1 hot sale shirt
${function(){
const optName = "Lucky Box";
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
$19.99
${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":"f875226d-2d72-4c0a-a73b-1167ac99923a","product_id":"a3c2472a-7252-41bd-b416-7da8da308f2c","title":"S-Contains 1 hot sale shirt","weight_unit":"g","inventory_quantity":1000,"sku":"shopify-shirt-S","barcode":"","position":1,"option1":"S","option2":"Contains 1 hot sale shirt","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/72f3c795039018f62b4539c879d7bbdc.jpeg","path":"72f3c795039018f62b4539c879d7bbdc.jpeg","width":600,"height":800,"alt":"","aspect_ratio":0.75},"wholesale_price":[{"price":19.99,"min_quantity":1}],"weight":"0","compare_at_price":"39.98","price":"19.99","retail_price":"39.98","available":true,"url":"\/products\/2-random-hawaiian-shirts\ud83c\udf81\ud83c\udf81?variant=f875226d-2d72-4c0a-a73b-1167ac99923a","available_quantity":999999999,"options":[{"name":"Size","value":"S"},{"name":"Lucky Box","value":"Contains 1 hot sale shirt"}],"off_ratio":50,"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.