let mxOdswiezGratis=function mxOdswiezGratis(basket){};(function appProduktGratisowy($){let position='products';let selector='';let sum_basket='sum_no_shipping';let product_border_color='#333333';let product_border_radius='0px';let product_name_font='14px';let product_info_background='rgba(51, 51, 51, 0.6)';let product_info_color='#ffffff';let product_info_font='15px';let product_info_align='left';let product_info_border_color='#333333';let product_info_border_radius='0px';let clicked_on_image='add';let clicked_on_name='add';let clicked_on_button='add';let arrows_background='rgb(255, 255, 255)';let arrows_color='rgb(51, 51, 51)';let arrows_font='14px';let arrows_border_color='#333333';let arrows_border_radius='0px';let line_color='#03d503';let line_end_color='#02b002';let line_background_color='#d3d3d3';let tag_background_color='#d3f4ca';let tag_font_color='#333333';let tag_off_background_color='#eeeeee';let tag_off_font_color='#333333';let tag_font='13px';let tag_padding='5px';let tag_border_radius_tl='0px';let tag_border_radius_tr='0px';let tag_border_radius_br='0px';let product_promo_font='14px';let product_description_font='14px';let shopId=960;let translations_array={"text_addToBasket":{"__default":"wybierz prezent","pl_PL":"Wybierz prezent"},"text_variant":{"__default":"Ten produkt otrzymujesz jako prezent","pl_PL":"Ten produkt otrzymujesz jako prezent"},"text_boxhead":{"__default":"Wybierz prezent do Twojego zam\u00f3wienia!","pl_PL":"Wybierz prezent do Twojego zam\u00f3wienia!"},"text_tag":{"__default":"xxx","pl_PL":"xxx"},"text_productExceed":{"__default":"W koszyku jest ju\u017c maksymalna liczba prezent\u00f3w. Usu\u0144 kt\u00f3ry\u015b z nich, aby zmieni\u0107 wyb\u00f3r.","pl_PL":"W koszyku jest ju\u017c maksymalna liczba prezent\u00f3w. Usu\u0144 kt\u00f3ry\u015b z nich, aby zmieni\u0107 wyb\u00f3r."},"text_productLowFreeLeft":{"__default":"Gratisy s\u0105 dost\u0119pne dla zam\u00f3wie\u0144 o warto\u015bci powy\u017cej yyy","pl_PL":"Gratisy s\u0105 dost\u0119pne dla zam\u00f3wie\u0144 o warto\u015bci powy\u017cej yyy"},"text_productLowPrice":{"__default":"Brakuje Ci jeszcze xxx, \u017ceby wybra\u0107 ten gratis.","pl_PL":"Brakuje Ci jeszcze xxx, \u017ceby wybra\u0107 ten gratis."},"text_productLowMaxPrice":{"__default":"Prezent dost\u0119pny dla produkt\u00f3w powy\u017cej yyy","pl_PL":"Prezent dost\u0119pny dla produkt\u00f3w powy\u017cej yyy"},"text_productAbovePrice":{"__default":"Prezent powy\u017cej xxx","pl_PL":"Prezent powy\u017cej xxx"},"text_blockBuying":{"__default":"Ten produkt jest dost\u0119pny tylko jako gratis do zam\u00f3wienia","pl_PL":"Ten produkt jest dost\u0119pny tylko jako gratis do zam\u00f3wienia"},"html_boxfooter":{"__default":"","pl_PL":""}};let freeProducts={"pl_PL":[{"productId":30877,"name":"GRATIS! LA ROCHE-POSAY Woda Termalna - 50ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1062":{"quantity":null,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":32744,"name":"GRATIS! Ksi\u0105\u017ceczka o piel\u0119gnacji sk\u00f3ry dziecka","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"1002":{"quantity":1,"price":0},"2896":{"quantity":1,"price":0},"2897":{"quantity":1,"price":0},"3129":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":34422,"name":"GRATIS! Torba pla\u017cowa VICHY","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"740":{"quantity":1,"price":null}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":34836,"name":"GRATIS! CLOCHEE Hydroaktywny Sorbet Do Twarzy - 50ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":false,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"34504":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":33579,"name":"ZA GROSZ! LIERAC SUNISSIME Emulsja Ochronna Do Twarzy SPF30 - 40ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"109":{"quantity":null,"price":149},"304":{"quantity":null,"price":149}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":37568,"name":"GRATIS! MINI Dr Irena Eris CLINIC WAY Dermokrem 3\u00b0 Na Noc (50+) - 25 ml + Pr\u00f3bka Kremu na dzie\u0144 - 1,5 ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1046":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":30486,"name":"GRATIS! BIODERMA Sensibio H2O P\u0142yn micelarny","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1043":{"quantity":null,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":38115,"name":"GRATIS! Prezent od Clochee","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1207":{"quantity":null,"price":119}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":39809,"name":"GRATIS! Vichy Neovadiol Prezent!","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"740":{"quantity":null,"price":249}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":39821,"name":" Za Grosz! NOBLE HEALTH Witaminy D3 + K2, 60 kapsu\u0142ek","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1289":{"quantity":null,"price":49}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":40358,"name":"Gratis! Puder Dr Irena Eris 10g","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1046":{"quantity":2,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":40359,"name":"GRATIS! Pharmaceris T Antybakteryjny \u017cel myj\u0105cy do twarzy - 80 ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"217":{"quantity":1,"price":0},"219":{"quantity":1,"price":0},"223":{"quantity":1,"price":0},"227":{"quantity":1,"price":0},"230":{"quantity":1,"price":0},"231":{"quantity":1,"price":0},"236":{"quantity":1,"price":0},"1382":{"quantity":1,"price":0},"1383":{"quantity":1,"price":0},"1384":{"quantity":1,"price":0},"34946":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":42140,"name":"Za grosz! OLAPLEX No. 4P Blonde Enhancer Szampon Neutralizuj\u0105cy Do W\u0142os\u00f3w Blond - 20 ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1065":{"quantity":null,"price":199}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":42191,"name":"GRATIS! LIERAC PREMIUM Przeciwzmarszczkowe Serum Regeneruj\u0105ce - 13 ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"42100":{"quantity":1,"price":0},"42102":{"quantity":1,"price":0},"42103":{"quantity":1,"price":0},"42104":{"quantity":1,"price":0},"42105":{"quantity":1,"price":0},"42106":{"quantity":1,"price":0},"42107":{"quantity":1,"price":0},"42108":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":42735,"name":"GRATIS! SVR Topialyse Huile Micellaire - 55ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"59":{"quantity":null,"price":119}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":44629,"name":"NUXE ZESTAW GRATIS - Multifunkcyjny Olejek Huile Prodigieuse - 10ml + Super Serum[10] Koncentrat Anti-Aging - 5ml + Be\u017cowa Kosmetyczka","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"44":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45047,"name":"GRATIS! PHARMACERIS H Micelarny Szampon Koj\u0105co-Nawil\u017caj\u0105cy Dla Sk\u00f3ry Wra\u017cliwej - 100ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"206":{"quantity":1,"price":0},"215":{"quantity":1,"price":0},"222":{"quantity":1,"price":0},"235":{"quantity":1,"price":0},"240":{"quantity":1,"price":0},"1089":{"quantity":1,"price":0},"1371":{"quantity":1,"price":0},"1372":{"quantity":1,"price":0},"1373":{"quantity":1,"price":0},"1374":{"quantity":1,"price":0},"1608":{"quantity":1,"price":0},"1609":{"quantity":1,"price":0},"1610":{"quantity":1,"price":0},"1612":{"quantity":1,"price":0},"2390":{"quantity":1,"price":0},"44827":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45256,"name":"LA ROCHE-POSAY GRATIS Mikro-Peeling Do Twarzy i Cia\u0142a Dla Sk\u00f3ry Ze Sk\u0142onno\u015bci\u0105 Do Tr\u0105dziku - 50ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1062":{"quantity":1,"price":159}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45347,"name":"GRATIS! Dr Irena Eris Clinic Way Dermokapsu\u0142ki - 5 kapsu\u0142ek","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1046":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45635,"name":"ZA GROSZ! OLAPLEX No.6 Bond Smoother Krem Odbudowuj\u0105cy i Wyg\u0142adzaj\u0105cy W\u0142osy - 20ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1065":{"quantity":1,"price":199}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45989,"name":"GRATIS! NEUTRADERM Baby \u0141agodna Woda Myj\u0105ca 3 w 1 - 200ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"104":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45987,"name":"GRATIS! NEUTRADERM Replid Olejek Do Mycia Cia\u0142a - 1L","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"2886":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45988,"name":"GRATIS! NEUTRADERM \u0141agodz\u0105cy Micelarny \u017bel Pod Prysznic - 200ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"2880":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45994,"name":"GRATIS! URIAGE Zestaw Do Sk\u00f3ry Tr\u0105dzikowej i z Niedoskona\u0142o\u015bciami Kubek Uriage + Hyseac 3-Regul Krem Do Sk\u00f3ry T\u0142ustej i Problematycznej - 15ml + Hyseac Oczyszczaj\u0105cy \u017bel Do Twarzy - 50 ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1068":{"quantity":1,"price":199}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45995,"name":"GRATIS! URIAGE Zestaw Do Sk\u00f3ry Tr\u0105dzikowej i z Niedoskona\u0142o\u015bciami Hyseac \u017bel Oczyszczaj\u0105cy Do Twarzy - 8ml + Serum Do Twarzy Redukuj\u0105ce Niedoskona\u0142o\u015bci - 5ml + Kompleksowy Krem Do Cery T\u0142ustej z Niedoskona\u0142o\u015bciami - 3ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1068":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45996,"name":"GRATIS! URGO DERMOESTETIC Zestaw Do Piel\u0119gnacji Opaska Kosmetyczna + Mini Lusterko","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1219":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":29097,"name":"GRATIS! PHARMACERIS T Sebo-Almond P\u0142yn Oczyszczaj\u0105cy Bakteriostatyczny - 80 ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"217":{"quantity":1,"price":0},"219":{"quantity":1,"price":0},"223":{"quantity":1,"price":0},"227":{"quantity":1,"price":0},"230":{"quantity":1,"price":0},"231":{"quantity":1,"price":0},"236":{"quantity":1,"price":0},"1382":{"quantity":1,"price":0},"1384":{"quantity":1,"price":0},"1385":{"quantity":1,"price":0},"1604":{"quantity":1,"price":0},"1605":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45258,"name":"GRATIS ! LA ROCHE-POSAY LIPIKAR Ultradelikatny, Bezzapachowy Krem Myj\u0105cy - 100ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1062":{"quantity":1,"price":299}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":48820,"name":"GRATIS! SVR Ampoule Hydra B3 10ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"59":{"quantity":1,"price":189}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":49528,"name":"GRATIS! LIERAC Torba Pla\u017cowa","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"46019":{"quantity":1,"price":0},"46020":{"quantity":1,"price":0},"46021":{"quantity":1,"price":0},"46022":{"quantity":1,"price":0},"46023":{"quantity":1,"price":0},"46024":{"quantity":1,"price":0},"46025":{"quantity":1,"price":0},"46026":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45261,"name":"GRATIS! VICHY Krem Do Twarzy Na Noc - 15ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"740":{"quantity":null,"price":249}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":44630,"name":"NUXE ZESTAW GRATIS - Prodigieux Floral Perfumowany \u017bel Pod Prysznic - 100ml + Huile Prodigieuse Florale Multifunkcyjny Suchy Olejek - 10ml + R\u00f3\u017cowa Kosmetyczka","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"44":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":51602,"name":"GRATIS! ZESTAW LA ROCHE-POSAY ANTHELIOS UVMUNE400 SPF50+ 15ml + Okr\u0105g\u0142y R\u0119cznik Pla\u017cowy","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1062":{"quantity":1,"price":299}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":51648,"name":"GRATIS! PHYTO SOFTNESS Delikatny Szampon Do W\u0142os\u00f3w - 100ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"142":{"quantity":1,"price":0},"7526":{"quantity":1,"price":0},"31108":{"quantity":1,"price":0},"31111":{"quantity":1,"price":0},"31112":{"quantity":1,"price":0},"35779":{"quantity":1,"price":0},"39403":{"quantity":1,"price":0},"39404":{"quantity":1,"price":0},"39414":{"quantity":1,"price":0},"39416":{"quantity":1,"price":0},"40418":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":51603,"name":"GRATIS! VICHY Jutowa Torba Pla\u017cowa","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"740":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":51601,"name":" GRATIS! CERAVE Nawil\u017caj\u0105cy Olejek do Mycia \u2013 15ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":false,"highestPrice":false,"price":0,"categories":{},"producers":{"1045":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53681,"name":"GRATIS! Mustela","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"80":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53221,"name":"GRATIS! VICHY NORMADERM Phytosolution \u017bel G\u0142\u0119boko Oczyszczaj\u0105cy - 50ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"740":{"quantity":1,"price":149}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":52503,"name":"","image":"","price":0,"description":"","settings":{"blockBuying":false,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":false,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":47890,"name":"ZA GROSZ! NOBLE HEALTH Her CompleVitum suplement diety dla kobiet - 60 kapsu\u0142ek","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1289":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53805,"name":"GRATIS! ISDIN","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1059":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53803,"name":"GRATIS! VICHY kosmetyczka","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"740":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53176,"name":"GRATIS! LA ROCHE-POSAY EFFACLAR Woda Micelarna - 50ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1062":{"quantity":null,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":54353,"name":"GRATIS! URGO DERMOESTETIC Opaska Kosmetyczna","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":false,"highestPrice":false,"price":0,"categories":{},"producers":{"1219":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":54431,"name":"ZA GROSZ! NEUTRADERM Baby \u0141agodny \u017bel Myj\u0105cy 3 w 1 - 400ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"2882":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":1419,"name":"DR IRENA ERIS CLINIC WAY Dermo-Maska Nawil\u017caj\u0105co-Liftinguj\u0105ca - 2 x 6 ml","image":"","price":0,"description":"","settings":{"blockBuying":false,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1046":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53820,"name":"GRATIS! LA ROCHE-POSAY Lipikar Baume AP+M Balsam 15ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":false,"highestPrice":false,"price":0,"categories":{},"producers":{"1062":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53177,"name":"GRATIS! CERAVE Nawil\u017caj\u0105cy Balsam Do Sk\u00f3ry Suchej - 50ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1045":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45262,"name":"GRATIS! VICHY Przeciwzmarszczkowy Krem Liftactiv Collagen Na Noc - 15ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"740":{"quantity":1,"price":249}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":55573,"name":"GRATIS! AXIS-Y Witalizuj\u0105ca Maska Do Twarzy W P\u0142achcie 61% Mugwort Green Vital Energy Complex","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1892":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45263,"name":"GRATIS! VICHY Liftactiv Krem Przeciwzmarszczkowy Na Dzie\u0144 - 15ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"740":{"quantity":1,"price":199}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53821,"name":"GRATIS! LA ROCHE-POSAY Lipikar Baume Light AP+M Balsam 15ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1062":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53222,"name":"GRATIS! LA ROCHE-POSAY Toleriane \u0141agodna Emulsja Oczyszczaj\u0105ca Dla Sk\u00f3ry Wra\u017cliwej - 50 ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1062":{"quantity":1,"price":199}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":56341,"name":"Za grosz! VICHY Neovadiol Peri-Menopause Krem Na Dzie\u0144 - 15ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"740":{"quantity":1,"price":199}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":3151,"name":"GRATIS! URGO DERMOESTETIC Reti-Renewal Odbudowuj\u0105co - Odm\u0142adzaj\u0105cy Krem Do Sk\u00f3ry Wok\u00f3\u0142 Oczu - 15ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1219":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45264,"name":"ZA GROSZ! LA ROCHE-POSAY \u017bel Mikro-Peeling Do Sk\u00f3ry T\u0142ustej - 15ml","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{"1062":{"quantity":1,"price":199}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":59041,"name":"Gratis! Cetaphil Delikatny \u017bel Oczyszczaj\u0105cy 100g","image":"","price":0,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":0,"categories":{},"producers":{},"products":{"58733":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":51834,"name":"GRATIS! Bidon podr\u00f3\u017cny od Pharmaceris","image":"","price":99,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":99,"categories":{},"producers":{},"products":{"212":{"quantity":1,"price":0},"213":{"quantity":1,"price":0},"216":{"quantity":1,"price":0},"1621":{"quantity":1,"price":0},"1622":{"quantity":1,"price":0},"1623":{"quantity":1,"price":0},"1624":{"quantity":1,"price":0},"1626":{"quantity":1,"price":0},"2441":{"quantity":1,"price":0},"2512":{"quantity":1,"price":0},"3225":{"quantity":1,"price":0},"45654":{"quantity":1,"price":0},"47564":{"quantity":1,"price":0},"47565":{"quantity":1,"price":0}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53896,"name":"GRATIS! DERMEDIC Hydrain3 Woda Micelarna - 100ml","image":"","price":99,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":99,"categories":{},"producers":{"110":{"quantity":null,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53802,"name":"GRATIS! VICHY Torba shopper","image":"","price":99,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":99,"categories":{},"producers":{"740":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53696,"name":"ZA GROSZ! NOBLE HEALTH Misie Na Zdrow\u0105 Sk\u00f3r\u0119 Koenzym Q10 Suplement Diety \u017belki 300g","image":"","price":99,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":99,"categories":{},"producers":{"1289":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":1900,"name":"GRATIS! URIAGE XEMOSE Krem Do Sk\u00f3ry Bardzo Suchej - 50 ml","image":"","price":99,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":99,"categories":{},"producers":{"1068":{"quantity":1,"price":99}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":49556,"name":"GRATIS! SVR Torba Pla\u017cowa","image":"","price":109,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":109,"categories":{},"producers":{},"products":{"1729":{"quantity":1,"price":null},"1730":{"quantity":1,"price":null},"1731":{"quantity":1,"price":null},"1732":{"quantity":1,"price":null},"1734":{"quantity":1,"price":null},"1735":{"quantity":1,"price":null},"1736":{"quantity":1,"price":null},"1740":{"quantity":1,"price":null},"1741":{"quantity":1,"price":null},"1742":{"quantity":1,"price":null},"1901":{"quantity":1,"price":null},"2515":{"quantity":1,"price":null},"2516":{"quantity":1,"price":null},"2518":{"quantity":1,"price":null},"2519":{"quantity":1,"price":null},"2520":{"quantity":1,"price":null},"2521":{"quantity":1,"price":null},"3247":{"quantity":1,"price":null},"3248":{"quantity":1,"price":null},"47891":{"quantity":1,"price":null},"47892":{"quantity":1,"price":null},"47893":{"quantity":1,"price":null},"47894":{"quantity":1,"price":null}},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53175,"name":"GRATIS! VICHY DERCOS Szampon Przeciw\u0142upie\u017cowy - 50ml","image":"","price":149,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":149,"categories":{},"producers":{"740":{"quantity":1,"price":149}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45636,"name":"ZA GROSZ! OLAPLEX No. 8 Bond Intense Moisture Mask Intensywna Maska Nawil\u017caj\u0105ca W\u0142osy - 20ml","image":"","price":199,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":199,"categories":{},"producers":{"1065":{"quantity":1,"price":0}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":53895,"name":"GRATIS! MINI Dr Irena Eris CLINIC WAY Dermokrem 2\u00b0 Na Noc 25 ml + Pr\u00f3bka Kremu na dzie\u0144 - 1,5 ml","image":"","price":199,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":199,"categories":{},"producers":{"1046":{"quantity":1,"price":199}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":54163,"name":"ZA GROSZ! CLOCHEE Ceramidowy Krem Na Dzie\u0144 - 15ml","image":"","price":199,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":199,"categories":{},"producers":{"1207":{"quantity":1,"price":199}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}},{"productId":45260,"name":"VICHY GRATIS Krem Uj\u0119drniaj\u0105cy Do Twarzy Na Noc - 15ml","image":"","price":249,"description":"","settings":{"blockBuying":true,"categoriesChildrens":false,"sumCategories":false,"sumProducers":false,"showHigherPrices":true,"needAllSettings":true,"skipCountLimit":true,"highestPrice":false,"price":249,"categories":{},"producers":{"740":{"quantity":0,"price":249}},"products":{},"usersGroups":{"0":"Wszystkie grupy klient\u00f3w"}}}]};let freeProductsIds={"pl_PL":[30877,32744,34422,34836,33579,37568,30486,38115,39809,39821,40358,40359,42140,42191,42735,44629,45047,45256,45347,45635,45989,45987,45988,45994,45995,45996,29097,45258,48820,49528,45261,44630,51602,51648,51603,51601,53681,53221,52503,47890,53805,53803,53176,54353,54431,1419,53820,53177,45262,55573,45263,53821,53222,56341,3151,45264,59041,51834,53896,53802,53696,1900,49556,53175,45636,53895,54163,45260]};let allFreeProductsIds={"pl_PL":[30877,32744,34422,34836,33579,37568,30486,38115,39809,39821,40358,40359,42140,42191,42735,44629,45047,45256,45347,45635,45989,45987,45988,45994,45995,45996,29097,45258,48820,49528,45261,44630,51602,51648,51603,51601,53681,53221,52503,47890,53805,53803,53176,54353,54431,1419,53820,53177,45262,55573,45263,53821,53222,56341,3151,45264,59041,51834,53896,53802,53696,1900,49556,53175,45636,53895,54163,45260]};let freeProductsCounts={"0":"1"};let optionGroupId=5;let optionId=8;let delayedPreloader=1;let forceSingleDownload=0;let template=0;let container_margin_bottom=10;let product_padding=0;let product_border_width=0;let product_image_width=200;let product_image_height=200;let product_image_margin=10;let product_name_margin=20;let product_info_margin=20;let product_info_letter_spacing=2;let product_info_border_width=0;let product_width=200;let product_min_margin=10;let product_name_height=40;let product_button_margin=20;let arrows_hover_visible=0;let arrows_width=40;let arrows_height=40;let arrows_margin=-40;let container_margin=0;let arrows_border_width=0;let line_height=7;let line_margin=10;let tag_triangle_height=7;let product_margin=10;let product_promo_margin=10;let product_description_margin=10;freeProducts=freeProducts[Shop.lang.name]||[];freeProductsIds=freeProductsIds[Shop.lang.name]||[];if(location.href.indexOf('mx_debug')!=-1){let types=['blockBuying','categoriesChildrens','sumCategories','sumProducers','showHigherPrices','needAllSettings','skipCountLimit','highestPrice'];let container=$('
').css({position:'absolute',top:'80px',left:'50%',transform:'translate(-50%, 0)',background:'white',border:'1px solid #000',padding:'20px','border-radius':'10px','font-family':'Open Sans','text-align':'center','z-index':'999',});$('
X
').css({position:'absolute',top:0,right:0,width:'30px',height:'30px','line-height':'28px','font-size':'20px',margin:'5px',border:'1px solid #000','border-radius':'30px',cursor:'pointer',}).click(function(){container.remove();}).appendTo(container);let table=container.append('
').find('table');let header=table.append('').find('tr');for(let item of['productId','price','flags','categories','producers','products','usersGroups']){$(`${item}`).css({padding:'5px 10px'}).appendTo(header);} for(let item of freeProducts){let row=$('');let flags=0;for(let type of types){flags<<=1;flags|=item.settings[type];} $(`${item.productId}`).css({padding:'5px 10px'}).appendTo(row);$(`${item.settings.price}`).css({padding:'5px 10px'}).appendTo(row);$(`${flags.toString(2).padStart(types.length,0)}`).css({padding:'5px 10px'}).appendTo(row);$(`${JSON.stringify(item.settings.categories).slice(1, -1).replaceAll('},','}
')}`).css({padding:'5px 10px','text-align':'left'}).appendTo(row);$(`${JSON.stringify(item.settings.producers).slice(1, -1).replaceAll('},','}
')}`).css({padding:'5px 10px','text-align':'left'}).appendTo(row);$(`${JSON.stringify(item.settings.products).slice(1, -1).replaceAll('},','}
')}`).css({padding:'5px 10px','text-align':'left'}).appendTo(row);$(`${JSON.stringify(item.settings.usersGroups).slice(1, -1).replaceAll('},','}
')}`).css({padding:'5px 10px','text-align':'left'}).appendTo(row);row.appendTo(table);} container.append(`
Flags: ${types.join(', ')}
`);container.appendTo('body');} let escapeHtml=function escapeHtml(unsafe){return unsafe.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");};let getTranslation=function getTranslation(var_name,current_lang=Shop.lang.name){if(!(current_lang in translations_array[var_name])){translation=translations_array[var_name]['__default'];}else{translation=translations_array[var_name][current_lang];} return translation;};let text_addToBasket=escapeHtml(getTranslation('text_addToBasket'));let text_variant=escapeHtml(getTranslation('text_variant'));let text_boxhead=escapeHtml(getTranslation('text_boxhead'));let text_tag=escapeHtml(getTranslation('text_tag'));let text_productExceed=escapeHtml(getTranslation('text_productExceed'));let text_productLowFreeLeft=escapeHtml(getTranslation('text_productLowFreeLeft'));let text_productLowPrice=escapeHtml(getTranslation('text_productLowPrice'));let text_productLowMaxPrice=escapeHtml(getTranslation('text_productLowMaxPrice'));let text_productAbovePrice=escapeHtml(getTranslation('text_productAbovePrice'));let text_blockBuying=escapeHtml(getTranslation('text_blockBuying'));let html_boxfooter=getTranslation('html_boxfooter');let current_curr=Shop.values.currency?Shop.values.currency:"PLN";let current_lang=Shop.lang.name?Shop.lang.name:"pl_PL";let priceFormater=new Intl.NumberFormat(current_lang.split('_').join('-'),{style:'currency',currency:current_curr});let priceFormat=function priceFormat(price){return priceFormater.format(price);};if(template==0){$('head').append('');$('head').append('');} let APIloader=function APIloader(){if(!window.frontAPI||template==0&&typeof jQuery().owlCarousel!=='function'){setTimeout(APIloader,0);} else{let userGroupId=null;let sum=0;let basketPromo=0;let maxPrice=0;let producers={};let categories={};let expresionProducts={};let htmlToUpdate={};let freeProductsLeft=0;let initialFreeProductsLeft=0;let addedFreeProductsSkippedCountLimit=[];let container=$('
');let avaibleIds=[];let productDatas={};let isPreloader=false;let waitingForIds=true;let waitingForFrontApi=true;let waitingForSoobasket=false;if($('#box_basketlist').length>0){if(typeof GlobalSoolutionSoobasket!='undefined'){waitingForSoobasket=true;}} let generatePreloader=function generatePreloader(){if(container==null)return false;isPreloader=true;if(position=='container'){container.appendTo(selector);}else{if(typeof GlobalSoolutionSoobasket!='undefined'&&$('.el-table .el-table__row').length!=0){if(position=='products'){$('
').insertAfter($('.el-table').parent().next());$('
').insertAfter('.mx_free_products_container');} if(position=='price'){$('
').insertAfter('.el-form + .fixed-summary');$('
').appendTo('.mx_free_products_container');} if(position=='buttons'){$('
').insertAfter($('.el-table').parent().next().next());$('
').appendTo('.mx_free_products_container');}} else{if(position=='products'){$('
').insertAfter('#box_basketlist .productlist');} if(position=='price'){$('
').insertBefore('#box_basketlist #cart-options .buttons');} if(position=='buttons'){$('
').insertAfter('#box_basketlist');}} container.appendTo('.mx_free_products_container');} if(text_boxhead!=''){if(typeof GlobalSoolutionSoobasket!='undefined'&&$('.el-table .el-table__row').length!=0){$('

'+text_boxhead+'

').insertBefore(container);} else{$('
'+text_boxhead+'
').insertBefore(container);}} if(html_boxfooter!=''){$('').append($(``).text()).insertAfter(container);} container.css({'height':'250px','display':'flex','align-items':'center','justify-content':'center'});container.append('');};let generateHtml=function generateHtml(){if(waitingForFrontApi||waitingForSoobasket)return;if(!isPreloader)generatePreloader();let isAdding=false;let prevWidth=0;if(container.find('.line_filler').length>0)prevWidth=container.find('.line_filler').get(0).offsetWidth;let tempElement=$('
').insertBefore(container);container.remove();container=$('
').insertAfter(tempElement);tempElement.remove();if(template==0){container.addClass('template_slider owl-carousel');for(let freeProduct of freeProducts){if(!avaibleIds.includes(freeProduct.productId))continue;let product=productDatas[freeProduct.productId];let name=freeProduct.name!=''?freeProduct.name:product.name;let image=freeProduct.image!=''?freeProduct.image:'/environment/cache/images/300_300_productGfx_'+(product.main_image_filename?product.main_image_filename:'__overlay.jpg');let description=freeProduct.description!=''?freeProduct.description:product.shortDescription;let exceedSkipCountLimit=freeProduct.settings.skipCountLimit&&addedFreeProductsSkippedCountLimit.includes(freeProduct.productId);let exceedCountLimit=!freeProduct.settings.skipCountLimit&&freeProductsLeft<=0;let notEnoughMaxPrice=freeProduct.settings.highestPrice&&maxPrice`);let mx_image=$(`
`).appendTo(productHtml);let mx_image_inner=$(``);if(clicked_on_image=='url'){mx_image_inner=$(``);} else if(clicked_on_image=='add'){mx_image_inner.addClass('mx_pointer');elementsAddingToBasket.push(mx_image_inner);} mx_image_inner.appendTo(mx_image);mx_image_inner.append(`${escapeHtml(name)}`);let mx_name=$(`
`).appendTo(productHtml);let mx_name_inner=$(``);if(clicked_on_name=='url'){mx_name_inner=$(``);} else if(clicked_on_name=='add'){mx_name_inner.addClass('mx_pointer');elementsAddingToBasket.push(mx_name_inner);} mx_name_inner.appendTo(mx_name);mx_name_inner.append(escapeHtml(name));let mx_button=$(`
`).appendTo(productHtml);let mx_button_inner=$(``);if(clicked_on_button=='url'){mx_button_inner=$(``);} else if(clicked_on_button=='add'){mx_button_inner.addClass('mx_pointer');elementsAddingToBasket.push(mx_button_inner);} mx_button_inner.appendTo(mx_button);mx_button_inner.append(text_addToBasket);mx_button.append(``);if(notEnoughSum||notEnoughMaxPrice){productHtml.addClass('is_off');} if(exceedSkipCountLimit||exceedCountLimit||notEnoughSum||notEnoughMaxPrice){mx_button.addClass('is_off');mx_button_inner.removeClass('btn-red');} for(let element of elementsAddingToBasket){element.on('click.add',function(){if(exceedSkipCountLimit||exceedCountLimit||notEnoughSum||notEnoughMaxPrice)return;if(isAdding)return;isAdding=true;let options={};options[optionId]=true;let response=frontAPI.addToBasket({data:{product_id:freeProduct.productId,options:options}});if(response.added.length==0){console.error('appProduktGratisowy',response);alert('Przepraszamy, wystąpił problem przy dodawaniu prezentu do koszyka. Prosimy o wpisanie nazwy prezentu w uwagach do zamówienia.');}else{addedFreeProducts=[];if(localStorage.mx_app_produkt_gratisowy){addedFreeProducts=JSON.parse(localStorage.mx_app_produkt_gratisowy);} addedFreeProducts.push(response.added[0].id);localStorage.mx_app_produkt_gratisowy=JSON.stringify(addedFreeProducts);location.replace(location.href);}});} if(exceedSkipCountLimit){if(text_productExceed!=''){productHtml.append('
'+text_productExceed+'
');}} else if(exceedCountLimit){if(initialFreeProductsLeft==0){if(freeProduct.settings.price!=0){if(text_productLowPrice!=''){productHtml.append('
'+text_productLowPrice.replace('xxx',priceFormat(freeProduct.settings.price-sum)).replace('yyy',priceFormat(freeProduct.settings.price))+'
');}}else{let temp=Object.keys(freeProductsCounts)[Math.min(1,Object.keys(freeProductsCounts).length)];productHtml.append('
'+text_productLowFreeLeft.replace('xxx',priceFormat(temp-sum)).replace('yyy',priceFormat(temp))+'
');}}else{if(text_productExceed!=''){productHtml.append('
'+text_productExceed+'
');}}} else if(notEnoughMaxPrice){if(text_productLowPrice!=''){productHtml.append('
'+text_productLowMaxPrice.replace('xxx',priceFormat(freeProduct.settings.price-maxPrice)).replace('yyy',priceFormat(freeProduct.settings.price))+'
');}} else if(notEnoughSum){if(text_productLowPrice!=''){productHtml.append('
'+text_productLowPrice.replace('xxx',priceFormat(freeProduct.settings.price-sum)).replace('yyy',priceFormat(freeProduct.settings.price))+'
');}} container.append(productHtml);} container.on('refreshed.owl.carousel',function(e){if(e.relatedTarget.$stage.width()','',],responsiveBaseElement:'.mx_free_products .owl-stage-outer',responsive:responsive,});let drawLine=function drawLine(){let line=$('
');let width=0;let afterTag=0;let step=0;for(let freeProduct of freeProducts){if(!avaibleIds.includes(freeProduct.productId))continue;let price=freeProduct.settings.price;if(stepprice){width=-left;} if(sum>step){if(sum<=price){width=-width+(left+width)*(sum-step)/(price-step);}else{afterTag=-width+box.offsetWidth*(sum-price)/(price-step);}} if(price<=sum){line.append('
'+text_tag.replace('xxx',priceFormat(price))+'
');}else{line.append('
'+text_tag.replace('xxx',priceFormat(price))+'
');} step=price;}} if(sum>step){width=afterTag;} line.prepend('
');setTimeout(function(){line.find('.line_filler').css('width',width+'px');},1);if(step!=0){container.find('.owl-stage .line').remove();line.appendTo(container.find('.owl-stage'));let tagHeight=line.find('.line_tag').get(0).scrollHeight;line.css('top',tagHeight-line.height());line.find('.line_tag').css('top',-(tagHeight-line.height()));container.find('.owl-stage').css('padding-top',tagHeight+line_margin*1+'px');}else{container.find('.owl-stage').css('padding-top',0);}};setTimeout(drawLine,1);} if(template==1){container.addClass('template_list');for(let freeProduct of freeProducts){if(!avaibleIds.includes(freeProduct.productId))continue;let product=productDatas[freeProduct.productId];let name=freeProduct.name!=''?freeProduct.name:product.name;let image=freeProduct.image!=''?freeProduct.image:'/environment/cache/images/300_300_productGfx_'+(product.main_image_filename?product.main_image_filename:'__overlay.jpg');let description=freeProduct.description!=''?freeProduct.description:product.shortDescription;let exceedSkipCountLimit=freeProduct.settings.skipCountLimit&&addedFreeProductsSkippedCountLimit.includes(freeProduct.productId);let exceedCountLimit=!freeProduct.settings.skipCountLimit&&freeProductsLeft<=0;let notEnoughMaxPrice=freeProduct.settings.highestPrice&&maxPrice`);let mx_image=$(`
`).appendTo(productHtml);let mx_image_inner=$(``);if(clicked_on_image=='url'){mx_image_inner=$(``);} else if(clicked_on_image=='add'){mx_image_inner.addClass('mx_pointer');elementsAddingToBasket.push(mx_image_inner);} mx_image_inner.appendTo(mx_image);mx_image_inner.append(`${escapeHtml(name)}`);let mx_info=$(`
`).appendTo(productHtml);if(freeProduct.settings.price>0&&text_productAbovePrice!=''){let mx_promo=$(`
`).appendTo(mx_info);mx_promo.append(text_productAbovePrice.replace('xxx',priceFormat(freeProduct.settings.price)));} let mx_name=$(`
`).appendTo(mx_info);let mx_name_inner=$(``);if(clicked_on_name=='url'){mx_name_inner=$(``);} else if(clicked_on_name=='add'){mx_name_inner.addClass('mx_pointer');elementsAddingToBasket.push(mx_name_inner);} mx_name_inner.appendTo(mx_name);mx_name_inner.append(escapeHtml(name));let mx_description=$(`
`).appendTo(mx_info);mx_description.append(description);let mx_button=$(`
`).appendTo(mx_info);let mx_button_inner=$(``);if(clicked_on_button=='url'){mx_button_inner=$(``);} else if(clicked_on_button=='add'){mx_button_inner.addClass('mx_pointer');elementsAddingToBasket.push(mx_button_inner);} mx_button_inner.appendTo(mx_button);mx_button_inner.append(text_addToBasket);mx_button.append(``);if(notEnoughSum||notEnoughMaxPrice){productHtml.addClass('is_off');} if(exceedSkipCountLimit||exceedCountLimit||notEnoughSum||notEnoughMaxPrice){mx_button.addClass('is_off');mx_button_inner.removeClass('btn-red');} for(let element of elementsAddingToBasket){element.on('click.add',function(){if(exceedSkipCountLimit||exceedCountLimit||notEnoughSum||notEnoughMaxPrice)return;if(isAdding)return;isAdding=true;let options={};options[optionId]=true;let response=frontAPI.addToBasket({data:{product_id:freeProduct.productId,options:options}});if(response.added.length==0){console.error('appProduktGratisowy',response);alert('Przepraszamy, wystąpił problem przy dodawaniu prezentu do koszyka. Prosimy o wpisanie nazwy prezentu w uwagach do zamówienia.');}else{addedFreeProducts=[];if(localStorage.mx_app_produkt_gratisowy){addedFreeProducts=JSON.parse(localStorage.mx_app_produkt_gratisowy);} addedFreeProducts.push(response.added[0].id);localStorage.mx_app_produkt_gratisowy=JSON.stringify(addedFreeProducts);location.replace(location.href);}});} if(exceedSkipCountLimit){if(text_productExceed!=''){productHtml.append('
'+text_productExceed+'
');}} else if(exceedCountLimit){if(initialFreeProductsLeft==0){if(freeProduct.settings.price!=0){if(text_productLowPrice!=''){productHtml.append('
'+text_productLowPrice.replace('xxx',priceFormat(freeProduct.settings.price-sum)).replace('yyy',priceFormat(freeProduct.settings.price))+'
');}}else{let temp=Object.keys(freeProductsCounts)[Math.min(1,Object.keys(freeProductsCounts).length)];productHtml.append('
'+text_productLowFreeLeft.replace('xxx',priceFormat(temp-sum)).replace('yyy',priceFormat(temp))+'
');}}else{if(text_productExceed!=''){productHtml.append('
'+text_productExceed+'
');}}} else if(notEnoughMaxPrice){if(text_productLowPrice!=''){productHtml.append('
'+text_productLowMaxPrice.replace('xxx',priceFormat(freeProduct.settings.price-maxPrice)).replace('yyy',priceFormat(freeProduct.settings.price))+'
');}} else if(notEnoughSum){if(text_productLowPrice!=''){productHtml.append('
'+text_productLowPrice.replace('xxx',priceFormat(freeProduct.settings.price-sum)).replace('yyy',priceFormat(freeProduct.settings.price))+'
');}} container.append(productHtml);}}};let selectProducts=function selectProducts(){avaibleIds=[];let downloadIds=[];for(let freeProduct of freeProducts){let isProducer=false,isCategory=false,isExpresionProduct=false,isPrice=false,isUserGroup=false;let counter=0;let adder=0;if(Object.keys(freeProduct.settings.producers).length>0){for(let producerId in freeProduct.settings.producers){if(typeof producers[producerId]!='undefined'){counter+=producers[producerId].quantity;adder+=producers[producerId].price;if(freeProduct.settings.producers[producerId].quantity<=producers[producerId].quantity&&freeProduct.settings.producers[producerId].price<=producers[producerId].price){isProducer=true;break;}}} if(!isProducer&&freeProduct.settings.sumProducers){for(let producerId in freeProduct.settings.producers){if(freeProduct.settings.producers[producerId].quantity<=counter&&freeProduct.settings.producers[producerId].price<=adder){isProducer=true;break;}}}}else{isProducer=true;} counter=0;adder=0;if(Object.keys(freeProduct.settings.categories).length>0){for(let cateroryId in freeProduct.settings.categories){if(typeof categories[cateroryId]!='undefined'){let countChildrens=0;let sumChildrens=0;if(freeProduct.settings.categoriesChildrens){countChildrens+=categories[cateroryId].quantity;sumChildrens+=categories[cateroryId].price;}else{countChildrens+=categories[cateroryId].quantity;sumChildrens+=categories[cateroryId].price;} counter+=countChildrens;adder+=sumChildrens;if(freeProduct.settings.categories[cateroryId].quantity<=countChildrens&&freeProduct.settings.categories[cateroryId].price<=sumChildrens){isCategory=true;break;}}} if(!isCategory&&freeProduct.settings.sumCategories){for(let cateroryId in freeProduct.settings.categories){if(freeProduct.settings.categories[cateroryId].quantity<=counter&&freeProduct.settings.categories[cateroryId].price<=adder){isCategory=true;break;}}}}else{isCategory=true;} if(Object.keys(freeProduct.settings.products).length>0){for(let productId in freeProduct.settings.products){if(typeof expresionProducts[productId]!='undefined'){if(freeProduct.settings.products[productId].quantity<=expresionProducts[productId].quantity&&freeProduct.settings.products[productId].price<=expresionProducts[productId].price){isExpresionProduct=true;break;}}}}else{isExpresionProduct=true;} if(freeProduct.settings.highestPrice){if(freeProduct.settings.price<=maxPrice){isPrice=true;}}else{if(freeProduct.settings.price<=sum){isPrice=true;}} if(!(0 in freeProduct.settings.usersGroups)){if(userGroupId in freeProduct.settings.usersGroups){isUserGroup=true;}}else{if(!(userGroupId in freeProduct.settings.usersGroups)){isUserGroup=true;}} if(freeProduct.settings.needAllSettings){if(!isProducer||!isCategory||!isExpresionProduct||!isUserGroup){continue;} if(!isPrice&&!freeProduct.settings.showHigherPrices){continue;}}else{if((!isUserGroup||0 in freeProduct.settings.usersGroups&&Object.keys(freeProduct.settings.usersGroups).length==1)&&(!isProducer||Object.keys(freeProduct.settings.producers).length==0)&&(!isCategory||Object.keys(freeProduct.settings.categories).length==0)&&(!isExpresionProduct||Object.keys(freeProduct.settings.products).length==0)){if(!isPrice&&!freeProduct.settings.showHigherPrices){continue;}}else{freeProduct.settings.price=0;}} if(freeProduct.productId in productDatas){avaibleIds.push(freeProduct.productId);} else{downloadIds.push(freeProduct.productId);}} if(avaibleIds.length==0&&downloadIds.length==0){container.parent().remove();container=null;return false;} waitingForIds=false;if(!isPreloader&&delayedPreloader&&!waitingForSoobasket)generatePreloader();waitingForFrontApi=true;if(downloadIds.length==0){waitingForFrontApi=false;generateHtml();} else{let promises=[];let downloadChunkCount=Math.ceil(downloadIds.length/50);for(let i=1;i<=downloadChunkCount;i++){promises.push(new Promise(function(resolve,reject){frontAPI.getProducts(function(products){if(products.count>0){for(let product of products.list){if(!product.can_buy)continue;productDatas[product.id]=product;avaibleIds.push(product.id);}} resolve(true);},{ids:downloadIds.slice((i-1)*50,i*50),urlParams:'?limit=50'});}));} Promise.all(promises).then(function(){if(avaibleIds.length0){let recurentGetProduct=function recurentGetProduct(key=0){frontAPI.getProduct(function(product){if(!('error_description'in product)&&product.can_buy){productDatas[product.id]=product;avaibleIds.push(product.id);} if(key==remainingIds.length-1||!forceSingleDownload&&avaibleIds.length>=15){if(avaibleIds.length==0){container.parent().remove();container=null;return false;} waitingForFrontApi=false;generateHtml();}else{recurentGetProduct(key+1);}},{id:remainingIds[key]});}();} else{waitingForFrontApi=false;generateHtml();}} else{waitingForFrontApi=false;generateHtml();}});} return true;};let refreshFromBasket=function refreshFromBasket(basket,downloadProducts=true){sum=0;basketPromo=1;maxPrice=0;producers={};categories={};expresionProducts={};htmlToUpdate={};freeProductsLeft=0;initialFreeProductsLeft=0;addedFreeProductsSkippedCountLimit=[];if(userGroupId==null){userGroupId=-1;let userId=Shop.fn.getVisitorId();if(userId!=null){let user=frontAPI.getUser({id:userId});if(0 in user.groups){userGroupId=user.groups[0].group_id;}}} let addedFreeProducts=[];if(localStorage.mx_app_produkt_gratisowy){addedFreeProducts=JSON.parse(localStorage.mx_app_produkt_gratisowy);} sum=0;basketPromo=1;switch(sum_basket){case'sum_products':sum=Math.round(basket.basket.sum_products_float*100)/100;break;case'sum_shipping':sum=Math.round((basket.basket.sum_products_float+basket.basket.sum_float-basket.basket.sum_no_shipping_float)*100)/100;break;case'sum_no_shipping':sum=Math.round(basket.basket.sum_no_shipping_float*100)/100;if(basket.promos!=null){for(let key in basket.promos){basketPromo+=basket.promos[key].percent;} basketPromo=1-Math.min(basketPromo,100)/ 100;} break;case'sum':sum=Math.round(basket.basket.sum_float*100)/100;if(basket.promos!=null){for(let key in basket.promos){basketPromo+=basket.promos[key].percent;} basketPromo=1-Math.min(basketPromo,100)/ 100;} break;default:console.error('appProduktGratisowy maxsote.pl - niewłaściwy sposób sumowania');} freeProductsLeft=0;for(let price in freeProductsCounts){if(price<=sum)freeProductsLeft=freeProductsCounts[price];} initialFreeProductsLeft=freeProductsLeft;let reload=false;let basketProductsIds=[];for(let product of basket.products){basketProductsIds.push(product.id);let freeKey=freeProductsIds.indexOf(product.product_id);if(freeKey==-1){for(let langKey in allFreeProductsIds){if(langKey==Shop.lang.name)continue;let langFreeKey=allFreeProductsIds[langKey].indexOf(product.product_id);let addedFreeProductsKey=addedFreeProducts.indexOf(product.id);if(langFreeKey!=-1&&product.variant!=''){frontAPI.removeFromBasket({id:product.id});if(addedFreeProductsKey!=-1)addedFreeProducts.splice(addedFreeProductsKey,1);reload=true;}}} let addedFreeProductsKey=addedFreeProducts.indexOf(product.id);if(freeKey!=-1&&product.variant!=''){if(freeProducts[freeKey].settings.skipCountLimit){if(product.quantity>1){frontAPI.removeFromBasket({id:product.id});if(addedFreeProductsKey!=-1)addedFreeProducts.splice(addedFreeProductsKey,1);reload=true;continue;} addedFreeProductsSkippedCountLimit.push(product.product_id);} else{if(freeProductsLeft0){for(let producerId in freeProducts[freeKey].settings.producers){if(typeof producers[producerId]!='undefined'){counter+=producers[producerId].quantity;adder+=producers[producerId].price;if(freeProducts[freeKey].settings.producers[producerId].quantity<=producers[producerId].quantity&&freeProducts[freeKey].settings.producers[producerId].price<=producers[producerId].price){isProducer=true;break;}}} if(!isProducer&&freeProducts[freeKey].settings.sumProducers){for(let producerId in freeProducts[freeKey].settings.producers){if(freeProducts[freeKey].settings.producers[producerId].quantity<=counter&&freeProducts[freeKey].settings.producers[producerId].price<=adder){isProducer=true;break;}}}}else{isProducer=true;} counter=0;adder=0;if(Object.keys(freeProducts[freeKey].settings.categories).length>0){for(let cateroryId in freeProducts[freeKey].settings.categories){if(typeof categories[cateroryId]!='undefined'){let countChildrens=0;let sumChildrens=0;if(freeProducts[freeKey].settings.categoriesChildrens){countChildrens+=categories[cateroryId].quantity;sumChildrens+=categories[cateroryId].price;}else{countChildrens+=categories[cateroryId].quantity;sumChildrens+=categories[cateroryId].price;} counter+=countChildrens;adder+=sumChildrens;if(freeProducts[freeKey].settings.categories[cateroryId].quantity<=countChildrens&&freeProducts[freeKey].settings.categories[cateroryId].price<=sumChildrens){isCategory=true;break;}}} if(!isCategory&&freeProducts[freeKey].settings.sumCategories){for(let cateroryId in freeProducts[freeKey].settings.categories){if(freeProducts[freeKey].settings.categories[cateroryId].quantity<=counter&&freeProducts[freeKey].settings.categories[cateroryId].price<=adder){isCategory=true;break;}}}}else{isCategory=true;} if(Object.keys(freeProducts[freeKey].settings.products).length>0){for(let productId in freeProducts[freeKey].settings.products){if(typeof expresionProducts[productId]!='undefined'){if(freeProducts[freeKey].settings.products[productId].quantity<=expresionProducts[productId].quantity&&freeProducts[freeKey].settings.products[productId].price<=expresionProducts[productId].price){isExpresionProduct=true;break;}}}}else{isExpresionProduct=true;} if(freeProducts[freeKey].settings.highestPrice){if(freeProducts[freeKey].settings.price<=maxPrice){isPrice=true;}}else{if(freeProducts[freeKey].settings.price<=sum){isPrice=true;}} if(!(0 in freeProducts[freeKey].settings.usersGroups)){if(userGroupId in freeProducts[freeKey].settings.usersGroups){isUserGroup=true;}}else{if(!(userGroupId in freeProducts[freeKey].settings.usersGroups)){isUserGroup=true;}} if(freeProducts[freeKey].settings.needAllSettings){if(!isProducer||!isCategory||!isExpresionProduct||!isPrice||!isUserGroup){frontAPI.removeFromBasket({id:product.id});if(addedFreeProductsKey!=-1)addedFreeProducts.splice(addedFreeProductsKey,1);reload=true;}}else{if((!isUserGroup||0 in freeProducts[freeKey].settings.usersGroups&&Object.keys(freeProducts[freeKey].settings.usersGroups).length==1)&&(!isProducer||Object.keys(freeProducts[freeKey].settings.producers).length==0)&&(!isCategory||Object.keys(freeProducts[freeKey].settings.categories).length==0)&&(!isExpresionProduct||Object.keys(freeProducts[freeKey].settings.products).length==0)&&!isPrice){frontAPI.removeFromBasket({id:product.id});if(addedFreeProductsKey!=-1)addedFreeProducts.splice(addedFreeProductsKey,1);reload=true;}}} else if(freeProducts[freeKey].settings.blockBuying){frontAPI.removeFromBasket({id:product.id});if(addedFreeProductsKey!=-1)addedFreeProducts.splice(addedFreeProductsKey,1);reload=true;}}} let diffAddedFreeProducts=[];for(let item of addedFreeProducts){if(basketProductsIds.includes(item)){diffAddedFreeProducts.push(item);}} addedFreeProducts=diffAddedFreeProducts;localStorage.mx_app_produkt_gratisowy=JSON.stringify(addedFreeProducts);if(reload)location.replace(location.href);if(!downloadProducts)return true;if(!selectProducts())return false;return true;};mxOdswiezGratis=function mxOdswiezGratis(basket){waitingForSoobasket=false;if(container==null){container=$('
');generatePreloader();} refreshFromBasket(basket);};frontAPI.getBasketInfo(function(basket){if($('#box_basketsummary').length>0){if(!refreshFromBasket(basket,false))return false;for(let freeKey in htmlToUpdate){let product=htmlToUpdate[freeKey];let item;$('#box_basketsummary [data-product-id="'+product.product_id+'"]').each(function(index2,item2){if($(item2).find('.variant').text().trim()==product.variant){item=$(item2);return false;}});if(freeProducts[freeKey].image!=''){item.find('.img img').attr('src',freeProducts[freeKey].image);} if(freeProducts[freeKey].name!=''){item.find('.name a').html(escapeHtml(freeProducts[freeKey].name)).attr('title',escapeHtml(freeProducts[freeKey].name));} item.find('.name .variant').html(text_variant);item.find('.price').html(product.price);} return true;} if($('#box_basketlist').length>0){if(!refreshFromBasket(basket))return false;if(typeof GlobalSoolutionSoobasket!='undefined'){waitingForSoobasket=true;let waitingFunction=function waitingFunction(){if($('#box_basketlist').is(':visible')){for(let freeKey in htmlToUpdate){let product=htmlToUpdate[freeKey];let item=$('#box_basketlist [href$="/basket/remove/'+product.id+'"]').parent().parent();if(freeProducts[freeKey].image!=''){item.find('.img img').attr('src',freeProducts[freeKey].image);} if(freeProducts[freeKey].name!=''){item.find('.name a').html(escapeHtml(freeProducts[freeKey].name)).attr('title',escapeHtml(freeProducts[freeKey].name));} item.find('.name .variant').html(text_variant);item.find('.quantity input').val(product.quantity).prop('readonly',true).css({'background':'#33333333','cursor':'auto'});item.find('.quantity .wce_qdec, .quantity .wce_qinc').remove();item.find('.price').html(product.price);} waitingForSoobasket=false;if(!isPreloader&&(!delayedPreloader||delayedPreloader&&!waitingForIds))generatePreloader();generateHtml();} else if($('.el-table .el-table__row').length==0){setTimeout(waitingFunction,100);} else{for(let freeKey in htmlToUpdate){let product=htmlToUpdate[freeKey];let item=$('.el-table .basket_product_id_'+product.id);if(freeProducts[freeKey].image!=''){item.find('img').attr('src',freeProducts[freeKey].image).css({'max-width':'75px'});} if(freeProducts[freeKey].name!=''){item.find('.name a').html(escapeHtml(freeProducts[freeKey].name)).attr('title',escapeHtml(freeProducts[freeKey].name));} item.find('.name .variant').html(text_variant);item.find('.quantity-input').append('
');item.find('.quantity-input input').val(product.quantity).prop('readonly',true);item.find('.el-table_1_column_5 .cell').html(`${product.price}`);} waitingForSoobasket=false;if(!isPreloader&&(!delayedPreloader||delayedPreloader&&!waitingForIds))generatePreloader();generateHtml();}};waitingFunction();} else{for(let freeKey in htmlToUpdate){let product=htmlToUpdate[freeKey];let item=$('#box_basketlist [href$="/basket/remove/'+product.id+'"]').parent().parent();if(freeProducts[freeKey].image!=''){item.find('.img img').attr('src',freeProducts[freeKey].image).css({'max-width':'75px'});} if(freeProducts[freeKey].name!=''){item.find('.name a').html(escapeHtml(freeProducts[freeKey].name)).attr('title',escapeHtml(freeProducts[freeKey].name));} item.find('.name .variant').html(text_variant);item.find('.quantity input').val(product.quantity).prop('readonly',true).css({'background':'#33333333','cursor':'auto'});item.find('.quantity .wce_qdec, .quantity .wce_qinc').remove();item.find('.price').html(product.price);} if(!isPreloader&&!delayedPreloader)generatePreloader();} return true;} if(!refreshFromBasket(basket,false))return false;},{});}};if($('#box_productfull').length>0){for(let freeProduct of freeProducts){$(`#box_productfull #option_${optionId}`).parent().parent().parent().parent().remove();if(freeProduct.productId==Shop.pageId&&Boolean(freeProduct.settings.blockBuying)){$('#box_productfull .form-basket > fieldset').hide();$('#box_productfull .form-basket').append(`
${text_blockBuying}
`);} else{$(`#box_productfull .stocks`).show();}} $(`.stocks-bundle [data-variant-id="${optionId}"]`).parent().parent().parent().remove();} else if($('.shop_product_list').length>0){for(let freeProduct of freeProducts){if(freeProduct.settings.blockBuying){$(`[data-product-id="${freeProduct.productId}"] .addtobasket`).hide();$(`[data-product-id="${freeProduct.productId}"] .mx_app_ilosc`).hide();}}} else{let applyCurrencyRate=function(currencyRate){if(currencyRate==1)return;let freeProductsCountsCopy=Object.assign({},freeProductsCounts);freeProductsCounts={};for(let step in freeProductsCountsCopy){freeProductsCounts[step*currencyRate]=freeProductsCountsCopy[step];} for(let lang in freeProducts){let freeProductsLang=freeProducts[lang];for(let key1 in freeProductsLang){let freeProduct=freeProductsLang[key1];freeProduct.price*=currencyRate;for(let key2 in freeProduct.settings){let settings=freeProduct.settings[key2];settings.price*=currencyRate;for(let objectId in settings.categories){let object=settings.categories[objectId];object.price*=currencyRate;} for(let objectId in settings.producers){let object=settings.producers[objectId];object.price*=currencyRate;} for(let objectId in settings.products){let object=settings.products[objectId];object.price*=currencyRate;}}}}};let cache_currency='';if(localStorage.mx_app_produkt_gratisowy_currency){cache_currency=localStorage.mx_app_produkt_gratisowy_currency;} if(cache_currency!=current_curr){let link="https://mxapp4.maxserver.pl/appProduktGratisowy/getCurrencyRate.php";let postData={shopId:shopId,currency:current_curr};$.post(link,postData).done((response)=>{response=JSON.parse(response);if('error'in response)return false;localStorage.mx_app_produkt_gratisowy_currency=current_curr;localStorage.mx_app_produkt_gratisowy_currency_rate=response.rate;applyCurrencyRate(response.rate);APIloader();});} else{applyCurrencyRate(localStorage.mx_app_produkt_gratisowy_currency_rate*1);APIloader();}} let style='';style+=` \n`;$("head").append(style);}(jQuery)); //# sourceURL=script_appProduktGratisowy