Fehler beim Akzeptieren einer Freundschaftsanfrage

var saleDetails = { saleEnd: '', cartSummary: { item_count: 0, items_subtotal_price: 0, original_total_price: 0, requires_shipping: false, total_discount: 0, total_price: 0, }, cartMessage:"[#%] discount applied for our Fall Sale", cartDiscount_code: '', fixedDiscount: '', locale: 'de', offer: { you_save: "Sie sparen", buy: "Kaufen Sie", off: "Rabatt"}, items: [ { sku : "409", id: 39473230905430, price: 31999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" }, { sku : "411", id: 39331378135126, price: 15999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" },{ sku : "408", id: 39627652268118, price: 15999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" }, { sku : "704", id: 39556026761302, price: 29999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" }, { sku : "315", id: 40016903503958, price: 15999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" },{ sku : "316", id: 40016903536726, price: 15999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" }, { sku : "426", id: 47342076100953, price: 18999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" }, { sku : "427", id: 47342215299417, price: 19999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" },{ sku : "428", id: 47342215233881, price: 19999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" },{ sku : "419", id: 47342215266649, price: 19999, saleCopy: "25% Rabatt code CM2023 verwenden", saleCopyBi: "25% de réduction sur tous les cadres\nutilisez le code CM2023", copyColor: "", blockBg: "", bannerBlockBgColor: false, discountType: "fixed", valueOff: "percent-off", spendAmount: "", discountValue: "0", disclaimer: "", hideSticker: true, sticker: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_rabatt_4x_f125e90a-4d10-4695-96dc-43685cd5b4fc.png?v=1700811527", stickerBi: "\/\/www.nixplay.de\/cdn\/shop\/files\/25_de_reduction_4x_fea5e689-2ed4-4bc0-8e90-ee29723c30a4.png?v=1700821995", addDiscountCopy: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eCyber Monday Sale\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e25%\n \u003csmall\u003eRabatt auf alle Rahmen code CM2023 verwenden\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e", addDiscountCopyBi: "\u003ch2 class=\"font-bold max-w-max pb-4 pt-6 text-5xl z\" style=\"\n color: #000000;\n background-image: -webkit-linear-gradient(0deg, #393455 0%, #a84e81 100%);\n background-clip: text;\n -webkit-background-clip: text;\n text-fill-color: transparent;\n -webkit-text-fill-color: transparent;\n \"\u003eVente du Cyber Monday\u003c\/h2\u003e\n\u003cdiv class=\"font-bold pb-4\" style=\"display: flex; border-bottom: 1px solid black;\"\u003e\n \u003cdiv style=\"padding-right: 20px; \"\u003e\n \u003cp style=\"font-size: 2rem; margin: 0;\"\u003e\n Réduction de 25%\n \u003csmall\u003e sur tous les cadres utilisez le code CM2023\u003c\/small\u003e\n \u003c\/p\u003e\n \u003c\/div\u003e\n\u003c\/div\u003e" },] }; console.log(saleDetails) window.saleDetails = saleDetails; var saleFunctions = { getPrice: function (line, qtt) { var price = line.price; var quantity = qtt || 1 var valueOff = line.valueOff var values = String(line.discountValue).split(','); var totalPrice = 0 var unitPrice = 0 var difference = 0 switch (line.discountType) { case 'fixed': var discount_value = Number(values[0]); unitPrice = (valueOff === 'percent-off') ? price * (1 - discount_value) : price - (discount_value * 100); finalPrice = unitPrice * quantity; difference = price - unitPrice break; case '3plus': break; case '123plus': var discount_value; if(quantity == 1) { discount_value = Number(values[0]); } else if (quantity == 2) { discount_value = Number(values[1]); } else { discount_value = Number(values[2]); } unitPrice = (valueOff === 'percent-off') ? price * (1 - discount_value) : price - ((discount_value*100) / quantity); finalPrice = unitPrice * quantity; difference = price - unitPrice break; case '1235plus': break; case '12plus': var discount_value; if(quantity == 1) { discount_value = Number(values[0]); } else { discount_value = Number(values[1]); } unitPrice = (valueOff === 'percent-off') ? price * (1 - discount_value) : price - (discount_value * 100); finalPrice = unitPrice * quantity; difference = price - unitPrice break; case 'spend': var cartTriggers = String(line.spendAmount).split(','); var lastPositiveIndex = -1; cartTriggers.forEach((trigger, index) => { var triggerValue = Number(trigger) var cartValue = (Number(window.saleDetails.cartSummary.original_total_price || 0) + Number(price))/ 100 if(cartValue > triggerValue) { lastPositiveIndex = index } }); discount_value = lastPositiveIndex > -1 ? Number(values[lastPositiveIndex] || 0) : 0; unitPrice = (valueOff === 'percent-off') ? price * (1 - discount_value) : price - (discount_value * 100); finalPrice = unitPrice * quantity; difference = price - unitPrice break; case 'bogox': break; case 'bogo': break; default: console.log(`Sorry, we are out of`); } return { finalPrice: finalPrice, unitPrice: unitPrice, difference: difference } }, updateCartSummary: function(cart) { window.saleDetails.cartSummary = { item_count: cart.item_count, items_subtotal_price: cart.items_subtotal_price, original_total_price: cart.original_total_price, requires_shipping: cart.requires_shipping, total_discount: cart.total_discount, total_price: cart.total_price, } } } window.saleFunctions = saleFunctions;