`
}()}
${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":"143cfdf6-31a0-4566-b28f-dfecac22e8be","product_id":"45c9302a-14b0-4801-aeda-d407bd9b3291","title":"Cap With Random Color Headband-Black (As In The Video)-14 Inch (As In The Video)","weight_unit":"kg","inventory_quantity":1000,"sku":"A220-CA-Black","barcode":"","position":1,"option1":"Cap With Random Color Headband","option2":"Black (As In The Video)","option3":"14 Inch (As In The Video)","note":"","image":null,"wholesale_price":[{"price":39.99,"min_quantity":1}],"weight":"0","compare_at_price":"69.99","price":"39.99","retail_price":"69.99","available":true,"url":"\/products\/natural-glamf312f3f2-d8cc-4dfe-af19-5e5e4f8653b2?variant=143cfdf6-31a0-4566-b28f-dfecac22e8be","available_quantity":999999999,"options":[{"name":"Style","value":"Cap With Random Color Headband"},{"name":"Color","value":"Black (As In The Video)"},{"name":"Length","value":"14 Inch (As In The Video)"}],"off_ratio":43,"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 {
return `
`
}
}()}
${function() {
let variantImageShowed = false;
const currentProduct = data.product;
return (currentProduct.options || []).map((option, index) => {
const optionName = option.name || '';
const position = `option${index + 1}`;
let isThumbImage = false;
if (currentProduct.need_variant_image && !variantImageShowed) {
const variantNames = ["color"] || [];
for (let i = 0, len = variantNames.length; i < len; i++) {
const name = variantNames[i].toLowerCase();
if (name === optionName.toLowerCase()) {
isThumbImage = true;
variantImageShowed = true;
}
}
}
const variantType = "button";
const thumbStyle = "image_with_text";
return `
`
}()}
${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":"143cfdf6-31a0-4566-b28f-dfecac22e8be","product_id":"45c9302a-14b0-4801-aeda-d407bd9b3291","title":"Cap With Random Color Headband-Black (As In The Video)-14 Inch (As In The Video)","weight_unit":"kg","inventory_quantity":1000,"sku":"A220-CA-Black","barcode":"","position":1,"option1":"Cap With Random Color Headband","option2":"Black (As In The Video)","option3":"14 Inch (As In The Video)","note":"","image":null,"wholesale_price":[{"price":39.99,"min_quantity":1}],"weight":"0","compare_at_price":"69.99","price":"39.99","retail_price":"69.99","available":true,"url":"\/products\/natural-glamf312f3f2-d8cc-4dfe-af19-5e5e4f8653b2?variant=143cfdf6-31a0-4566-b28f-dfecac22e8be","available_quantity":999999999,"options":[{"name":"Style","value":"Cap With Random Color Headband"},{"name":"Color","value":"Black (As In The Video)"},{"name":"Length","value":"14 Inch (As In The Video)"}],"off_ratio":43,"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 {
return `
`
}
}()}
${function() {
let variantImageShowed = false;
const currentProduct = data.product;
return (currentProduct.options || []).map((option, index) => {
const optionName = option.name || '';
const position = `option${index + 1}`;
let isThumbImage = false;
if (currentProduct.need_variant_image && !variantImageShowed) {
const variantNames = ["color"] || [];
for (let i = 0, len = variantNames.length; i < len; i++) {
const name = variantNames[i].toLowerCase();
if (name === optionName.toLowerCase()) {
isThumbImage = true;
variantImageShowed = true;
}
}
}
const variantType = "button";
const thumbStyle = "image_with_text";
return `