`
}()}
${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":"b8d867f7-b045-448c-9774-9037729cedd4","product_id":"7ab60414-3c71-4c9a-879a-51a972329044","title":"Cap With Random Color Headband-Black (As In The Video)-16 Inch (As In The Video)","weight_unit":"kg","inventory_quantity":1000,"sku":"A222-CA-Black","barcode":"","position":1,"option1":"Cap With Random Color Headband","option2":"Black (As In The Video)","option3":"16 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\/no-glue-curly-headband-wig?variant=b8d867f7-b045-448c-9774-9037729cedd4","available_quantity":999999999,"options":[{"name":"Style","value":"Cap With Random Color Headband"},{"name":"Color","value":"Black (As In The Video)"},{"name":"Length","value":"16 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 `