Geumxl--hoco dresses Summer Women Bohemia Print Sashes Mini V Neck Dress Female Vintage Casual Chic Slim Long Sleeve Single-Breasted Dresses
${function() {
const variantData = data.variant || {"id":"b3353a75-c784-4105-a40e-3526b91a71b7","product_id":"4e36ac14-d760-4119-be88-91474ac5d168","title":"Blue-XS-China","weight_unit":"lb","inventory_quantity":198,"sku":"geumxl-85811841-blue-xs-china","barcode":"","position":1,"option1":"Blue","option2":"XS","option3":"China","note":"","image":{"src":"\/\/img.staticdj.com\/6e20abe4dba559108f06979c50d7129d.jpeg","path":"6e20abe4dba559108f06979c50d7129d.jpeg","width":1000,"height":1000,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":36.99,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"36.99","retail_price":"0","available":true,"url":"\/products\/xeasy-summer-women-bohemia-print-sashes-mini-v-neck-dress-female-vintage-casual-chic-slim-long-sleeve-single-breasted-dresses?variant=b3353a75-c784-4105-a40e-3526b91a71b7","available_quantity":198,"options":[{"name":"Color","value":"Blue"},{"name":"Size","value":"XS"},{"name":"Ships From","value":"China"}],"off_ratio":0,"flashsale_info":[],"sales":0};
const saveType = "amount";
const productLabelDiscountOn = true;
return `
-
${saveType == 'percentage'
? `-${variantData.off_ratio}% `
: `- `
}
`;
}()}
Color:
Blue
${function(){
const optName = "Color";
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:
XS
${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}
`
}()}
Ships From:
China
${function(){
const optName = "Ships From";
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
$36.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":"b3353a75-c784-4105-a40e-3526b91a71b7","product_id":"4e36ac14-d760-4119-be88-91474ac5d168","title":"Blue-XS-China","weight_unit":"lb","inventory_quantity":198,"sku":"geumxl-85811841-blue-xs-china","barcode":"","position":1,"option1":"Blue","option2":"XS","option3":"China","note":"","image":{"src":"\/\/img.staticdj.com\/6e20abe4dba559108f06979c50d7129d.jpeg","path":"6e20abe4dba559108f06979c50d7129d.jpeg","width":1000,"height":1000,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":36.99,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"36.99","retail_price":"0","available":true,"url":"\/products\/xeasy-summer-women-bohemia-print-sashes-mini-v-neck-dress-female-vintage-casual-chic-slim-long-sleeve-single-breasted-dresses?variant=b3353a75-c784-4105-a40e-3526b91a71b7","available_quantity":198,"options":[{"name":"Color","value":"Blue"},{"name":"Size","value":"XS"},{"name":"Ships From","value":"China"}],"off_ratio":0,"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.
${function(){
const variantData = data.variant || {"id":"b3353a75-c784-4105-a40e-3526b91a71b7","product_id":"4e36ac14-d760-4119-be88-91474ac5d168","title":"Blue-XS-China","weight_unit":"lb","inventory_quantity":198,"sku":"geumxl-85811841-blue-xs-china","barcode":"","position":1,"option1":"Blue","option2":"XS","option3":"China","note":"","image":{"src":"\/\/img.staticdj.com\/6e20abe4dba559108f06979c50d7129d.jpeg","path":"6e20abe4dba559108f06979c50d7129d.jpeg","width":1000,"height":1000,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":36.99,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"36.99","retail_price":"0","available":true,"url":"\/products\/xeasy-summer-women-bohemia-print-sashes-mini-v-neck-dress-female-vintage-casual-chic-slim-long-sleeve-single-breasted-dresses?variant=b3353a75-c784-4105-a40e-3526b91a71b7","available_quantity":198,"options":[{"name":"Color","value":"Blue"},{"name":"Size","value":"XS"},{"name":"Ships From","value":"China"}],"off_ratio":0,"flashsale_info":[],"sales":0};
return `
`
}()}
(function () {
try {
const getProduct = () => {
const productJson = document.querySelector('#product-json');
if (productJson?.textContent) {
return JSON.parse(productJson.textContent);
}
if (window.jQuery) {
const $product = window.jQuery?.(document)?.data('djproduct');
const productData = JSON.parse(JSON.stringify($product || {}));
return productData || {};
}
return {};
};
const blockDomId = 'pm-block-afterpay-message-1539149753700-10'
const placeholderDomId = 'pm-block-afterpay-message-placeholder-1539149753700-10'
const badgeTheme = "black-on-mint";
const size = "md";
const shopCurrencyCode = "USD";
const productDetail = getProduct();
let productPrice = productDetail?.selected?.price || 36.99;
let settingConfig;
const req = {
ROOT_URL: (C_SETTINGS && C_SETTINGS.routes && C_SETTINGS.routes.root) || '',
post: async (url, data = {}) => {
try {
const response = await fetch(req.ROOT_URL + url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
...data,
body: JSON.stringify(data.body),
});
const result = await response.json();
return result
} catch (error) {
throw new Error('post request error' + error);
}
},
get: async (url, data = {}) => {
try {
const response = await fetch(req.ROOT_URL + url);
const result = await response.json();
return result
} catch (error) {
throw new Error('get request error' + error);
}
}
}
const supportLocaleMap = {
AU: 'en-AU',
NZ: 'en-NZ',
US: 'en-US',
CA: 'en-CA',
GB: 'en-GB',
FR: 'fr-FR',
IT: 'it-IT',
ES: 'es-ES',
DE: 'de-DE',
}
const getPayLaterSetting = () => {
return req.post('/api/payment/pay-later-setting', {body: {payment_channel: 'afterpay'}}).then(res => {
const result = {
...res,
afterpay_currency_locale: supportLocaleMap?.[res?.afterpay_support_country?.[0]] || supportLocaleMap?.US || 'en-US'
}
return result;
});
}
const getBlockDom = () => {
const blockDOM = document.getElementById(blockDomId);
if (!blockDOM) {
return;
}
return blockDOM
}
function errorHandler() {
const blockDOM = getBlockDom();
if (blockDOM) {
blockDOM.style.display = 'none';
}
}
function hasAfterpayMessage() {
// 获取目标元素
const targetElement = document.getElementById(placeholderDomId);
// 判断目标元素是否有兄弟元素节点
const siblings = Array.from(targetElement.parentNode.children).filter(function (node) {
return node.nodeType === Node.ELEMENT_NODE;
});
return siblings.length > 1
}
function renderAfterpay(data = {}) {
const blockDOM = getBlockDom();
if (!blockDOM) {
return;
}
blockDOM.innerHTML = null;
const placeholderDOM = document.createElement('div');
placeholderDOM.id = placeholderDomId;
placeholderDOM.className = 'pm-display-none'
blockDOM.appendChild(placeholderDOM);
blockDOM.style.display = 'block';
if (window.Afterpay && typeof Afterpay?.createPlacements === 'function' && !hasAfterpayMessage()) {
try {
Afterpay.createPlacements({
targetSelector: `#${placeholderDomId}`,
attributes: {
locale: data.afterpay_currency_locale,
currency: data.afterpay_currency,
amount: data.productPrice,
size: size,
badgeTheme: badgeTheme,
}
});
} catch (e) {
console.error('payment-sdk:', e);
}
}
}
async function init(data = {}) {
const blockDOM = getBlockDom();
if (!blockDOM) {
return;
}
if (!settingConfig) {
settingConfig = await getPayLaterSetting();
}
if(data?.detail?.selected?.price){
productPrice = data?.detail?.selected?.price;
}
if (
!settingConfig ||
!settingConfig.afterpay_promo_msg_enabled ||
!settingConfig.afterpay_max_amount ||
!settingConfig.afterpay_min_amount ||
!settingConfig.afterpay_support_country ||
shopCurrencyCode !== settingConfig.afterpay_currency ||
Number(productPrice) <= Number(settingConfig.afterpay_min_amount) ||
Number(productPrice) > Number(settingConfig.afterpay_max_amount)
) {
errorHandler();
return;
}
const scriptDOM = document.getElementById('pm-afterpay-sdk');
if (!scriptDOM) {
window.addEventListener('Afterpay.ready', () => renderAfterpay({
...settingConfig,
productPrice
}));
const afterpaySDK = document.createElement('script');
afterpaySDK.id = 'pm-afterpay-sdk'
afterpaySDK.src = 'https://js.afterpay.com/afterpay-1.x.js';
afterpaySDK.setAttribute('data-analytics-enabled', '');
afterpaySDK.setAttribute('data-min', settingConfig.afterpay_min_amount);
afterpaySDK.setAttribute('data-max', settingConfig.afterpay_max_amount);
afterpaySDK.async = true;
afterpaySDK.onerror = errorHandler;
document.body.appendChild(afterpaySDK);
} else {
renderAfterpay({...settingConfig, productPrice});
}
}
document.addEventListener('dj.variantChange', init);
init();
} catch (e) {
console.error('payment-sdk-afterpaymessage:', e)
}
})()
${function() {
const minDays = parseInt('7');
const maxDays = parseInt('15');
const customText = "Estimated Delivery\uff1a{min_date} - {max_date}";
const minDate = new Date(Date.now() + (minDays * 86400000));
const maxDate = new Date(Date.now() + (maxDays * 86400000));
const formatDate = (minDate.getFullYear() == maxDate.getFullYear() && minDate.getFullYear() == new Date().getFullYear())
? new Intl.DateTimeFormat('en', { month: 'short', day: '2-digit' })
: new Intl.DateTimeFormat('en', { month: 'short', day: '2-digit', year: 'numeric' });
const tipText = customText.replace(/\{min_date\}/g, '' + formatDate.format(minDate) + ' ')
.replace(/\{max_date\}/g, '' + formatDate.format(maxDate) + ' ');
return `
${tipText}
`;
}()}
15 Days Return,100% Money Back
7*24h Service at: support@geumxl.com