Top Wekeend Sellers
${(function() {
const productsInfo = data.products || data.product;
const product_display = originData?.product_display;
const show_atc = product_display ? !!product_display?.show_add_to_cart : true;
const show_discount_label = !!product_display?.show_discount_label;
const show_sales_progress = !!product_display?.sales_progress?.enabled;
const sales_progress_format = product_display?.sales_progress?.format || '';
const limit_purchase = originData.limit_purchase;
const productConfig = product_display ? JSON.parse(product_display?.config).color : '';
const sale_progress_bg = productConfig?.sale_bar_background_color || '#F2F2F2';
const sale_progress_bg_start = productConfig?.progress_sale_bar_background_color_start || '#FF9C57';
const sale_progress_bg_end = productConfig?.progress_sale_bar_background_color_end || '#FF4559';
const sale_count_text = productConfig?.sale_bar_atc_color || '#FC5161';
const discount_label_start = productConfig?.discount_sign_background_color_start || '#FF9C57';
const discount_label_end = productConfig?.discount_sign_background_color_end || '#FF4559';
const discount_label_text = productConfig?.discount_sign_color || '#FFFFFF';
//限时促销首页卡片尺寸
const discount_image_size = data.discount_image_size || '100%';
//点击加购按钮需要的参数
let discount_id = data.discount_id;
let apply_scenario = data.apply_scenario;
if(!productsInfo.length) return '';
return productsInfo.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";
const discountType = product.discount_type;
const noNeedBtn = discountType !== "DT_MIX_MATCH_BUNDLE" && discountType !== "DT_CLASSIC_BUNDLE";
const defaultVariantTitle = product.variants[0]?.title.replace('-', '/');
const flash_sale_info = product?.flash_sale_info;
const is_flashsale_sold_out = flash_sale_info?.discount_sales_rate == "100";
const show_product_sold_progress = flash_sale_info?.discount_sales_rate > 0;
const off_ratio = flash_sale_info?.off_ratio;
price = flash_sale_info?.discount_price || price;
discount_id = discount_id || product.discount_id;
apply_scenario = apply_scenario || product.apply_scenario;
let imageWidth;
if (product.image.width) {
imageWidth = product.image.width;
} else {
imageWidth = 300;
}
let imageHeight;
if (product.image.height) {
imageHeight= product.image.height;
} else {
imageHeight = 300;
}
if (discount_image_size !== 'natural') {
imageHeight = (imageWidth * parseFloat(discount_image_size)) / 100;
}
if (product.published) {
return `
`
} else {
return ``;
}
}).join('');
})()}
${function(){
let hour = data.d * 24 + data.h;
if(hour < 10){
hour = '0' + hour;
}
return `
-${off_ratio}%
${function(){
if (soldOutLang1){
return `
${soldOutLang1}
`
}else{
return `
${soldOutLang2}
`
}
}()}
${product.title}
Almost sold out
${flash_sale_info?.discount_sales}
${flash_sale_info?.discount_sales_rate}%
sold
${defaultVariantTitle}
End in
${data.dd}D
${data.hh}:
${hour}:
${data.mm}:
${data.ss}
.
${data.SSS}
Promo products limited to ${limit_user_product_discount} item per person
${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 `
`;
}).join('')
}()}
${function() {
const value = (data.originData && data.originData.value) || data.value;
const isHasValue = value ? true : false;
return `
${value}
`
}()}
FLASH SALE
View More
Sign up and save
Subscribe to get special offers, free giveaways, and once-in-a-lifetime deals.
Top Item Of The Week
${data.day_day === undefined ? '00' : data.day_day }
Days
:
${data.hour_hour === undefined ? '00' : data.hour_hour }
Hours
:
${data.mins_mins === undefined ? '00' : data.mins_mins }
Minutes
:
${data.seconds_seconds === undefined ? '00' : data.seconds_seconds }
Seconds
${function() {
var thumbSwitchName = '';
return (data.product.options || []).map((option, index) => {
const optionName = option.name || '';
const position = `option${index + 1}`;
var isThumbImage = false;
if (data.product.need_variant_image && thumbSwitchName === '') {
const variantNames = ["color"] || [];
for (let i = 0, len = variantNames.length; i < len; i++) {
const name = variantNames[i];
if (name === optionName) {
isThumbImage = true;
thumbSwitchName = name;
}
}
}
const variantType = "button";
const thumbStyle = "image_with_text";
const mouseEvent = isThumbImage ? ('single-product-variant-template-1664529798004-' + optionName + '.rerender(data=event);') : '';
return (variantType == 'dropdown' && !isThumbImage) ? `
` : `
`;
}).join('')
}()}
${function() {
let availableQuantity = data && data.available_quantity;
const lowStock = 5;
if (availableQuantity == undefined) { return ''; }
availableQuantity = Math.max(availableQuantity, 0);
return availableQuantity > lowStock ? `
${("{stock} in stock, ready to be shipped").replace(/\{*stock*\}/, availableQuantity)}
` : `
${("Only {count} left!").replace(/\{*count*\}/, availableQuantity)}
`;
}()}
${optionName.toLowerCase()}
${function() {
const product0 = Object.prototype.toString.call(data) == '[object Array]' ? data[0] : data;
return `
${product0.images.slice(0, 4).map(image => `
`).join('')}
`;
}()}
${product0.images.slice(1, 4).map((image, index) => `
`).join('')}
${product0.title}
New arrival
${function () {
if (data && data.length) {
return `
${data.map(item => {
return `
`
}).join('')}
${data.map(item => {
return `
`
}).join('')}
`
}
return '';
}()}
${ (data.index + 1) + '/' + (Math.ceil(data.total / 3))}
${ (data.index + 1) + '/' + data.total}
Free shipping
Free worldwide shipping
Customer service
Need to contact us?Just send us an e-mail
Member Discount
Our payment in formation is processed securely
Contact us
Short content about your store