${data.day}/${data.month}/${data.year} ${data.hour}:${data.minutes}:${data.seconds}
${data.day}.${data.month}.${data.year}
${(function(){ const currentImage=data.currentImage; return `
${(function(){ if(data?.frame?.img_path) { return `
` } return '' })()}
`})()}
${(function(){ const getModelKey=(model)=>(model.bImg?.replaceAll('.','')+(model.createTime||'')); return `
` })()}
${function(){
if(data.count>0){
return `
`
}else{
return `
`
}
}()}
${data.hour < 10 ? '0' + data.hour : data.hour}:${data.mins < 10 ? '0' + data.mins : data.mins}:${data.seconds < 10 ? '0'+data.seconds : data.seconds}
Herzlichen Glückwunsch!
Sie haben einen zusätzlichen
5€ Rabatt erhalten
Sparen Sie 5€ in Ihrem Einkaufswagen
OK
function checkPage(){
const bgPage=['/pages/klarna','/pages/about-us','/pages/shippingtracking','/pages/return-refund','/pages/privacysecurity','/pages/conditions','/pages/review-of-prescriptions','/pages/affiliate'];
if(bgPage.includes(window.location.pathname)) { return Promise.resolve({}); } else { return Promise.reject({}); } } exportFunction('checkBg', checkPage);
function getLoginstatus() {
var name = "client_id=";
var ca = document.cookie.split(';');
for(var i=0; i< ca.length; i++) {
var c = ca[i].trim();
if (c.indexOf(name)==0) {
if(c.substring(name.length,c.length) != ""){
document.getElementById("not_login_footer").style.display = "none !important";
document.getElementById("login_footer").style.display = "block !important";
}else{
document.getElementById("not_login_footer").style.display = "block !important";
document.getElementById("login_footer").style.display = "none !important";
}
}
}
}
function setIsRefreshPage() {
localStorage.setItem("is_refresh_page",true);
}
function refreshPage() {
var is_refresh_page = localStorage.getItem("is_refresh_page");
if(is_refresh_page){
return Promise.resolve({});
}else{
return Promise.reject({});
}
}
function getCustomCoupons(){
var coupon_ids_js = document.getElementById("coupon-id-lists-quick").textContent;
if(null || localStorage.getItem("is_refresh_page")){
return Promise.all([fetch('/api/discount-coupon/coupons?ids[]=447946825199007735&ids[]=447947327156533239&ids[]=447947917089575056&ids[]=447948471635284112&ids[]=447949012826339319'),fetch('/api/discount-coupon/coupons/received/count',{
method: 'POST',
credentials: 'same-origin',
body: coupon_ids_js
})]).then((res) => {
return Promise.all([res[0].json(),res[1].json()])
}).then((data) => {
data[0].isLogin = true;
return data;
});
}else{
return Promise.all([fetch('/api/discount-coupon/coupons?ids[]=447946825199007735&ids[]=447947327156533239&ids[]=447947917089575056&ids[]=447948471635284112&ids[]=447949012826339319')]).then((res) => {
return Promise.all([res[0].json()])
}).then((data) => {
data[0].isLogin = false;
return data;
});
}
}
exportFunction('getLoginstatus', getLoginstatus);
exportFunction('setIsRefreshPage', setIsRefreshPage);
exportFunction('refreshPage', refreshPage);
exportFunction('getCustomCoupons', getCustomCoupons);
${function() {
var status = data.data.status;
var toast_info = "";
var text_color = "text_color_error";
var num = data.data.items?.length;
if(num > 0){
toast_info = ("{count} Gutschein \uff08e\uff09 wurde erfolgreich gesammelt.").replace('{count}', num);
text_color = "text_color_success";
}else{
if(status == 0){
toast_info = "Gutschein wurde erfolgreich gesichert! Bitte verwenden Sie ihn an der Kasse.";
text_color = "text_color_success";
}else if(status == 1){
//没有领取资格
toast_info = "Nicht abgeholt\uff0cSie haben keinen Anspruch auf.";
}else if(status == 2){
//达到领取上限(总数不能大于100)
toast_info = "Nicht abgeholt, das Limit von 100 Gutscheinen wurde erreicht, bitte nutzen Sie es.";
}else if(status == 3){
//达到领取上限(超过后台配置领取上限)
toast_info = "Nicht abgeholt, der aktuelle Gutschein hat das Limit erreicht.";
}else if(status == 4){
//已过期
toast_info = "Nicht abgeholt\uff0cder aktuelle Gutschein ist nicht abgelaufen.";
}else if(status == 5){
//优惠券不存在
toast_info = "Nicht abgeholt\uff0cder aktuelle Gutschein existiert nicht.";
}else if(status == 6){
//重复领取
toast_info = "Erfolgreich einloggen.";
}else if(status == 7){
//库存不足
toast_info = "Nicht abgeholt\uff0cder aktuelle Gutschein nicht auf Lager.";
}else if(status == 8){
//领取失败:并发竞争获取锁失败|第三方服务调用失败等情况
toast_info = "Empfang fehlgeschlagen.";
}else if(status == 9){
//未开始
toast_info = "Einfordern fehlgeschlagen, der Coupon hat noch nicht begonnen.";
}else if(status == 10){
//未订阅
toast_info = "Nicht abgeholt\uff0cSie sollten sich anmelden, um den Gutschein zu erhalten.";
}else if(status == 11){
//未购买
toast_info = "Nicht abgeholt, Sie sollten eine Bestellung abgeschlossen haben, um den Gutschein zu erhalten.";
}
}
if(status == 6) {
text_color = "text_color_success";
return `${toast_info} `;
} else {
return `${toast_info} `;
}
}()}
${function() {
var status = data.data.status;
var toast_info = "";
var text_color = "text_color_error";
var num = data.data.items?.length;
if(num > 0){
toast_info = "Sie haben sich erfolgreich registriert und Rabatte erhalten.";
text_color = "text_color_success";
}else{
if(status == 0){
toast_info = "Gutschein wurde erfolgreich gesichert! Bitte verwenden Sie ihn an der Kasse.";
text_color = "text_color_success";
}else if(status == 1){
//没有领取资格
toast_info = "Nicht abgeholt\uff0cSie haben keinen Anspruch auf.";
}else if(status == 2){
//达到领取上限(总数不能大于100)
toast_info = "Nicht abgeholt, das Limit von 100 Gutscheinen wurde erreicht, bitte nutzen Sie es.";
}else if(status == 3){
//达到领取上限(超过后台配置领取上限)
toast_info = "Nicht abgeholt, der aktuelle Gutschein hat das Limit erreicht.";
}else if(status == 4){
//已过期
toast_info = "Nicht abgeholt\uff0cder aktuelle Gutschein ist nicht abgelaufen.";
}else if(status == 5){
//优惠券不存在
toast_info = "Nicht abgeholt\uff0cder aktuelle Gutschein existiert nicht.";
}else if(status == 6){
//重复领取
toast_info = "Erfolgreich einloggen.";
}else if(status == 7){
//库存不足
toast_info = "Nicht abgeholt\uff0cder aktuelle Gutschein nicht auf Lager.";
}else if(status == 8){
//领取失败:并发竞争获取锁失败|第三方服务调用失败等情况
toast_info = "Empfang fehlgeschlagen.";
}else if(status == 9){
//未开始
toast_info = "Einfordern fehlgeschlagen, der Coupon hat noch nicht begonnen.";
}else if(status == 10){
//未订阅
toast_info = "Nicht abgeholt\uff0cSie sollten sich anmelden, um den Gutschein zu erhalten.";
}else if(status == 11){
//未购买
toast_info = "Nicht abgeholt, Sie sollten eine Bestellung abgeschlossen haben, um den Gutschein zu erhalten.";
}
}
if(status == 6) {
text_color = "text_color_success";
return `${toast_info} `;
} else {
return `${toast_info} `;
}
}()}
${(function(){
let infoData = [];
let orderInfoArr = [];
let shippingInfoArr = [];
let finishOrderInfoArr = [];
let tracking_destination_country = '';
const mapList = {
create_fulfillment:"Ihre Bestellung ist abgeschlossen.",
finish_fulfillment:"Die Bestellung wird bearbeitet.",
order_payment:"Ihre Zahlung war erfolgreich.",
created_order:"Ihre Bestellung wurde erstellt."
};
if (!data[0]){
oderInfoArr = data.time_line.map((e)=>({...e,uniteTime:e.created_at,message:mapList[e.event_type]}));
}else{
if(data[1]){
tracking_destination_country = data[1].data.tracking_destination_country;
}
let shipping_array = data[1]?.data?.checkpoints || [];
oderInfoArr = data[0].time_line.map((e)=>({...e,uniteTime:e.created_at,message:mapList[e.event_type]}));
shippingInfoArr = shipping_array.map((e)=>({...e,uniteTime:e.checkpoint_time,message:e.message}));
};
console.log('oderInfoArr',oderInfoArr)
infoData = [...oderInfoArr,...shippingInfoArr].sort((a,b)=>new Date(b.uniteTime).getTime()-new Date(a.uniteTime).getTime());
const checkpoints = infoData;
return `
${tracking_destination_country ? `
Destination: ${tracking_destination_country}
` : ''}
${checkpoints.map((item)=>{
return`
` }).join(' ')}
` })()}
${data.hour < 10 ? '0' + data.hour : data.hour}H:${data.mins < 10 ? '0' + data.mins : data.mins}M:${data.seconds < 10 ? '0'+data.seconds : data.seconds}S
function getOrderCountDownData(option) {
const orderCountDownData = {};
const option_str = "page=" + option.page +"&per_page="+ option.per_page + "&with_fulfillments=true"
return Promise.all([fetch('/api/orders.json?'+option_str),fetch('/api/zeelool_unpaid_orders')]).then((res) => {
return Promise.all([res[0].json(),res[1].json()])
}).then((data) => {
data[0].order_list.orders.forEach((item) => {
item.expired_time = data[1] || {};
});
return data[0];
});
}
exportFunction('getOrderCountDownData', getOrderCountDownData);
${function() { const count = data?.order_list?.count; if(count > 0) { return `
` } else { return `
` } } ()}
${function() {
const line_items = data.originData.line_items;
let line_items_count = 0;
let tabSelected = "all"
for (let line_item of line_items) {
line_items_count += line_item.quantity;
}
const createAt = data.create_at;
let formatTime = '';
if (createAt) {
const createTime = new Date(createAt);
const month = createTime.getMonth() + 1;
const month_str = month < 10 ? '0' + month : month;
const day_str = createTime.getDate() < 10 ? '0' + createTime.getDate() : createTime.getDate();
formatTime = `${day_str}/${month_str}/${createTime.getFullYear()}`;
}
const statusLangs = {
unpaid:'Unbezahlte'
, complete:'Versandte'
, processing:'Verarbeitete'
, cancelled:'Geschlossene'
, delivered:'Lieferung'
};
let statusType = 'complete';
if (data.status !== 'finished' && data.fulfillment_status == 'waiting' ) {
statusType = 'processing';
tabSelected = "shipped"
} else if (data.status === 'opened' && data.financial_status != 'failed') {
statusType = 'unpaid';
tabSelected = "unpaid"
} else if (data.status === 'finished' && data.fulfillment_status == 'finished' && data.financial_status == 'paid') {
statusType = 'delivered';
tabSelected = "delivery"
} else if (data.status === 'cancelled' || (data.status === 'finished' && data.fulfillment_status == 'waiting')) {
statusType = 'cancelled';
tabSelected = "close";
}else if(data.financial_status === 'failed'){
statusType = 'pay_failed';
}
if(statusType == "complete") {
tabSelected = "handle";
}
const actualTotal = parseFloat(data.total) - parseFloat(data.gift_card_total);
let order_item_product_infos = "";
for(var i = 0; i < data.line_items.length; i++){
order_item_product_infos += "order-item-product-info-"+data.line_items[i].id+".toggleClass(class='hidden', force=false);";
}
const id = data.id;
const track_number = data?.fulfillments[0]?.tracking_number || '';
let expired_time_Lists = data.expired_time.orders;
let expired_time = "";
for(let i=0; i < expired_time_Lists.length; i++ ){
if(expired_time_Lists[i].order_id == data.id){
expired_time = expired_time_Lists[i].expired_time;
break;
}
}
let prescriptionData = line_items[0].properties?JSON.parse(line_items[0].properties):{};
return `
Produkte
Betrag
Optionen
Datum: ${formatTime}
Bestellungsnummer: ${data.number}
${statusLangs[statusType]}
Zahlung gescheitert
${statusLangs[statusType]}
${data.originData.line_items.map((line_item,inx) =>{
let prescriptionData = line_item.properties?JSON.parse(line_item.properties):{};
return `
${line_item.product_title}
${line_item.options[0]?.name}: ${line_item.options[0]?.value}
${prescriptionData.is_glass?`
Glas: ${prescriptionData.prescription_type_title || '-'}
`:`
Glas: Nur Rahmen
`}
× ${line_item.quantity}
`
}
).join('')
}
Bewertung schreiben
Mehr Produkte anzeigen >
Gesamt
Status
${statusLangs[statusType]}
In den Warenkorb legen
Zahlung gescheitert
${statusLangs[statusType]}
Zurückkaufen
`; }()
}
${function() {
let productData={};
const isTryonList=data[0]||data[1];
let currentFrame={};
let currentImage={};
let frameSku=null;
if(isTryonList)
{
currentFrame=data[1]?.data.framelist?.find(frame=>frame.sku===item.variants[0].sku)||{sku:item.variants[0].sku};
currentImage=data[1]?.data.currentImage||{};
productData={...item};
}else{
productData={...data}
}
let rahmenbreite='';
productData.tags?.split(',')?.forEach(tag=>{
if(tag.includes('Rahmenbreite_'))
{
rahmenbreite=tag.replace('Rahmenbreite_','');
}
});
const force_image_size = "natural";
const product_hover_on = false;
const product_show_sale_label = true;
const product_save_type = "percent";
const badge1 = "";
const badge2 = "";
const badge3 = "";
const product_title_mobile_hide = true;
const product_title_style = "full";
const enable_collection_thumb_image = false;
const variantNames = [];
const thumbMaxNum = 4;
const suffix_id = null || '';
const url = productData.url;
const productId = productData.id;
const price = Number(productData.price);
const productAvailable = productData.available;
const productVariants = productData.variants || [];
const is_collection_page = null;
const type_is_glasses = null || false;
const images = productData.images || [];
const image = productData.image || {};
const imageWidth = image.width;
let imageHeight = image.height;
let image2 = null;
let imageHoverOn = false;
if (force_image_size !== 'natural') {
imageHeight = imageWidth * force_image_size;
}
let compareAtPrice = Number(productData.compare_at_price);
let offRatio = productData.off_ratio;
let discountMaxUrl = url;
const showFrom = productData.price_min != productData.price_max ? true : false;
for (let i = 0; i < productVariants.length; i++) {
const variant = productVariants[i];
if (variant.price == price && compareAtPrice < variant.compare_at_price) {
compareAtPrice = variant.compare_at_price;
offRatio = variant.off_ratio;
variant.available && (discountMaxUrl = variant.url);
}
}
const soldOutText = "Ausverkauft";
let soldOn = false;
let saleOn = false;
if (productAvailable) {
if (product_show_sale_label && price < compareAtPrice) {
saleOn = true;
}
} else {
soldOn = true;
}
const diffPrice = compareAtPrice - price;
const saveLabelContent = product_save_type == 'percent' ? (offRatio + '%') : `
`;
let saveText = "{off_ratio}";
saveText = saveText.replace('{off_ratio}', saveLabelContent);
const productTitle = productData.title;
const heading = "title" === 'subtitle' ? productData.brief : productTitle;
const variantValues = [];
const showVariants = [];
if (productData.need_variant_image && enable_collection_thumb_image && variantNames.length > 0) {
for (let i = 0; i < (productData.options || []).length; i++) {
const option = productData.options[i];
const optionName = option.name.toLowerCase();
if (variantNames.includes(optionName)) {
for (let j = 0; j < productVariants.length; j++) {
const variant = productVariants[j];
const value = variant.options[i].value;
if (!variantValues.includes(value)) {
variantValues.push(value);
showVariants.push(variant);
}
}
break;
}
}
}
return `
`;
}()}
${ Object.keys((data && data.login_setting) || {}) .map(type => ` `) .join("") }