โจ Fairy Tale Mystery Box ๐งโโ๏ธ๐
โจ Fairy Tale Mystery Box ๐งโโ๏ธ๐
๊ฐ ๋ฐ์ค๋ ์ต์ 59,999์ ์ด์์ ์ ํ ๊ฐ์น๋ฅผ ๋ณด์ฅํ๋ฉฐ, ์คํฐ์ปค, ์คํฐ์ปค๋ถ, ์์ ํ
์ดํ, ๋ฐ์ฝ ํ์ดํผ ๋ฑ ๋ค์ํ ์ ๋๋ง ์์ฌ๊ฐ ํฌํจ๋์ด ์์ต๋๋ค. ์ฌ๋ฌ ๋ํ ์ธ๊ณ์์ ์๊ฐ์ ๋ฐ์ ํ ๋ผ, ํฐ์ปต, ๋ณ, ํ์ฑ, ์ฅ๋ฏธ, ์์ , ๋ง๋ฒ์ ์ฒ ๋ฑ ๋ค์ํ ์์๋ฅผ ๋ด๊ณ ์์ต๋๋ค. ์ฝ 30%์ ์์ดํ
์ ๋จํ์ผ๋ก ํ๋งค๋์ง ์๋ ํ์ ์ ํ์ผ๋ก, ๊ฐ ๋ฐ์ค๋ฅผ ๋์ฑ ํน๋ณํ๊ณ ๋๋ผ์ ๊ฐ๋ํ๊ฒ ๋ง๋ค์ด ์ค๋๋ค.
๊ฐ ๋ฐ์ค๋ ์ต์ 59,999์ ์ด์์ ์ ํ ๊ฐ์น๋ฅผ ๋ณด์ฅํ๋ฉฐ, ์คํฐ์ปค, ์คํฐ์ปค๋ถ, ์์ ํ
์ดํ, ๋ฐ์ฝ ํ์ดํผ ๋ฑ ๋ค์ํ ์ ๋๋ง ์์ฌ๊ฐ ํฌํจ๋์ด ์์ต๋๋ค. ์ฌ๋ฌ ๋ํ ์ธ๊ณ์์ ์๊ฐ์ ๋ฐ์ ํ ๋ผ, ํฐ์ปต, ๋ณ, ํ์ฑ, ์ฅ๋ฏธ, ์์ , ๋ง๋ฒ์ ์ฒ ๋ฑ ๋ค์ํ ์์๋ฅผ ๋ด๊ณ ์์ต๋๋ค. ์ฝ 30%์ ์์ดํ
์ ๋จํ์ผ๋ก ํ๋งค๋์ง ์๋ ํ์ ์ ํ์ผ๋ก, ๊ฐ ๋ฐ์ค๋ฅผ ๋์ฑ ํน๋ณํ๊ณ ๋๋ผ์ ๊ฐ๋ํ๊ฒ ๋ง๋ค์ด ์ค๋๋ค.
${function(){
const isRTL = originData.isRTL;
const isMobile = originData.isMobile;
const inProductDetail = originData.inProductDetail;
if (!inProductDetail) {
return `
Flash sale cannot be displayed here. Please move it to the product detail area.
(This prompt will not be displayed on the client-side)
`;
}
const flashsaleData = originData.flashsaleData;
const image_domain = originData.image_domain;
const discount_info = flashsaleData.discount_info;
const setting = flashsaleData.product_setting;
if (!discount_info || !setting) return ``;
// ๆฌๅฐ่ทณ่ฝฌๅคๅฎ(ไธไพ่ตๅ
จๅฑ appDiscountUtils,ๆจกๆฟๆฒ็ฎฑไธๅฏ่ง)
// is_redirection ๅผๅฏๅณๅฏ่ทณ(landing ๅ
ๅบ);link ้ๆณๆถ้ๅ landing
const __canRedirect = (s) => !!(s && s.is_redirection);
const displayType = setting.display_type;
const banner = setting.banner;
const productDisplay = setting.product_display;
const bannerConfig = JSON.parse(banner.config);
const productDisplayConfig = JSON.parse(productDisplay.config);
const colorConfig = productDisplayConfig.color;
const countdownConfig = productDisplayConfig.countdown;
let titleIcon = ``;
let bgImg = ``;
const deg = `${isRTL ? -90 : 90}deg`;
const { banner_bg_start, banner_bg_end, banner_text } = colorConfig;
let bgStyle = `background: linear-gradient(${deg}, ${banner_bg_start} 0%, ${banner_bg_end} 100%);`;
let bannerColor = `color: ${banner_text};`
if (banner.type === "TYPE_CUSTOM") {
const { desktop, mobile, image_render } = bannerConfig;
const bgSize = image_render === "fill" ? "background-size: cover;background-position: center;" : "background-position: center;background-size: auto 100%;";
if (isMobile && mobile) {
bgStyle = `background: URL(${image_domain + mobile});${bgSize}`;
} else if (!isMobile && desktop) {
bgStyle = `background: URL(${image_domain + desktop});${bgSize}`;
}
} else {
if (banner.type === "TYPE_ONE") {
titleIcon = productDisplay.text ? `
` : "";
bgImg = ``
}
if (banner.type === "TYPE_TWO") {
titleIcon = productDisplay.text ? `
` : ""
}
}
const { sale_bar_background_color, progress_sale_bar_background_color_start, progress_sale_bar_background_color_end } = colorConfig;
const rate = discount_info.discount_sales_rate;
const progressBarStyle = `background: linear-gradient(${deg}, ${progress_sale_bar_background_color_start} 0%, ${progress_sale_bar_background_color_end} 100%);`;
const saleCount = productDisplay.sales_progress.format === "FORMAT_NUMBER" ? discount_info.discount_sales : `${rate}%`;
const progressBarDom = productDisplay.sales_progress.enabled && rate > 0 ? `
` : ``;
const { countdown_bg, countdown_text } = colorConfig;
const { end_opened, end_format } = countdownConfig;
const tempMap = {
"DD_SSS": "DD:HH:mm:ss:SSS",
"HH_SSS": "HH:mm:ss:SSS",
"DD_ss": "DD:HH:mm:ss",
"HH_ss": "HH:mm:ss"
}
const isShowDD = [tempMap.DD_SSS, tempMap.DD_ss].includes(end_format);
const isShowSSS = [tempMap.DD_SSS, tempMap.HH_SSS].includes(end_format);
const countdown = discount_info.ends_remaining_seconds;
const countdownDom = end_opened ? `
${function() {
if (banner.type === "TYPE_TWO") return `
`
return ``;
}()}
` : ``;
const flashSaleDesc = discount_info.limit_user_product_discount > -1 ? `
ํ๋ก๋ชจ์
ํ๋ชฉ์ 1์ธ๋น ${discount_info.limit_user_product_discount}๊ฐ๋ก ์ ํ๋ฉ๋๋ค
` : "";
return `
${bgImg}
${titleIcon}
${productDisplay.text}
${progressBarDom}
${countdownDom}
${flashSaleDesc}
`}()}
${function(){
const dd = data.dd; const hh = data.hh; const mm = data.mm; const ss = data.ss; const sss = data.SSS;
const hours = data.d * 24 + data.h;
return `
${dd}D
ยท
${hours}
${hh}
:
${mm}
:
${ss}
.
${sss}
`
}()}
class SpzCustomDiscountFlashsale extends SPZ.BaseElement {
constructor(element) {
super(element);
this.xhr_ = SPZServices.xhrFor(this.win);
this.getFlashSaleApi = "\/api\/storefront\/promotion\/flashsale\/display_setting\/product_setting";
this.timer = null;
this.variantId = "1ea5c276-97cc-469b-867a-6059f6a55379";
// ไฟ้ๆดปๅจๆฐๆฎ
this.flashsaleData = {}
}
isLayoutSupported(layout) {
return layout == SPZCore.Layout.CONTAINER;
}
buildCallback() {
this.templates_ = SPZServices.templatesForDoc();
this.viewport_ = this.getViewport();
// ๆ่ฝฝbindๅฝๆฐ ่งฃๅณthisๆๅ้ฎ้ข
this.render = this.render.bind(this);
this.resize = this.resize.bind(this);
this.switchVariant = this.switchVariant.bind(this);
}
mountCallback() {
// ่ทๅๆฐๆฎ
this.getData();
this.element.onclick = (e) => {
const cur = this.win.document.querySelector(".app_discount_flashsale_desc");
const setting = this.flashsaleData.product_setting;
const landingUrl = `/promotions/discount-default/${this.flashsaleData.discount_info.id}`;
const finalUrl = appDiscountUtils.resolveDiscountHref(setting, landingUrl);
if (finalUrl && appDiscountUtils.inProductBody(this.element) && e.target !== cur) {
this.win.open(finalUrl, '_blank', 'noopener');
}
}
// ็ปๅฎ
this.viewport_.onResize(this.resize);
// ็ๅฌๅญๆฌพๅผๅๆข๏ผ้ๆฐๆธฒๆ
this.win.document.addEventListener('dj.variantChange', this.switchVariant);
}
unmountCallback() {
// ่งฃ็ป
this.viewport_.removeResize(this.resize);
this.win.document.removeEventListener('dj.variantChange', this.switchVariant);
// ๆธ
้คๅฎๆถๅจ
if (this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
}
resize() {
if (this.timer) {
clearTimeout(this.timer)
this.timer = null;
}
this.timer = setTimeout(() => {
this.render();
}, 200)
}
switchVariant(event) {
const variant = event.detail.selected;
if (variant.product_id == 'bb564210-8125-4359-9e37-400baa0d7cd2' && variant.id != this.variantId) {
this.variantId = variant.id;
this.getData();
}
}
getData() {
const reqBody = {
product_id: "bb564210-8125-4359-9e37-400baa0d7cd2",
product_type: "default",
variant_id: this.variantId
}
this.flashsaleData = {};
this.win.fetch(this.getFlashSaleApi, {
method: "POST",
body: JSON.stringify(reqBody),
headers: {
"Content-Type": "application/json"
}
}).then(async (response) => {
if (response.ok) {
this.flashsaleData = await response.json();
this.render();
} else {
this.clearDom();
}
}).catch(err => {
this.clearDom();
});
}
clearDom() {
const children = this.element.querySelector('*:not(template)');
children && SPZCore.Dom.removeElement(children);
}
render() {
this.templates_
.findAndRenderTemplate(this.element, {
isMobile: appDiscountUtils.judgeMobile(),
isRTL: appDiscountUtils.judgeRTL(),
inProductDetail: appDiscountUtils.inProductBody(this.element),
flashsaleData: this.flashsaleData,
image_domain: this.win.SHOPLAZZA.image_domain,
})
.then((el) => {
this.clearDom();
this.element.appendChild(el);
})
}
}
SPZ.defineElement('spz-custom-discount-flashsale', SpzCustomDiscountFlashsale);
${(function () {
const automatic_discount_list = originData.automatic_discount_list;
// ๆพ็คบ็ฑปๅ
const DISPLAY_TYPE = {
DTE_FOLD: 'DTE_FOLD', // ๆๅ
DTE_TILE: 'DTE_TILE' // ๅนณ้บ
}
const DEFAULT_CONFIG = {
BG: 'rgba(235, 57, 27, 0.04)',
TEXT_COLOR: '#EB391B',
BORDER_COLOR: 'rgb(235, 57, 27)',
ADD_TO_CART_BG: 'transparent',
ADD_TO_CART_TEXT_COLOR: 'rgb(235, 57, 27)',
ADD_TO_CART_BORDER_COLOR: 'rgb(235, 57, 27)',
};
// ๆฌๅฐ่ทณ่ฝฌๅคๅฎ(ไธไพ่ตๅ
จๅฑ appDiscountUtils,ๆจกๆฟๆฒ็ฎฑไธๅฏ่ง)
const __resolveHref = (s, landing) => {
if (!s || !s.is_redirection) return '';
const link = typeof s.link === 'string' ? s.link.trim() : '';
if (link && /^https?:\/\//i.test(link)) return link;
return landing || '';
};
const isExist = automatic_discount_list?.length > 0 && automatic_discount_list.some(item => item.discount[0].product_enabled);
// ๅฆๆๆฒกๆไปปไฝ่ชๅจๆๆฃ๏ผๅ้่๏ผ้ฒๆญขgapๅ ไฝ
if (!isExist) {
return `
`;
} else {
return `
${(function () {
return automatic_discount_list.map((item) => {
// ๆจก็็ฑปๅ
const template_type = item.discount[0].template_type;
// ๆฏๅฆๆพ็คบ่ชๅจๆๆฃ
const is_show_automatic_discount = item.discount[0].product_enabled;
// ๆๆฃๅพๆ
const discount_icon = item.discount_icon;
// ็ฌฌไธไธช่ชๅจๆๆฃ
const first_automatic_discount = item.discount[0];
// ๆพ็คบๆๅ ๅฑ็คบ
const isFold = (item.discount[0].display_type || DISPLAY_TYPE.DTE_FOLD) === DISPLAY_TYPE.DTE_FOLD;
// ๆๆฌๆฐ็ป
const text_arr = item.discount[0].config.texts;
// ๆกไปถๅผๆฐ็ป
const condition_values = item?.discount[0]?.condition_values || [];
// ่ฝๅฐ้กต้พๆฅ
const first_landing_url = `/promotions/discount-default/${first_automatic_discount.discount_id}`;
// ไธๆฎตๅผ่ทณ่ฝฌๅณ็ญ: ๆ็ป่ทณ่ฝฌ URL,็ฉบๅญ็ฌฆไธฒ่กจ็คบไธ่ทณ
const finalHref = __resolveHref(first_automatic_discount, first_landing_url);
// ่ชๅจๆๆฃๆปๆฐ
const automatic_discount_total = item.discount.length;
// ๆฏๅฆๆพ็คบๆๆฃๅพๆ
const isHasDiscountIcon = discount_icon ? true : false;
// ๆฏๅฆๆพ็คบๆๆฃๅพๆ ไธๆจก็็ฑปๅไธไธบtagๅadd_to_cart
const isHasDiscountIconWithNoTag = (template_type != 'tag' && template_type != 'add_to_cart' && isHasDiscountIcon)? true : false;
// ๆๆฌ้ข่ฒ
let text_color = DEFAULT_CONFIG.TEXT_COLOR;
// ่ๆฏ้ข่ฒ
const bgFn = (curBg) => template_type === "text" ? "transparent" : curBg;
let bg_color = bgFn(DEFAULT_CONFIG.BG);
// ่พนๆก้ข่ฒ
const borderFn = (curBorder) => template_type == "tag" ? curBorder : "initial";
let border_color = borderFn(DEFAULT_CONFIG.BORDER_COLOR);
// ๆจก็้
็ฝฎ
let template_config = first_automatic_discount.template_config;
// ไธ้ฎๅ ่ดญๆ ทๅผ
let addToCartBtnBgColor = DEFAULT_CONFIG.ADD_TO_CART_BG;
let addToCartBtnTextColor = DEFAULT_CONFIG.ADD_TO_CART_TEXT_COLOR;
let addToCartBtnBorderColor = DEFAULT_CONFIG.ADD_TO_CART_BORDER_COLOR;
// ๅ
ๅบๆนๆก
try {
if(template_config.length !== 0){
template_config = JSON.parse(template_config);
text_color= isHasDiscountIconWithNoTag ? template_config.color[template_type].icon_text_color : template_config.color[template_type].text_color;
bg_color = bgFn(template_config.color[template_type].background_color);
const arrayRgba = bg_color.split(",");
arrayRgba.splice(3, 1, " 1)");
border_color = borderFn(`${arrayRgba.join(",")}`);
addToCartBtnTextColor = template_config.color[template_type].button_text_color;
addToCartBtnBorderColor = template_config.color[template_type].button_border_color;
addToCartBtnBgColor = template_config.color[template_type].button_background_color;
}
} catch (error) {
console.error('template_config_error', error);
template_config = {
color: {
[template_type]: {
icon_text_color: DEFAULT_CONFIG.TEXT_COLOR,
text_color: DEFAULT_CONFIG.TEXT_COLOR,
background_color: DEFAULT_CONFIG.BG
}
}
};
}
// ๆ ็ญพ
const isTag = template_type == 'tag';
// ๆๅญๅๆจชๅน
const isTextAndBanner = template_type == 'text' || template_type == 'banner';
// ๆฏๅฆไธ้ฎๅ ่ดญ
const isAddToCart = template_type == 'add_to_cart';
// ๆๅญๆ ทๅผ
const textStyle = `color: ${text_color}; background-color: transparent; border: none;`;
// ๆ ็ญพๆ ทๅผ
const labelStyle = `color: ${text_color};border: 1px solid ${border_color};background-color:${bg_color};padding: 4px;`;
// ๆจชๅน
ๆ ทๅผ
const bannerStyle = `color: ${text_color};border: none; background-color:${bg_color}`;
// ไธ้ฎๅ ่ดญๅไธชๅฎนๅจๆ ทๅผ๏ผๅชๅ
ๅซๅจๆๆ ทๅผ๏ผ
const addToCartSingleContainerStyle = `color: ${text_color}; background-color:${bg_color};`;
// ไธ้ฎๅ ่ดญๆ้ฎๆ ทๅผ๏ผๅชๅ
ๅซ้
็ฝฎ็ๅจๆๆ ทๅผ๏ผ
const addToCartBtnStyle = `color: ${addToCartBtnTextColor}; background-color:${addToCartBtnBgColor}; border:1px solid ${addToCartBtnBorderColor};`;
// ๅคๅฑๆ ทๅผๅจๆ ็ญพๆ ทๅผไธไธๅฑ็คบ้ข่ฒ้
็ฝฎ๏ผ้คๅผๆ ็ญพ็ฑปๅ๏ผ้ข่ฒ้ฝๅฏไปฅๅจๅคๅฑ่ฆ็
let outerStyle = '';
if (template_type == 'text') {
outerStyle = textStyle;
} else if (template_type == 'tag') {
outerStyle = "border: none;";
} else if (template_type == 'banner') {
outerStyle = bannerStyle;
}
/**
* 1. ๆ ็ญพไธๅฎๆฏๅ็ฌๆ ทๅผๅฑ็คบ็
* 2. ๆๅ ๏ผๆจชๅๅธๅฑ๏ผๆๅญๅๆจชๅน
๏ผๅๅนถๆไธ่กๆๆฌ๏ผ ๆ ็ญพ๏ผๅ็ฌๆ ทๅผๅค็
* 3. ๅนณ้บ๏ผ็บตๅๅธๅฑ๏ผๆๅญใๆจชๅน
ๅๆ ็ญพ๏ผ ๆ ็ญพ๏ผๅ็ฌๆ ทๅผๅค็๏ผไธ้ฎๅ ่ดญ้ป่ฎค้ฝๆฏๅนณ้บ
*/
let txtHtml = ``;
if (isFold) {
if(isTag) {
// ๆ ็ญพ
const spanText = text_arr.map((text) => {
return `
${text}`;
}).join('');
txtHtml = `
${spanText}
`;
} else {
// ๆๅญๅๆจชๅน
txtHtml = `
${first_automatic_discount.config.text}
`;
}
} else {
// ๆๅญๅๆจชๅน
, ไฝๆ ็ญพๆ่ชๅทฑ็ๆ ทๅผ๏ผไธไธ้ฎๅ ่ดญๆๅ็ฌๆ ทๅผ
const spanText = text_arr.map((text, index) => {
const condition_value = condition_values[index];
if(isAddToCart) {
return `
${text}
`
} else {
return `
${text}`;
}
}).join('');
// ้ฝๆฏ็บตๅๅธๅฑ๏ผๆ ็ญพๆ้ด่ท
txtHtml = `
${spanText}
`;
}
/**
* ๆพ็คบๅพๆ ็ๅคๆญ
*/
const discount_type = item.discount_type;
const isShowRebateIcon = ["DT_REBATE_CTQ_OTP", "DT_REBATE_CTQ_OTR", "DT_REBATE_CTA_OTP", "DT_REBATE_CTA_OTR", "DT_M_N_DISCOUNT"].includes(discount_type) && isTextAndBanner
const isShowBxgyIcon = ["DT_BUY_ONE_GET_ONE", "DT_BUY_X_GET_Y"].includes(discount_type)
const isShowBundleIcon = ["DT_CLASSIC_BUNDLE","DT_MIX_MATCH_BUNDLE"].includes(discount_type);
/**
* ๆธฒๆไธๆๆกๆๆฝๅฑ็ๆๆฃๅ่กจ
*/
const discount_list_html = (curItem) => {
return `
${function() {
return curItem.discount.map(childItem => {
const childLandingUrl = `/promotions/discount-default/${childItem.discount_id}`;
const childFinalHref = __resolveHref(childItem, childLandingUrl);
childItem.__finalHref = childFinalHref;
return childFinalHref
? `
`
: `
`;
}).join('');
}()}
`;
}
return `
${txtHtml}
${finalHref ? `
` : ''}
${discount_list_html(item)}
${function() {
return text_arr.map((text) => {
return `
${text}
`;
}).join('');
}()}
`;
}).join('');
})()}
`
}
})()}
const TAG = "spz-custom-product-automatic";
class SpzCustomProductAutomatic extends SPZ.BaseElement {
constructor(element) {
super(element);
this.variant_id = '1ea5c276-97cc-469b-867a-6059f6a55379';
this.isRTL = SPZ.win.document.dir === 'rtl';
this.isAddingToCart_ = false; // ๅ ่ดญไธญ็ถๆ
}
static deferredMount() {
return false;
}
buildCallback() {
this.action_ = SPZServices.actionServiceForDoc(this.element);
this.templates_ = SPZServices.templatesForDoc(this.element);
this.xhr_ = SPZServices.xhrFor(this.win);
this.setupAction_();
this.viewport_ = this.getViewport();
}
mountCallback() {
this.init();
// ็ๅฌไบไปถ
this.bindEvent_();
}
async init() {
this.handleFitTheme();
const data = await this.getDiscountList();
this.renderApiData_(data);
}
async getDiscountList() {
const productId = 'bb564210-8125-4359-9e37-400baa0d7cd2';
const variantId = this.variant_id;
const productType = 'default';
const reqBody = {
product_id: productId,
variant_id: variantId,
discount_method: "DM_AUTOMATIC",
customer: {
customer_id: window.C_SETTINGS.customer.customer_id,
email: window.C_SETTINGS.customer.customer_email
},
product_type: productType
}
const url = `/api/storefront/promotion/display_setting/text/list`;
const data = await this.xhr_.fetchJson(url, {
method: "post",
body: reqBody
}).then(res => {
return res;
}).catch(err => {
this.setContainerDisabled(false);
})
return data;
}
async renderDiscountList() {
this.setContainerDisabled(true);
const data = await this.getDiscountList();
this.setContainerDisabled(false);
// ้ๆฐๆธฒๆ ๆๅจ้ฎ้ขๅค็
this.renderApiData_(data);
}
clearDom() {
const children = this.element.querySelector('*:not(template)');
children && SPZCore.Dom.removeElement(children);
}
async renderApiData_(data) {
const parentDiv = document.querySelector('.automatic_discount_container');
const newTplDom = await this.getRenderTemplate(data);
if (parentDiv) {
parentDiv.innerHTML = '';
parentDiv.appendChild(newTplDom);
} else {
console.log('automatic_discount_container is null');
}
}
doRender_(data) {
const renderData = data || {};
return this.templates_
.findAndRenderTemplate(this.element, renderData)
.then((el) => {
this.clearDom();
this.element.appendChild(el);
});
}
async getRenderTemplate(data) {
const renderData = data || {};
return this.templates_
.findAndRenderTemplate(this.element, { ...renderData, isRTL: this.isRTL })
.then((el) => {
this.clearDom();
return el;
});
}
setContainerDisabled(isDisable) {
const automaticDiscountEl = document.querySelector('.automatic_discount_container_outer');
if(isDisable) {
automaticDiscountEl.setAttribute('disabled', '');
} else {
automaticDiscountEl.removeAttribute('disabled');
}
}
// ็ปๅฎไบไปถ
bindEvent_() {
window.addEventListener('click', (e) => {
let containerNodes = document.querySelectorAll(".automatic-container .panel");
let bool;
Array.from(containerNodes).forEach((node) => {
if(node.contains(e.target)){
bool = true;
}
})
// ๆฏๅฆpopover้ขๆฟ็นๅป่ๅด
if (bool) {
return;
}
if(e.target.classList.contains('drowdown-icon') || e.target.parentNode.classList.contains('drowdown-icon')){
return;
}
const nodes = document.querySelectorAll('.automatic-container');
Array.from(nodes).forEach((node) => {
node.classList.remove('open-dropdown');
})
// ๅ
ผๅฎนไธป้ข
this.toggleProductSticky(true);
})
// ็ๅฌๅไฝๅๅ
document.addEventListener('dj.variantChange', async(event) => {
// ้ๆฐๆธฒๆ
const variant = event.detail.selected;
if (variant.product_id == 'bb564210-8125-4359-9e37-400baa0d7cd2' && variant.id != this.variant_id) {
this.variant_id = variant.id;
this.renderDiscountList();
}
});
}
// ๅ
ผๅฎนไธป้ข
handleFitTheme() {
// top ๅฑๆงๅฝฑๅๆๅจ
let productInfoEl = null;
if (window.SHOPLAZZA.theme.merchant_theme_name === 'Wind' || window.SHOPLAZZA.theme.merchant_theme_name === 'Flash') {
productInfoEl = document.querySelector('.product-info-body .product-sticky-container');
} else if (window.SHOPLAZZA.theme.merchant_theme_name === 'Hero') {
productInfoEl = document.querySelector('.product__info-wrapper .properties-content');
}
if(productInfoEl){
productInfoEl.classList.add('force-top-auto');
}
}
// ๅ
ผๅฎน wind/flash /hero ไธป้ข (stickyๅฑๆงๅฝฑๅ popover ๅฑ็บงๅฑ็คบ, ไผ่ขซๅ
ถไปๅ
็ด ่ฆ็)
toggleProductSticky(isSticky) {
let productInfoEl = null;
if (window.SHOPLAZZA.theme.merchant_theme_name === 'Wind' || window.SHOPLAZZA.theme.merchant_theme_name === 'Flash') {
productInfoEl = document.querySelector('.product-info-body .product-sticky-container');
} else if (window.SHOPLAZZA.theme.merchant_theme_name === 'Hero') {
productInfoEl = document.querySelector('.product__info-wrapper .properties-content');
}
if(productInfoEl){
if(isSticky) {
// ่ฟๅ่ฏฅไธป้ขๅๆ็stickyๅฑๆงๅผ
productInfoEl.classList.remove('force-position-static');
return;
}
productInfoEl.classList.toggle('force-position-static');
}
}
setupAction_() {
this.registerAction('handleDropdown', (invocation) => {
const discount_id = invocation.args.discount_id;
const nodes = document.querySelectorAll('.automatic-container');
Array.from(nodes).forEach((node) => {
if(node.getAttribute('id') != `automatic-${discount_id}`) {
node.classList.remove('open-dropdown');
}
})
const $discount_item = document.querySelector(`#automatic-${discount_id}`);
$discount_item && $discount_item.classList.toggle('open-dropdown');
// ๅ
ผๅฎนไธป้ข
this.toggleProductSticky();
});
// ๅ ่ดญไบไปถ
this.registerAction('handleAddToCart', (invocation) => {
// ้ปๆญขไบไปถๅๆณก
const event = invocation.event;
if (event) {
event.stopPropagation();
event.preventDefault();
}
// ๅฆๆๆญฃๅจๅ ่ดญไธญ๏ผ็ดๆฅ่ฟๅ
if (this.isAddingToCart_) {
return;
}
const quantity = invocation.args.quantity || 1;
this.addToCart(quantity);
});
}
// ๅ ่ดญๆนๆณ
async addToCart(quantity) {
// ่ฎพ็ฝฎๅ ่ดญไธญ็ถๆ
this.isAddingToCart_ = true;
const productId = 'bb564210-8125-4359-9e37-400baa0d7cd2';
const variantId = this.variant_id;
const url = '/api/cart';
const reqBody = {
product_id: productId,
variant_id: variantId,
quantity: quantity
};
try {
const data = await this.xhr_.fetchJson(url, {
method: 'POST',
body: reqBody
});
// ่งฆๅๅ ่ดญๆๅๆ็คบ
this.triggerAddToCartToast_();
return data;
} catch (error) {
error.then(err=>{
this.showToast_(err?.message || err?.errors?.[0] || 'Unknown error');
})
} finally {
// ๆ ่ฎบๆๅๅคฑ่ดฅ๏ผ้ฝ้็ฝฎๅ ่ดญ็ถๆ
this.isAddingToCart_ = false;
}
}
showToast_(message) {
const toastEl = document.querySelector("#apps-match-drawer-add_to_cart_toast");
if (toastEl) {
SPZ.whenApiDefined(toastEl).then((apis) => {
apis.showToast(message);
});
}
}
// ่งฆๅๅ ่ดญๆๅๆ็คบ
triggerAddToCartToast_() {
// ๅฆๆไธป้ขๆ่ชๅทฑ็ๅ ่ดญๆ็คบ๏ผๅไธๆพ็คบ
const themeAddToCartToastEl = document.querySelector('#add-cart-event-proxy');
if (themeAddToCartToastEl) return;
// ๆพ็คบๅบ็จ็ๅ ่ดญๆๅๆ็คบ
this.showToast_("์ฑ๊ณต์ ์ผ๋ก ์ถ๊ฐ๋์์ต๋๋ค");
}
triggerEvent_(name, data) {
const event = SPZUtils.Event.create(this.win, `${ TAG }.${ name }`, data || {});
this.action_.trigger(this.element, name, event);
}
isLayoutSupported(layout) {
return layout == SPZCore.Layout.CONTAINER;
}
}
SPZ.defineElement(TAG, SpzCustomProductAutomatic);
class SpzCustomDiscountBundle extends SPZ.BaseElement {
constructor(element) {
super(element);
}
isLayoutSupported(layout) {
return layout == SPZCore.Layout.LOGIC;
}
mountCallback() {
// ๅไธ้กตๅฏ่ฝๆๅคไธช block ๅ่ชๆธฒๆๆฌ snippet๏ผๅฏผ่ด้ป่พๅ
็ด spz-custom-discount-toast(#appsAddCartToastFunc) ้ๅคใ
// ไป
ไฟ็ DOM ไธญ็ฌฌไธไธชๅฎไพ๏ผๅ
ถไฝ้ๅคๅฎไพ็งป้ค่ช่บซ๏ผไฟ่ฏ้ป่พๅ
็ด ๅๅ
ถ action ๅผ็จ(appsAddCartToastFunc)ๅฏไธใ
const funcs = document.querySelectorAll('#appsAddCartToastFunc');
if (funcs.length > 1 && this.element !== funcs[0]) {
this.element.remove();
return;
}
// ๅ
จๅฑๆๆฃ toast ็ๅผนๅบ็นๅๆฃๅจๅคไธชๆจกๆฟ/็ปไปถ้๏ผๅซๅฃฐๆๅผ @atcError๏ผ๏ผๆ ๆณ้ไธๅจๅผนๅบๅๅ็ฝฎ๏ผ
// ๆ
ๆ่ฝฝๆถๅน็ญๅฐๅป้ๅนถๆๅฐ body๏ผๅ ่ดญ toast ๆนไธบๅผนๅบๅๆ้ๅป้๏ผ่ง showAddToCartToast๏ผ
this.ensureSingleToastInBody_('cart_match_discount_toast_wrap');
}
unmountCallback() {}
// ๅไธ้กต้ขๅฏ่ฝๆๅคไธช block ๅ่ชๆธฒๆๆฌ toast snippet๏ผๅฆๅ่ฏฆ็ discount_automatic + ่ดญ็ฉ่ฝฆๆฝๅฑ้็ๆๆฃๆจชๅน
๏ผ๏ผ
// ๅฏผ่ด toast ๅคๅฑๅบ็ฐ้ๅค idใ้ๅค id ไธ getElementById/querySelector ๅ SPZ ๅจไฝๅผ็จ้ฝๅชๅฝไธญ็ฌฌไธไธช๏ผ
// ไธ่ขซๅ
ณ่ฟๆฝๅฑ็้ฃไปฝไผ่ขซๆฝๅฑ็ transform/overflow ่ฃๅช/้ไฝใ่ฟ้ๅจๆ่ฝฝๆถๅน็ญๅป้๏ผ
// ๅชไฟ็ไธไปฝใ็งป้คๅคไฝ็๏ผๅนถๆไฟ็็ๆๅฐ body๏ผbody ๆฏ position:fixed ๆๅฎๅ
จ็่ฝ็น๏ผ้ฟๅ
่ขซไปปไฝ็ฅๅ
่ฃๅช๏ผใๅฏๅๅค่ฐ็จใ
ensureSingleToastInBody_(id) {
const els = Array.from(document.querySelectorAll('#' + id));
if (!els.length) return;
els.slice(1).forEach((el) => el.remove());
const keep = els[0];
if (keep.parentNode !== document.body) {
document.body.appendChild(keep);
}
}
// ไธป้ข่ดญ็ฉ่ฝฆๆฝๅฑๆฏๅฆๆๅผ
isInCartDrawer_() {
return !!document.querySelector('[data-section-type="cart_drawer"] spz-sidebar[open]');
}
setupAction_() {
this.registerAction('showAddToCartToast', () => {
// ๆฝๅฑๅ
ๅ ่ดญ๏ผไธป้ขๆฌๅฐฑไธไผๆๅ ่ดญๆๆ๏ผ็ปไธๅผนๆไปถ่ชๅทฑ็ toast
// ้ๆฝๅฑ๏ผไธป้ขๆๅ ่ดญไปฃ็ๅๆฒฟ็จไธป้ขๅ ่ดญๆๆ๏ผๅฆๅๆไปถๅ
ๅบ
const proxyEl = document.getElementById('add-cart-event-proxy');
const inDrawer = this.isInCartDrawer_();
if (!inDrawer && proxyEl) {
return;
}
// ๅผนๅบๅๆ้ๅป้ๅนถๆๅฐ body๏ผๅน็ญ๏ผ๏ผ้ฟๅ
้ๅค id ๅฝไธญ้ๅฏน่ฑกๆ่ขซๆฝๅฑ่ฃๅช/้ไฝ
this.ensureSingleToastInBody_('apps_add_cart_toast_wrap');
const toastEl = document.querySelector('#apps-match-drawer-add_to_cart_toast')
SPZ.whenApiDefined(toastEl).then((apis) => {
apis.showToast("์ฑ๊ณต์ ์ผ๋ก ์ถ๊ฐ๋์์ต๋๋ค");
});
});
}
buildCallback() {
this.setupAction_();
};
}
SPZ.defineElement('spz-custom-discount-toast', SpzCustomDiscountBundle);
์ํ์ด ์ฌ๊ณ ๊ฐ ์์ ๋๋ง ํ์๋๋ฉฐ, ํ์ฌ๋ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์ฉ์ผ๋ก๋ง ์ ๊ณต๋ฉ๋๋ค.
๋์๊ฒ ์๋ ค์ฃผ์ธ์
(function(){
function $(selector){
return document.querySelector(selector);
}
const EMAIL_REG = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
// ่ทๅdomๆฐๆฎ
const doms = {
button: $('#app-arrival-reminder-button'),
previewBox: $('#app-arrival-reminder-preview-box'),
toast: $('#app-arrival-reminder-toast'),
lightbox: $('#arrival-lightbox'),
datalist: $('#app-arrival-reminder-email-list'),
imgRender: $('#app-arrival-reminder-product-image-render'),
productVariant: $('#app-arrival-reminder-product-variant'),
emailInput: $('#app-arrival-reminder-form .reminder-email-input'),
emailWarn: $('#app-arrival-reminder-form .reminder-email-warn-wrap'),
emailWarnText: $('#app-arrival-reminder-form .reminder-email-warn-text'),
submitButton: $('#app-arrival-reminder-submit-button')
};
// ้ไธญ็skuๆฐๆฎ
let selectedVariant = {"id":"1ea5c276-97cc-469b-867a-6059f6a55379","product_id":"bb564210-8125-4359-9e37-400baa0d7cd2","title":"MH-2026SZH-005","weight_unit":"kg","inventory_quantity":1026,"sku":"MH-2026SZH-005","barcode":"","position":1,"option1":"MH-2026SZH-005","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/2537c2ffd24f86a531adb4e5bd05535e.png","path":"2537c2ffd24f86a531adb4e5bd05535e.png","width":1254,"height":1254,"alt":"\u2728 Fairy Tale Mystery Box \ud83e\uddda\u200d\u2640\ufe0f\ud83c\udf19","aspect_ratio":1},"wholesale_price":[{"price":85799,"min_quantity":1}],"weight":"1","compare_at_price":"85799","price":"85799","retail_price":"85799","available":true,"url":"\/products\/\u2728-fairy-tale-mystery-box-\ud83e\uddda-\u2640-\ud83c\udf19?variant=1ea5c276-97cc-469b-867a-6059f6a55379","available_quantity":999999999,"options":[{"name":"Color","value":"MH-2026SZH-005"}],"off_ratio":"0","flashsale_info":{"variant_id":"1ea5c276-97cc-469b-867a-6059f6a55379","product_id":"","quantity":0,"discount_id":"","limit_time":0,"limit_buy":0,"user_limit_buy":0,"discount_sales":0,"discount_sales_rate":"","discount_stock":0,"ends_at":0,"starts_at":0,"allow_oversold":"","allocation_method":"","price":"85799","compare_at_price":"","discount_price":"85799","customary_saved_price":"","customary_off_ratio":"","discount_saved_price":"","discount_off_ratio":"0","use_before_price":false,"before_price":"","title":"","properties":"","color_setting_promotional_copy":"","discount_quantity":0,"is_need_split":false},"sales":4};
// ไธๆฅ
function reportData(params){
// ็ผ่พ/้ข่งไธไธๆฅ
if(false){
return;
}
window.sa.track(params.event_name, {
business_type: 'product_plugin',
function_name: 'Back_in_Stock',
plugin_name: "Back_in_Stock",
template_name: "product",
template_type: 1,
module: "apps",
module_type: "Back_in_Stock",
event_info: JSON.stringify({
action_type: 'Back_in_Stock'
}),
...params
});
}
// ๆ้ฎๆๅ
ไธๆฅ
function buttonPVReport(){
reportData({
event_name: 'function_expose',
event_type: 'expose',
event_desc: 'ๆ ่ดงๅๅๆถ่งฆๅ'
});
}
// ๅผน็ชๆๅ
ไธๆฅ
function popupPVReport(){
reportData({
event_name: 'function_expose',
event_type: 'popup_expose',
event_desc: 'ๅผน็ชๆๅ
ๆถ่งฆๅ'
});
}
// submitๆ้ฎ็นๅปไธๆฅ
function submitClickReport(){
reportData({
event_name: 'function_click',
event_type: 'popup_click',
event_desc: 'ๅกซๅ
ฅ้ฎ็ฎฑไนๅ๏ผ็นๅปnotify ่งฆๅ',
event_info: JSON.stringify({
action_type: 'email_click'
}),
});
}
// -----------------------ๅๅงๅ-----------------
init();
// ๅๅงๅๆไฝ
function init(){
// ไธบ็กฎไฟwindowๆๅ้ขๆทปๅ ็ๅผไพๅฆwindow.sa ้่ฆๅจDOMContentLoadedๅ่ฐไบไปถไธญๆง่ก้ป่พ
document.addEventListener("DOMContentLoaded", function() {
// ่ฎพ็ฝฎ้ฎไปถ่ๆณ
setDataList();
if(!true){
// ๅๅงๆ ่ดง ๆ้ฎpvไบไปถๅ็นไธๆฅ
buttonPVReport();
}
});
}
// ่ฎพ็ฝฎ้ฎไปถ่ๆณ
function setDataList(){
const customer_email = window.C_SETTINGS.customer.customer_email;
if(customer_email){
const options = document.createElement('option');
options.setAttribute('value', customer_email);
doms.datalist.appendChild(options);
}
}
// -----------------------ไบไปถๆไฝ----------------
// ็ๅฌskuๅๅไบไปถ
document.addEventListener('dj.variantChange', variantChange);
// ็ๅฌๆ้ๆ้ฎ็นๅปไบไปถ
doms.button.addEventListener('click', reminderButtonClick);
// ็ๅฌๆไบคๆ้ฎ็นๅปไบไปถ
doms.submitButton.addEventListener('click', submit);
// ็ๅฌinputๅ
็ด ็keydownไบไปถ
doms.emailInput.addEventListener('keydown', function(e) {
// ๅคๆญๆฏๅฆๆไธไบEnter้ฎ
if (e.keyCode === 13 || e.key === 'Enter') {
submit();
}
});
// ๆพ็คบๆญฃๅธธๆ้ฎ
function showReminderButton(){
doms.button.classList.remove('app-arrival-hidden');
doms.previewBox.classList.add('app-arrival-preview-hidden');
buttonPVReport();
}
// ๅฑ็คบ้ข่งๆ้ฎ
function showPreviewButton(){
doms.button.classList.remove('app-arrival-hidden');
doms.previewBox.classList.remove('app-arrival-preview-hidden');
}
// ้่ๆ้ฎ
function hiddenReminderButton(){
doms.button.classList.add('app-arrival-hidden');
doms.previewBox.classList.add('app-arrival-preview-hidden');
}
// ๆไบคๆฐๆฎ, ่ฏทๆฑๆฅๅฃ
function submit(){
// ่ทๅ้ฎ็ฎฑๆฐๆฎ
const email = doms.emailInput.value.trim();
if(!email){
doms.emailWarnText.innerText = "\uc774\uba54\uc77c \uc8fc\uc18c\ub97c \uc785\ub825\ud558\uc138\uc694";
doms.emailWarn.classList.remove('app-arrival-hidden');
return;
}
if(!EMAIL_REG.test(email)){
doms.emailWarnText.innerText = "\uc720\ud6a8\ud55c \uc774\uba54\uc77c \uc8fc\uc18c\ub97c \uc785\ub825\ud558\uc138\uc694";
doms.emailWarn.classList.remove('app-arrival-hidden');
return;
}
// ้ฎ็ฎฑๆ ก้ชๆๅ
doms.emailWarn.classList.add('app-arrival-hidden');
// ้ข่งๆถไธ่ฐๆฅๅฃ
if(false){
SPZ.whenApiDefined(doms.toast).then(apis => {
apis.showToast("\ud604\uc7ac \ubbf8\ub9ac\ubcf4\uae30 \ud398\uc774\uc9c0\uc785\ub2c8\ub2e4. \uad6c\ub3c5\uc740 \ud14c\uc2a4\ud2b8\uc6a9\uc73c\ub85c\ub9cc \uc81c\uacf5\ub429\ub2c8\ub2e4.", 3000);
});
return;
}
// ๅ ๅ
ฅloadingๆ ทๅผ
doms.submitButton.classList.add('reminder-submit-button-loading');
// ๆไบคๆฐๆฎ่ฏทๆฑๆฅๅฃ
let quantity = 1;
const quantityDom = $('#app-arrival-reminder-quantity-render ljs-quantity');
if(quantityDom){
quantity = Number(quantityDom.getAttribute('value')) || 1;
}
const params = {
customer_email: email,
product_num: quantity,
product_id: selectedVariant.product_id,
product_variant_id: selectedVariant.id
};
fetch(`${window.C_SETTINGS.routes.root}/api/front/gobbler/v1/subscribe`, {
method: 'POST',
body: JSON.stringify(params),
headers: {
'Content-Type': 'application/json'
}
}).then((res)=>res.json()).then((res)=>{
/* ๅ็ซฏ้่ฏฏๆ็คบ */
if(res.errors && res.errors.length){
SPZ.whenApiDefined(doms.toast).then(apis=>{
apis.showToast(res.errors[0], 3000);
});
return;
}
/* code
* 0 SUCCESS ่ฎข้
ๆๅ
* 1 PRODUCT_OFFLINE ๅๅไธๆถ
* 2 INVENTORY_NOT_EMPTY ๅๅๅบๅญไธไธบ็ฉบ
* 3 REPEAT_SUBSCRIBE ้ๅค่ฎข้
* 4 EMAIL_EMPTY ้ฎไปถไธบ็ฉบ
* 5 EMAIL_WRONG_FORMAT ้ฎไปถๆ ผๅผ้่ฏฏ
* 99999 INVALID_PARAMS ๅ
ถไปๅๆฐ้่ฏฏ
*/
const codeMap = {
SUCCESS: ()=>{
SPZ.whenApiDefined(doms.lightbox).then(apis=>{
apis.close();
});
SPZ.whenApiDefined(doms.toast).then(apis=>{
apis.showToast("\uad6c\ub3c5\ud574 \uc8fc\uc154\uc11c \uac10\uc0ac\ud569\ub2c8\ub2e4! \uc81c\ud488\uc774 \uc7ac\uc785\uace0\ub418\ub294 \ub300\ub85c \uc54c\ub824\ub4dc\ub9ac\uaca0\uc2b5\ub2c8\ub2e4!", 3000);
});
},
INVENTORY_NOT_EMPTY: ()=>{
SPZ.whenApiDefined(doms.lightbox).then(apis=>{
apis.close();
});
SPZ.whenApiDefined(doms.toast).then(apis=>{
apis.showToast("\uc0c1\ud488\uc740 \uc774\ubbf8 \uc7ac\uace0\uac00 \uc788\uc73c\uba70, \uad6c\ub3c5\uc5d0 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. \uc9c1\uc811 \uad6c\ub9e4\ud574 \uc8fc\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.", 3000);
});
setTimeout(()=>{
window.location.reload();
}, 3000);
},
REPEAT_SUBSCRIBE: ()=>{
SPZ.whenApiDefined(doms.toast).then(apis=>{
apis.showToast("\uc774\ubbf8 \uc774 \uc81c\ud488\uc744 \uad6c\ub3c5\ud558\uc168\uc2b5\ub2c8\ub2e4. \uc7ac\uc785\uace0\ub418\ub294 \ub300\ub85c \uc54c\ub824\ub4dc\ub9ac\uaca0\uc2b5\ub2c8\ub2e4. \ub2e4\ub978 \uc81c\ud488\ub3c4 \uc0b4\ud3b4\ubcf4\uc138\uc694.", 3000);
});
},
EMAIL_EMPTY: ()=>{
SPZ.whenApiDefined(doms.toast).then(apis=>{
apis.showToast("\uc774\uba54\uc77c \uc8fc\uc18c\ub97c \uc785\ub825\ud558\uc138\uc694", 3000);
});
},
EMAIL_WRONG_FORMAT: ()=>{
SPZ.whenApiDefined(doms.toast).then(apis=>{
apis.showToast("\uc720\ud6a8\ud55c \uc774\uba54\uc77c \uc8fc\uc18c\ub97c \uc785\ub825\ud558\uc138\uc694", 3000);
});
}
};
codeMap.PRODUCT_OFFLINE = codeMap.SUCCESS;
codeMap[res.code] && codeMap[res.code]();
}).finally(()=>{
doms.submitButton.classList.remove('reminder-submit-button-loading');
});
// submit็นๅปไธๆฅ
submitClickReport();
}
// ้ๆฐๆธฒๆdialog
function refreshRenderDialog(){
console.log('selectedVariant', selectedVariant);
const images = selectedVariant.image || {"src":"\/\/img.staticdj.com\/bd0f5175a92757de03889ef8dfeae85c.png","path":"bd0f5175a92757de03889ef8dfeae85c.png","width":1254,"height":1254,"alt":"\u2728 Fairy Tale Mystery Box \ud83e\uddda\u200d\u2640\ufe0f\ud83c\udf19","aspect_ratio":1};
const imagePosition = images.aspect_ratio > 1 ? 'left top' : 'center center';
// ้ๆฐๆธฒๆๅพ็
SPZ.whenApiDefined(doms.imgRender).then((apis)=>{
apis.render({
images,
imagePosition
});
});
// ้ฎไปถ้่ฏฏๆ็คบ็ฝฎ็ฉบ
doms.emailWarn.classList.add('app-arrival-hidden');
// ้ๆฐๆธฒๆๆฌพๅผ่ฏดๆ
if(selectedVariant.title){
doms.productVariant.innerText = selectedVariant.title.split('-').join('/');
}
// ่กจๅๆฐๆฎ็ฝฎ็ฉบ
doms.emailInput.value = '';
}
// skuๅๅ ๅไธๆฌพๅผไธไผ่งฆๅ
function variantChange(e){
const selected = e.detail.selected;
// ๅญๆฌพๅผๆฒกๅไธๆง่กๆไฝ ไพๅฆๆฐ้ๅๅ
if(selected.id === selectedVariant.id){
return;
}
selectedVariant = selected;
console.log('selectedVariant', selectedVariant);
// ๆฐ้ๅๅ
if(selected.available || selected.product_id === undefined){
// ๆๅบๅญ ็ผ่พๆถๅฑ็คบ้ข่งๆ้ฎ ๅฆๅ้่ๆ้ฎ
if(false){
showPreviewButton();
}else {
hiddenReminderButton();
}
}else{
// ๆ ๅบๅญ ๆพ็คบๆญฃๅธธๆ้ฎ
showReminderButton();
}
}
// ๆ้ๆ้ฎ็นๅป
function reminderButtonClick(){
refreshRenderDialog();
// ๅผน็ชๆๅ
ไธๆฅ
popupPVReport();
}
document.body.appendChild(doms.toast);
document.body.appendChild(doms.lightbox.parentElement);
})();
์ ํ์ด ํ์ ๋์์ต๋๋ค.
์ ํ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
๋ฒ๊ฑฐ๋ก์ ์๋ ๋ฐํ ์ ์ฑ
์ผ๋ก ์์ฌํ๊ณ ์ผํํ์ธ์. ๊ตฌ๋งคํ์ ์ํ์ ๋ง์กฑํ์ค ์ ์๋๋ก ๋ณด์ฅํฉ๋๋ค.
์ง์ ๊ฐ๋ฅํ๊ฒ ์ ์๋จ
์ง๊ตฌ๋ฅผ ์๊ฐํ๋ฉฐ ๋์์ธ๋ ๋ชจ๋ ์ ํ์ ์ง์ ๊ฐ๋ฅํ ๋ฐฉ์์ผ๋ก ์ ์๋ฉ๋๋ค.
์ต์ฒจ๋จ ์ํธํ ๊ฒฐ์ ๋ณด์์ผ๋ก ๊ทํ์ ๊ฒฐ์ ์ ๋ณด๋ ํญ์ ์์ ํ๊ฒ ๋ณดํธ๋ฉ๋๋ค.
์์๋ ฅ์ ํ๊ณ๊ฐ ์๊ณ ๋ชจ๋ ๋ํ
์ผ์ด ํ ํธ์ ์ด์ผ๊ธฐ์ฒ๋ผ ๋๊ปด์ง๋ ๋ง๋ฒ ๊ฐ์ ๋ํ ์ธ๊ณ๋ก ์ฌ๋ฌ๋ถ์ ์ด๋ํฉ๋๋ค. Fairy Tale Mystery Gift Box๋ ‘์ด์ํ ๋๋ผ์ ์จ๋ฆฌ์ค’ ๊ฐ์ ํธ๊ธฐ์ฌ ๊ฐ๋ํ ๋ชจํ๊ณผ ‘์ด๋ฆฐ ์์’์ฒ๋ผ ๊ฐ์ฑ์ ์ธ ์ฌ์ , ๊ทธ๋ฆฌ๊ณ ์์ ๊ณผ ์ฒ, ๋ณ๊ณผ ํ์์ด ๊ฐ๋ํ ๋ค์ํ ํํ์ง ์ธ๊ณ์์ ์๊ฐ์ ๋ฐ์ ์ ์ฑ์ค๋ฝ๊ฒ ๊ตฌ์ฑ๋์์ต๋๋ค. ๋งค๋ ฅ์ ์ด๊ณ ๊ฐ์ฑ์ ์ธ ์ ๋๋ง ์์ฌ๋ก, ๋ชจ๋ ์ฐฝ์์ ํ๋์ ์๋ฆ๋ค์ด ์ด์ผ๊ธฐ๋ก ์์ฑํด ์ค๋๋ค.
๐ค ๊ฐ ๋ฐ์ค๋ ์ต์ 59,999์ ์ด์์ ๊ฐ์น๋ฅผ ์ง๋๋ฉฐ, ๋ค์ํ ์คํฐ์ปค, ์คํฐ์ปค๋ถ, ์์ ํ
์ดํ, ๋ฐ์ฝ ํ์ดํผ๋ก ๊ตฌ์ฑ๋์ด ์์ต๋๋ค. ํ ๋ผ, ํฐ์ปต, ์๊ณ๋ถํฐ ๋ณ, ํ์ฑ, ์ฅ๋ฏธ, ์์ , ๋ง๋ฒ์ ์ฒ, ๋ํํ ์ผ๋ฌ์คํธ๊น์ง ๋ํ ํ
๋ง์ ๋ง์ถฐ ์ธ์ฌํ๊ฒ ๊ตฌ์ฑ๋์ด ๋ถ๋๋ฝ๊ณ ๋ชฝํ์ ์ด๋ฉฐ ๊น์ด ์๋ ์ฐฝ์ ๊ฒฝํ์ ์ ๊ณตํฉ๋๋ค. ์ฝ 30%์ ์์ฌ๋ ๋จ๋
ํ๋งค๋์ง ์๋ ํน๋ณ ์์ดํ
์ผ๋ก, ๋์ฑ ์ ๋ํฌํ๊ณ ๋๋ผ์ด ๊ตฌ์ฑ์ ์์ฑํฉ๋๋ค ๐๐นโจ
๐ ๋ค์ด์ด๋ฆฌ ๊พธ๋ฏธ๊ธฐ, ์คํฌ๋ฉ๋ถ ์ ์, ํํ์ง ๊ฐ์ฑ ์ฝ๋ผ์ฃผ ์์
, ๋๋ ํน๋ณํ ์ข
์ด ์์ฌ ์์ง์ ์ฆ๊ธฐ๋ ๋ถ๋ค๊ป ์ด ๋ฏธ์คํฐ๋ฆฌ ๋ฐ์ค๋ ๋งค๋ฒ ์๋ก์ด ์ธ๋ฐ์ฑ์ ์ฆ๊ฑฐ์์ ์ ์ฌํฉ๋๋ค. ๋ง์น ์๋ก์ด ์ด์ผ๊ธฐ๋ฅผ ํผ์น๋ ๋ฏํ ๊ฒฝํ์ ์ ๊ณตํ๋ฉฐ, ์์๋ ฅ๊ณผ ์คํ ๋ฆฌํ
๋ง์ ๋งค๋ ฅ์ ํ์ธต ๋ ๋์ด์ฌ๋ฆฝ๋๋ค.
๐ ๋์ฑ ํน๋ณํ ๊ฒฝํ์ ์ํด ๊ฐ ๋ฐ์ค๋ ๋ํ ๊ฐ์ฑ์ ํจํค์ง๋ก ํฌ์ฅ๋๋ฉฐ, ํ
๋ง์ ๋ง๋ ์์ถฉ์ฌ๋ก ์์ ํ๊ฒ ๋ณดํธ๋ฉ๋๋ค. ์ฒซ ์๊ฐ๋ถํฐ ๊ฟ๊ฐ๊ณ ๋ง๋ฒ ๊ฐ์ ์ธ๋ฐ์ฑ ๊ฒฝํ์ ์ ์ฌํ๋ฉฐ, ๋ํ์ ํํ์ง, ์ ๋๋ง์ ์ฌ๋ํ๋ ๋ถ๋ค๊ป ์๋ฒฝํ ์ ๋ฌผ์ด ๋ฉ๋๋ค.
โป ์๋ด: ๋ณธ ๋ฏธ์คํฐ๋ฆฌ ๋ฐ์ค์ ๊ตฌ์ฑ๊ณผ ํจํค์ง๋ ๊ณ ์ ๋์ด ์์ง ์์ผ๋ฉฐ, ์์ฐ ์๊ธฐ์ ๋ฐ๋ผ ๋์์ธ ๋ฐ ๊ตฌ์ฑํ์ด ๋ฌ๋ผ์ง ์ ์์ต๋๋ค. ์ค์ ์๋ นํ์ ์ํ์ ๊ธฐ์ค์ผ๋ก ํฉ๋๋ค.
๋ฌด๊ฒ :
1
kg
Sku :
MH-2026SZH-005
์ธ๋ฒคํ ๋ฆฌ :
999999999