Home
Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage
Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage
partager pour obtenir un coupon
Nos chaussettes photo personnalisées sont le cadeau idéal pour n'importe qui et pour n'importe quelle occasion... Vous pouvez y mettre votre propre visage, celui d'un ami ou d'un membre de votre famille, votre célébrité préférée, ou tout ce qui vous vient à l'esprit !
Matière : 95% Polyester, 5% Lycra : 95 % polyester, 5 % lycra, très confortable à porter.
Délai de production : 2-5 jours ouvrables.
Couleur : Des couleurs riches et vibrantes sont incrustées profondément dans la chaussette.
Fabrication : Le fil de qualité supérieure résiste à la traction du tissu et empêche l'impression de se décolorer.
Conception personnalisée : Notre équipe de conception travaille dur pour obtenir une découpe parfaite de votre photo à partir de la photo que vous avez téléchargée.
DR.Gift offre un coupon de réduction, vous avez obtenu un coupon de réduction de 5%.
global.product.review_popup_del_title
\n\n\n\n
\n
EMBED THE SNIPPET BELOW IN YOUR SITE \n
\n
\n
\n\n
\n\n","featured_image":{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":null,"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000},"featured_media":{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":null,"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000},"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000},"first_available_variant":{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090182015","image":null,"option1":"Homme (Longueur du pied 20CM = 7.87in)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Homme (Longueur du pied 20CM = 7.87in)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-L","taxable":false,"title":"Homme (Longueur du pied 20CM = 7.87in)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090182015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}},"handle":"custom-photo-socks-couple-avocado-theme","has_only_default_variant":false,"images":[{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":null,"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000}],"media":[{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":null,"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000},"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000}],"options":["Taille"],"options_by_name":{"Taille":{"name":"Taille","selected_value":null,"values":["Homme (Longueur du pied 20CM = 7.87in)","Femme (Longueur du pied 18CM = 7.08in)","Enfant (longueur du pied 14 cm = 5,51 pouces)"],"position":0,"values_images":[{"value":"Homme (Longueur du pied 20CM = 7.87in)","image":null},{"value":"Femme (Longueur du pied 18CM = 7.08in)","image":null},{"value":"Enfant (longueur du pied 14 cm = 5,51 pouces)","image":null}],"option_values":[{"id":"16268608869762807090212015","value":"Homme (Longueur du pied 20CM = 7.87in)","image":null},{"id":"16268608869762807090262015","value":"Femme (Longueur du pied 18CM = 7.08in)","image":null},{"id":"16268608869762807090312015","value":"Enfant (longueur du pied 14 cm = 5,51 pouces)","image":null}]}},"options_with_values":[{"name":"Taille","position":0,"selected_value":null,"values":["Homme (Longueur du pied 20CM = 7.87in)","Femme (Longueur du pied 18CM = 7.08in)","Enfant (longueur du pied 14 cm = 5,51 pouces)"],"values_images":[{"value":"Homme (Longueur du pied 20CM = 7.87in)","image":null},{"value":"Femme (Longueur du pied 18CM = 7.08in)","image":null},{"value":"Enfant (longueur du pied 14 cm = 5,51 pouces)","image":null}],"option_values":[{"id":"16268608869762807090212015","value":"Homme (Longueur du pied 20CM = 7.87in)","image":null},{"id":"16268608869762807090262015","value":"Femme (Longueur du pied 18CM = 7.08in)","image":null},{"id":"16268608869762807090312015","value":"Enfant (longueur du pied 14 cm = 5,51 pouces)","image":null}],"specName":"Taille","specPosition":1,"specIndex":"0","hideVariant":false}],"price":2595,"price_max":2595,"price_min":2595,"price_varies":true,"requires_selling_plan":false,"selected_variant":null,"selected_or_first_available_variant":{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090182015","image":null,"option1":"Homme (Longueur du pied 20CM = 7.87in)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Homme (Longueur du pied 20CM = 7.87in)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-L","taxable":false,"title":"Homme (Longueur du pied 20CM = 7.87in)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090182015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}},"tags":["custom-sunzi-chase-tag10959","add-gift-bag","custom photo","custom-croppic","custom-mademine-tag","custom-Sockft","delivery-guaranteed","giftbag-v-kit-4055","googlepla2","googlepla4test","insurance","isCustom","liuying","pattern-face","sock","sockdetails","socks"],"variants":[{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090182015","image":null,"option1":"Homme (Longueur du pied 20CM = 7.87in)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Homme (Longueur du pied 20CM = 7.87in)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-L","taxable":false,"title":"Homme (Longueur du pied 20CM = 7.87in)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090182015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}},{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090242015","image":null,"option1":"Femme (Longueur du pied 18CM = 7.08in)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Femme (Longueur du pied 18CM = 7.08in)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-M","taxable":false,"title":"Femme (Longueur du pied 18CM = 7.08in)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090242015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}},{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090292015","image":null,"option1":"Enfant (longueur du pied 14 cm = 5,51 pouces)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Enfant (longueur du pied 14 cm = 5,51 pouces)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-S","taxable":false,"title":"Enfant (longueur du pied 14 cm = 5,51 pouces)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090292015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}}],"quantity_price_breaks_configured":false};
var $variant = getQueryVariable('sku') || product.variants[0].id;
var _sunzi_dom_loaded_promise = new Promise((resolve) => {
window.addEventListener('DOMContentLoaded', resolve);
});
// 监听dom加载完成
function _domLoaded() {
return _sunzi_dom_loaded_promise;
}
function _sunzi_get_variant_id() {
$variant = getQueryVariable('sku') || product.variants[0].id;
return $variant;
}
/** sunzi 寻找所有变体元素 **/
function _sunzi_find_variants(formClass = _sunzi_global_data.domLabel.form, selectClass = _sunzi_global_data.domLabel.select) {
var formClassText = formClass || formClassLabel;
return $(formClassText).find(selectClass);
}
// 多产品加车 data是数组
function _sunzi_add_to_cart_multi(data) {
if (data.length === 0) return;
addCommonProdcut(data)
data.forEach((item) => addCommonProperties(item))
return new Promise((resolve, reject) => {
$.ajax({
type: "POST",
url: "/api/carts/ajax-cart/add.js",
data: JSON.stringify({
items: data
}),
contentType: 'application/json',
dataType: 'json',
context: this,
success: async (response) => {
// refresh cart data
Cart.refresh();
// show success drawer
var quantityHtml=`
${addCartProImage()}
${$(".title.shopline-element-title").text()}
${$("#ProductPriceproduct-page-price").text()}
x${$("#Quantity-main-product-info").val()}
`;
$(".trade-cart-sku-item-info-title.body2").html(quantityHtml);
$("#cart-select").addClass("top-drawer--open").show();
$('.top-drawer__mask').bind("click",function(e){
if($(e.target).closest("#cart-select").length == 1){
$("#cart-select").removeClass("top-drawer--open").hide();
}
})
$(".trade-cart-banner--close").on("click",function(){
$("#cart-select").removeClass("top-drawer--open").hide();
})
resolve(response);
},
error: (request, status) => {
reject(request, status);
}
})
})
}
// 添加通用Properties
function addCommonProperties(mainProduct) {
const host = window.location.host
// soufeel补充language参数
if (host.includes("r39x33kmubdcsvja9i") || host.includes("soufeel")) {
const language = mainProduct.properties.find(item => item.name === "language")
if (language) return;
mainProduct.properties = [
...mainProduct.properties,
{
type: 'text',
name: 'language',
value: _sunzi_global_data["shop-v1"].language,
}
]
}
}
// 寻找主产品
function findMainProduct(data) {
let mainProduct = undefined;
let mainProductId = undefined;
if (data.length === 1) {
mainProduct = data[0];
const bindId = mainProduct.properties.find(item => item.name === "_bind")
if (bindId) mainProductId = bindId.value;
else {
mainProductId = _create_uuid();
mainProduct.properties = [
...mainProduct.properties,
{
type: 'text',
name: '_bind',
value: mainProductId,
}
]
}
} else {
data.some((productItem) => {
const bindId = productItem.properties.find(item => item.name === "_bind")
if (bindId) {
mainProduct = productItem;
mainProductId = bindId.value;
return true;
} else return false;
})
}
return {mainProduct, mainProductId}
}
// 添加通用加购
function addCommonProdcut(data) {
// 新版追销参数
// 数量控制
var chaseBindQuantity = {
"allow": 101,
"not_allow": 102,
"follow": 103
}
// 删除控制
var chaseBindAloneDelete = {
"allow": 201,
"not_allow": 202
}
// 寻找主产品
const { mainProduct, mainProductId } = findMainProduct(data)
if (mainProduct && mainProductId) {
const isChecked = $('#insuranceBox').prop('checked');
let queue=[]
if (isChecked) {
const value = $('#insuranceBox').val();
// let _sunzi_related_productsItem= data[0].properties.find(item=>{
// return item.name==='_sunzi_related_products'
// })
// if(_sunzi_related_productsItem){
// let _value=JSON.parse(data[0].properties['_sunzi_related_products'].value)
// data[0].properties['_sunzi_related_products']={
// ...data[0].properties['_sunzi_related_products'],
// value:JSON.stringify(_value.push(uuid))
// }
// }
// else{
// data[0].properties.push({
// type: "text",
// name: "_sunzi_related_products",
// value: JSON.stringify([uuid])
// })
// }
queue.unshift({
"id":value,
properties:[{
type: 'text',
name: '_bindTo',
value: mainProductId,
}, {
type: 'text',
name: '_bindQuantity',
value: chaseBindQuantity.not_allow,
}, {
type: 'text',
name: '_bindAloneDelete',
value: chaseBindAloneDelete.allow,
}],
"quantity": 1,
});
}
data.push(...queue)
}
}
// 获取地址栏参数
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i
\n\n\n
\n\n\n\n\n
\n
EMBED THE SNIPPET BELOW IN YOUR SITE \n
\n
\n
\n\n
\n\n","featured_image":{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":null,"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000},"featured_media":{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":null,"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000},"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000},"first_available_variant":{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090182015","image":null,"option1":"Homme (Longueur du pied 20CM = 7.87in)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Homme (Longueur du pied 20CM = 7.87in)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-L","taxable":false,"title":"Homme (Longueur du pied 20CM = 7.87in)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090182015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}},"handle":"custom-photo-socks-couple-avocado-theme","has_only_default_variant":false,"images":[{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":null,"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000}],"media":[{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":{"alt":"Chaussettes Personnalisées Chaussettes Avocat Avec Cadeau De Noël Visage - GiftLabfr","id":"6930000788593842907","media_type":"image","position":1,"preview_image":null,"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000},"aspect_ratio":"1.0000","attached_to_variant":false,"height":1000,"product_id":"16068608869758277240922015","src":"https://img-va.myshopline.com/image/store/1739158451681/CWZ435-74da66a5-c829-4874-a82a-78cd45739650.png?w=1000&h=1000","variants":[],"width":1000}],"options":["Taille"],"options_by_name":{"Taille":{"name":"Taille","selected_value":null,"values":["Homme (Longueur du pied 20CM = 7.87in)","Femme (Longueur du pied 18CM = 7.08in)","Enfant (longueur du pied 14 cm = 5,51 pouces)"],"position":0,"values_images":[{"value":"Homme (Longueur du pied 20CM = 7.87in)","image":null},{"value":"Femme (Longueur du pied 18CM = 7.08in)","image":null},{"value":"Enfant (longueur du pied 14 cm = 5,51 pouces)","image":null}],"option_values":[{"id":"16268608869762807090212015","value":"Homme (Longueur du pied 20CM = 7.87in)","image":null},{"id":"16268608869762807090262015","value":"Femme (Longueur du pied 18CM = 7.08in)","image":null},{"id":"16268608869762807090312015","value":"Enfant (longueur du pied 14 cm = 5,51 pouces)","image":null}]}},"options_with_values":[{"name":"Taille","position":0,"selected_value":null,"values":["Homme (Longueur du pied 20CM = 7.87in)","Femme (Longueur du pied 18CM = 7.08in)","Enfant (longueur du pied 14 cm = 5,51 pouces)"],"values_images":[{"value":"Homme (Longueur du pied 20CM = 7.87in)","image":null},{"value":"Femme (Longueur du pied 18CM = 7.08in)","image":null},{"value":"Enfant (longueur du pied 14 cm = 5,51 pouces)","image":null}],"option_values":[{"id":"16268608869762807090212015","value":"Homme (Longueur du pied 20CM = 7.87in)","image":null},{"id":"16268608869762807090262015","value":"Femme (Longueur du pied 18CM = 7.08in)","image":null},{"id":"16268608869762807090312015","value":"Enfant (longueur du pied 14 cm = 5,51 pouces)","image":null}],"specName":"Taille","specPosition":1,"specIndex":"0","hideVariant":false}],"price":2595,"price_max":2595,"price_min":2595,"price_varies":true,"requires_selling_plan":false,"selected_variant":null,"selected_or_first_available_variant":{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090182015","image":null,"option1":"Homme (Longueur du pied 20CM = 7.87in)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Homme (Longueur du pied 20CM = 7.87in)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-L","taxable":false,"title":"Homme (Longueur du pied 20CM = 7.87in)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090182015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}},"tags":["custom-sunzi-chase-tag10959","add-gift-bag","custom photo","custom-croppic","custom-mademine-tag","custom-Sockft","delivery-guaranteed","giftbag-v-kit-4055","googlepla2","googlepla4test","insurance","isCustom","liuying","pattern-face","sock","sockdetails","socks"],"variants":[{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090182015","image":null,"option1":"Homme (Longueur du pied 20CM = 7.87in)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Homme (Longueur du pied 20CM = 7.87in)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-L","taxable":false,"title":"Homme (Longueur du pied 20CM = 7.87in)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090182015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}},{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090242015","image":null,"option1":"Femme (Longueur du pied 18CM = 7.08in)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Femme (Longueur du pied 18CM = 7.08in)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-M","taxable":false,"title":"Femme (Longueur du pied 18CM = 7.08in)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090242015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}},{"available":true,"barcode":"","compare_at_price":4000,"featured_image":null,"featured_media":null,"id":"18068608869762807090292015","image":null,"option1":"Enfant (longueur du pied 14 cm = 5,51 pouces)","option2":null,"option3":null,"option4":null,"option5":null,"options":["Enfant (longueur du pied 14 cm = 5,51 pouces)"],"price":2595,"requires_selling_plan":false,"requires_shipping":true,"selected":false,"selling_plan_allocations":[],"sku":"CWZ435-S","taxable":false,"title":"Enfant (longueur du pied 14 cm = 5,51 pouces)","url":"/products/custom-photo-socks-couple-avocado-theme?sku=18068608869762807090292015","weight_in_unit":"88","weight_unit":"g","inventory_management":false,"inventory_policy":"deny","inventory_quantity":0,"quantity_rule":{"increment":1,"min":1,"max":null}}],"quantity_price_breaks_configured":false};
// 兼容shop元字段在2.0和2.1模板的获取
const shopRaw = {"name":"sl-礼物站Giftlabfr","currency":"EUR","language":"fr_FR","theme":{"r":227,"g":22,"b":115,"a":1}};
let shop;
try{
shop = JSON.parse(shopRaw)
}catch(err){
shop = shopRaw
}
// 根据标签获取定制参数
let prevAccordSku;
let AccordChaseTagCache = {};
let designer = null;
const _jsonGetByVariantId = (variantId = _sunzi_get_variant_id()) => {
// 符合要求的【变体】
const accordVariant = product.variants.find(item => `${item.id}` === variantId)
// 如果accordVariant不存在或者sku不存在
if (!(accordVariant && accordVariant.sku)) {
prevAccordTag = undefined;
return Promise.resolve(undefined);
}
// 如果切换的SKU跟之前的sku是一致的
if (prevAccordSku === accordVariant.sku) {
return Promise.resolve(undefined);
}
// 符合要求的【追销tags】
const accordChaseTags = product.tags
.map(item => item.match(`^custom-sunzi-chase-tag(\\d*)[-]?(${accordVariant.sku.toUpperCase()})?$`))
.filter(Boolean)
.sort(a => a[2] ? -1 : 1) || []; // 优先获取精准sku匹配的
return Promise.all([
// 请求JSON数据
fetch(`https://sunzi-cool.customeow.io/product/tag2/json/${accordVariant.sku}/${shop.language}.json`)
.then((resp) => {
if (resp.status >= 400){
throw new Error();
} else showSunzi()
return resp;
})
.then(resp => resp.json())
.then(data => {
// 构建参数
const availableVariant = product.variants.find(item => item.id.toString() === variantId);
// 激活的变体
const activeVariants = product.options.map((item, index) => ({
id: index,
name: item,
value: {
id: product.options.length + index,
name: availableVariant.options[index]
}
}));
const variantConnects = data.variantConnects.map(item => Object.assign(item, {
featuredImage: availableVariant.featured_image ? availableVariant.featured_image.src : product.featured_image.src,
available: availableVariant.available,
sku: availableVariant.sku,
shopAvailable: availableVariant.available,
}))
return Object.assign(data, {
activeVariants,
variantConnects
});
})
.finally(() => {
prevAccordTag = accordVariant.sku;
}),
Promise.all(accordChaseTags.map(item => {
// 如果有缓存
if (AccordChaseTagCache[item[1]]) return Promise.resolve(AccordChaseTagCache[item[1]]);
return fetch(`https://sunzi-cool.customeow.io/product/chase/tag/json/${item[1]}.json`)
.then((resp) => {
if (resp.status >= 400) throw Error('chase tag network error');
return resp;
})
.then(resp => resp.json())
.then(resp => {
AccordChaseTagCache[item[1]] = resp;
return resp;
})
}))
]).then(([ data, chases ]) => {
if(variantId !== $variant) throw new Error("InvalidVariantError");
// 构建关联产品
const relatedProduct = chases[0];
// 判断加购了类型是否都一致 一致的话 进行整合
const chaseTypes = chases.map(item => item.type);
if (relatedProduct && new Set(chaseTypes).size === chaseTypes.length)
relatedProduct.children = chases.map(item => item.children).reduce((a, b) => a.concat(b));
else
chases.length > 1 && console.warn('sunzi-designer: There are different types of addChases, only get the first one');
return Object.assign(data, {
variantConnects: data.variantConnects.map(item => Object.assign(item, {
relatedProductId: relatedProduct && relatedProduct.id,
})),
relatedProducts: relatedProduct ? [ relatedProduct ] : []
});
})
}
Promise.all([
_domLoaded(),
_jsonGetByVariantId()
])
.then(designerInit)
.catch(e => {
console.log(e)
})
// 监听变体改变
const handleChangeVariants = (sku) => {
let timer = null;
// 触发loading
if(designer) {
timer = setTimeout(() => {
designer.setLoading(true);
showSunzi()
}, 500);
} else showSunzi()
// 结束逻辑
const finallyFun = () => {
if (!designer) return;
clearTimeout(timer);
designer.forceRender();
}
// 加载数据
_jsonGetByVariantId(sku)
.then((data) => {
if(designer) designer.onVariantChange(data)
else designerInit([undefined, data]);
finallyFun();
if(designer) designer.setLoading(false);
}).catch(() => {
finallyFun();
if(designer) designer.setLoading(true);
console.error("Error. Please check your network and the synchronization status of data");
})
}
if (platform === "shopline") {
if(window.Shopline && window.Shopline.event) {
window.Shopline.event.on('Product::SkuChanged', function (payload) {
const { data: { skuSeq } } = payload;
$variant = skuSeq;
handleChangeVariants(skuSeq);
})
} else if ($(_sunzi_global_data.domLabel.form).length !== 0) {
$(_sunzi_global_data.domLabel.form).on('change', function() {
if (typeof this.onVariantChange === "function") this.onVariantChange();
handleChangeVariants()
})
} else if ($(_sunzi_global_data.domLabel.backupForm).length !== 0) {
$(_sunzi_global_data.domLabel.backupForm).on('change', function() {
if (typeof this.onVariantChange === "function") this.onVariantChange();
handleChangeVariants()
})
}
} else {
_sunzi_find_variants().on('change', () => handleChangeVariants())
}
function designerInit([_, data]) {
// 渲染
designer = Designer.render(Designer.default, {
env: 'prod',
shop,
productId: product.id,
async onConfirm(ouput, effects, { sku, uniqid, relatedProducts, addedCharges }) {
// 创建主产品 properties 给主产品增加一个绑定标识
const mainProductProperties = [
{
type: 'text',
name: "customInfo",
value: JSON.stringify(ouput),
},
{
type: 'text',
name: "_from",
value: "sunzi-designer2-tag",
},
{
type: 'text',
name: '_bind',
value: uniqid
},
{
type: 'text',
name: "_sunzi_cart",
value: JSON.stringify({
image: effects
}),
}
];
// 加车队列
var _queue = [];
// 处理关联产品逻辑
if (relatedProducts.length > 0) {
const _relatedProducts = relatedProducts.forEach(item => {
if (item.type === SUNZI_RelatedProductItemType.product) { // 普通产品
item.products.forEach(product => {
const params = handleRelatedProducts(product, item, uniqid, {
properties: [{
type: 'text',
name: "_sunzi_chase_from",
value: sku,
}]
});
_queue.push(params);
});
} else if (item.type === SUNZI_RelatedProductItemType.virtualProduct) { // 虚拟产品
console.log(item)
item.products.forEach(product => {
// 给主产品注入依赖参数
mainProductProperties.push({
type: 'text',
name: `${item.serviceType}`,
value: item.serviceTypeValue
});
const params = handleRelatedProducts(product, item, uniqid, {
properties: [{
type: 'text',
name: "_sunzi_chase_from",
value: sku,
}]
});
_queue.push(params);
});
} else if (item.type === SUNZI_RelatedProductItemType.customProduct) { // 定制产品
item.products.forEach(product => {
const params = handleRelatedProducts(product, item, uniqid, {
properties: [{
type: 'text',
name: "_sunzi_chase_from",
value: sku,
}]
});
_queue.push(params);
});
}
});
}
// 处理加价产品逻辑
if (addedCharges) {
addedCharges.forEach(item => {
const params = handleRelatedProducts(item, {
bind: true,
bindQuantity: 103, // 数量跟随主产品
bindAloneDelete: 202 // 不可以单独删除
}, uniqid, {
quantity: item.quantity,
properties: [{
type: 'text',
name: "_sunzi_chase_from",
value: sku,
}]
});
_queue.push(params);
});
}
// 加车主产品
_queue.push({
id: getQueryVariable('sku') || $("input[name='id']").val() || product.variants[0].id,
properties: mainProductProperties,
});
console.log('_queue', _queue);
// 关联加车事件触发
debugger
// 加车事件触发
await _sunzi_add_to_cart_multi(_queue.map(item => Object.assign(item, { quantity: 1 })));
$('#sunzi-loading').hide();
}
}, document.getElementById('sunzi-node'),{ enabledSentry: false }).current;
designer.onVariantChange(data);
designer.setLoading(false);
}
/** 其他自定义函数 start **/
// 显示定制区
function showSunzi() {
}
// 表单补充input
function replenishFormInput(data) {
const input = document.createElement('input');
Object.keys(data).map(key => {
input[key] = data[key];
});
input.type = 'hidden';
input.id = 'sunzi-replenish';
$('.sunzi-form').append(input);
}
// 清空表单
function clearReplenishFormInpput() {
$('input[id="sunzi-replenish"]').remove();
}
// 处理关联产品逻辑
function handleRelatedProducts(product, related, uniqid, options = {}) {
const data = Object.assign({
id: product.variantId,
quantity: 1,
}, options);
// 如果产品与主产品进行绑定的话
if (related.bind) {
data.properties.push(
{
type: 'text',
name: '_bindTo',
value: uniqid,
},
{
type: 'text',
name: '_bindQuantity',
value: related.bindQuantity,
},
{
type: 'text',
name: '_bindAloneDelete',
value: related.bindAloneDelete,
}
);
// 与主产品绑定的key, 当该关联产品产品删除时, 要清掉对应主产品的关联参数
if (related.serviceType) {
data.properties.push({
type: 'text',
name: '_bindKey',
value: related.serviceType,
})
};
}
// 处理定制追销逻辑
if (related.type === SUNZI_RelatedProductItemType.customProduct) {
data.properties.push(
{
type: 'text',
name: '_from',
value: "sunzi-designer2-tag",
},
{
type: 'text',
name: 'customInfo',
value: JSON.stringify(related.customInfo),
},
{
type: 'text',
name: '_sunzi_cart',
value: JSON.stringify({
image: related.effects
}),
}
);
}
// 处理实体加购 定制模块逻辑
if (related.type === SUNZI_RelatedProductItemType.product && related.customInfo) {
data.properties.push(
{
type: 'text',
name: '_from',
value: "sunzi-designer2-tag",
},
{
type: 'text',
name: 'customInfo',
value: JSON.stringify(Object.assign({
featured_image: product.featuredImage
}, related.customInfo)),
}
);
}
return data;
}
// 悬浮按钮出现消失逻辑
$( document ).ready(function() {
createObserver();
});
function createObserver() {
/* .sunzi-form #sunzi-node .__custom_button_wrapper > div {
padding-bottom: max(constant(safe-area-inset-bottom), 10px);
padding-bottom: max(env(safe-area-inset-bottom), 10px);
transition: padding 0.3s;
} */
const target = document.getElementsByClassName("sunzi-form")[0];
function callback(entries, observer) {
entries.forEach((entry) => {
if(entry.boundingClientRect.top < 0 || entry.intersectionRatio > 0){
// 出现
$(target).addClass("show")
} else {
// 消失
$(target).removeClass("show")
}
});
}
const options = {
root: null,
rootMargin: "0px",
threshold: 0,
};
const observer = new IntersectionObserver(callback, options);
observer.observe(target);
}
/** 其他自定义函数 end **/
Obtenez 💰15% de réduction sur tous les produits chaque fois que vous recommandez un ami !
Recommander Maintenant
Saisissez l'adresse électronique à laquelle vous souhaitez recevoir vos récompenses.
Partagez avec chacun de vos amis l'offre fabuleuse de 10 % de réduction sur tous les produits lors de leur première commande.
Vous bénéficiez d'un code de réduction de 15 % sur tous les produits.
Wow, It's great, We will send the coupon code to your email.