Sort by
- ${item.text} ` }).join('') }
Sort by
${options.map((item) => {
return `
${(function() {
const products = data.products;
const discountType = data.discount_info.discount_type;
if(!products.length) return '';
return products.map(product => {
let price = product.price || 0;
let priceMin = product.price_min || 0;
let priceMax = product.price_max || 0;
let compareAtPriceMax = product.compare_at_price_max || 0;
let compareAtPrice = product.compare_at_price || 0;
let title = product.title || '';
let id = product.id || '';
let url = product.url || '';
let type = product.type || '';
let is_sold_out = false;
if (product.available == false && product.inventory_policy != 'continue') {
is_sold_out = true;
}
const soldOutLang1 = "Sold out";
const soldOutLang2 = "Sold out";
let imageWidth;
if (product.image.width) {
imageWidth = product.image.width;
} else {
imageWidth = "300px";
}
let imageHeight;
if (product.image.height) {
imageHeight= product.image.height;
} else {
imageHeight = "300px";
}
const defaultVariantTitle = product.variants[0].title.replace('-', '/') || '';
const variantDiscountInfo = product.variants[0].discount_info || {};
const minPurchaseQty = product.discount_min_purchase_qty || product.variants[0].discount_info.discount_min_purchase_qty || 0;
if (product.published) {
return `
${product.title}
`
} else {
return ``;
}
}).join('');
})()}
x ${minPurchaseQty}
${defaultVariantTitle}
${function(){
if (soldOutLang1){
return `
${soldOutLang1}
`
}else{
return `
${soldOutLang2}
`
}
}()}
${function() {
const currentProduct = data.product;
return (currentProduct.options || []).map((option, index) => {
const optionName = option.name || '';
const optionId = option.id || '';
const position = `option${index + 1}`;
return `
${function() {
const value = (data.originData && data.originData.value) || data.value;
const isHasValue = value ? true : false;
return `
`;
}).join('')
}()}
${value}
`
}()}
Sort by