Please refresh the page or try again later.
${function() {
const { status } = data;
if (status === 'UNAUTHORIZED') {
return `
`;
}
return '';
}()}
${data.discount_code}
${function(){
switch(data.status || data) {
case 'COUPON_RECEIVE_INSUFFICIENT_POINTS_ERROR': return `
Insufficient
`;
case 'BIRTHDAY_NOT_COME': return `
Your birthday time has not yet come
`;
case 'SHOW_LOGIN_TIP':
case 'UNAUTHORIZED':
return `You have not yet joined as a member or logged into your account`;
case 'COUPON_RECEIVE_NOT_IN_TIME_ERROR':
case 'COUPON_NOT_FOUND_ERROR':
case 'CAMPAIGN_NOT_FOUND_ERROR': return `Points benefit does not exist. Please refresh the page`;
case 'COUPON_RECEIVE_NOT_ELIGIBLE_ERROR':
case 'COUPON_RECEIVE_UPPER_LIMIT_ERROR':
case 'COUPON_RECEIVE_FAILED_ERROR': return `redemption failed. Please refresh the page and try again.`;
case 'COUPON_RECEIVE_NO_STOCK_ERROR': return `The coupon has been redeemed!`;
case 'LOYALTY_SERVER_UNAUTHORIZED': return `Please log in to your account!`;
case 'LOYALTY_SERVER_CUSTOMER_NOT_FOUND_ERROR': return `User error detected. Please refresh the page and try again~`;
case 'INVALID_PHONE_NUMBER_ERROR': return `Please enter a valid phone`;
case 'BENEFIT_UNSUBSCRIBE_FAILED_ERROR': return `Network error. Please try again!`;
case 'CAMPAIGN_ALREADY_RECEIVED_ERROR': return `Received the activity`;
case 'CAMPAIGN_IS_EXPIRE_ERROR': return `Event has expired`;
case 'BENEFIT_NOT_FOUND_ERROR': return `This benefit does not exist. Please refresh the page and try again.`;
default: return `The network is abnormal or the system is busy, please refresh the page and try again~`;
}
}()}
Members only
- ${tab_1_text}
- ${tab_2_text}
Members only
Sort by
${function() {
const { campaign } = data;
return `
`;
}()}
Members only
Sort by
${function() {
const { campaign } = data;
return `
`;
}()}
${(function(){
const get_random_six_digits = () => {
return Math.random().toString().slice(-6)
};
const product_image = data.image;
const image_width = product_image.width;
const image_height = image_width;
const is_single_variant = data.variants.length == 1;
const min_price_variant_href = (data.min_price_variant && data.min_price_variant.available) ? data.min_price_variant.withinUrl : data.withinUrl;
const retail_price_max = data.retail_price_max || data.compare_at_price_max;
const image_wrap_id = 'image_wrap_' + get_random_six_digits();
const image_carousel_id = 'image_carousel_' + get_random_six_digits();
const form_id = 'form_' + get_random_six_digits();
return `
${function() {
if (!!data.deduction_amount) {
return `
${data.title}
`
})()}
Redeem points for off
`;
}
return ``;
}()}
${function(){
const optionName = option.name || '';
const optionId = option.id || '';
let isThumbImage = !!option.showThumbImage;
const thumbStyle = "image_with_text";
const variantType = null;
const isSelected = (value) => {
const selected = (data.selectedOptions || []).find(v => v.name === optionName);
return selected && selected.value.length && selected.value[0] == value;
};
const getThumbImage = (value) => {
const options = data.product.options || [];
const option = options.find(o => o.name === optionName);
if (option.thumbImages) {
const thumbImage = option.thumbImages.find(t => t.value === value);
if (thumbImage && thumbImage.image) {
return {
src: thumbImage.image.src,
alt: thumbImage.image.alt
};
}
}
return {src: '', alt: ''};
};
if (variantType=='button' || isThumbImage) {
function getRadioInput(value, idx){
if (isSelected(value)) {
return `
`
} else {
return `
`
}
}
return `
`
} else {
function getOptions(){
return option.values.map(value=>{
if (isSelected(value)) {
return ``
} else {
return ``
}
}).join('');
}
return `
`
}
}()}
${optionName}