${function() {
const variantData = data.variant || {"id":"87b7ab85-c805-4594-b55f-20cfc604385d","product_id":"3f0ddb8e-f0cf-4d37-bb7c-52ec654682c5","title":"5Pairs:All colors-3-4","weight_unit":"kg","inventory_quantity":1000,"sku":"socks211014_4373_5Pairs:All colors||3-4","barcode":"","position":1,"option1":"5Pairs:All colors","option2":"3-4","option3":"","note":"","image":null,"wholesale_price":[{"price":24.99,"min_quantity":1}],"weight":"0","compare_at_price":"29.99","price":"24.99","retail_price":"29.99","available":true,"url":"\/products\/three-dimensional-floral-cotton-socks?variant=87b7ab85-c805-4594-b55f-20cfc604385d","available_quantity":999999999,"options":[{"name":"Quantity","value":"5Pairs:All colors"},{"name":"Size","value":"3-4"}],"off_ratio":17,"flashsale_info":[],"sales":0};
const saveType = "amount";
const saveText = "Save {{saved_amount}}";
const productLabelDiscountOn = true;
return `
-
${saveText.replace('\{\{saved_amount\}\}',
saveType == 'percentage'
? variantData.off_ratio + '%'
: ` `
)}
`;
}()}
Quantity
: 5Pairs:All colors
${function(){
const optName = "Quantity";
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}
`
}()}
Size
: 3-4
${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}
`
}()}
Add to cart
$24.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":"87b7ab85-c805-4594-b55f-20cfc604385d","product_id":"3f0ddb8e-f0cf-4d37-bb7c-52ec654682c5","title":"5Pairs:All colors-3-4","weight_unit":"kg","inventory_quantity":1000,"sku":"socks211014_4373_5Pairs:All colors||3-4","barcode":"","position":1,"option1":"5Pairs:All colors","option2":"3-4","option3":"","note":"","image":null,"wholesale_price":[{"price":24.99,"min_quantity":1}],"weight":"0","compare_at_price":"29.99","price":"24.99","retail_price":"29.99","available":true,"url":"\/products\/three-dimensional-floral-cotton-socks?variant=87b7ab85-c805-4594-b55f-20cfc604385d","available_quantity":999999999,"options":[{"name":"Quantity","value":"5Pairs:All colors"},{"name":"Size","value":"3-4"}],"off_ratio":17,"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.