//var tempbox = '';
var tempbox = '
';
var relatedProducts = {"items":[{"id":2374,"sku":"30011476","name":"Ytong svinovac\u00ed metr 7,5 m","attribute_set_id":4,"price":139,"status":1,"visibility":4,"type_id":"simple","created_at":"2023-11-24 14:26:30","updated_at":"2023-11-27 14:31:19","extension_attributes":{"website_ids":[1],"category_links":[{"position":0,"category_id":"50"}]},"product_links":[],"options":[],"media_gallery_entries":[{"id":5312,"media_type":"image","label":null,"position":1,"disabled":false,"types":["image","small_image","thumbnail","swatch_image"],"file":"\/s\/v\/svinovaci-metr-ytong.png"}],"tier_prices":[],"custom_attributes":[{"attribute_code":"short_description","value":"Nejd\u0159\u00edv m\u011b\u0159 potom \u0159e\u017e. S na\u0161\u00edm metrem zm\u011b\u0159\u00edte v\u0161e p\u0159esn\u011b.
\r\nPlastov\u00fd svinovac\u00ed metr 7,5m s aretac\u00ed, kovov\u00fdm klipem a poutkem."},{"attribute_code":"image","value":"\/s\/v\/svinovaci-metr-ytong.png"},{"attribute_code":"url_key","value":"ytong-svinovaci-metr-7-5-m"},{"attribute_code":"gift_message_available","value":"2"},{"attribute_code":"new","value":"0"},{"attribute_code":"small_image","value":"\/s\/v\/svinovaci-metr-ytong.png"},{"attribute_code":"meta_title","value":"Ytong svinovac\u00ed metr 7,5 m"},{"attribute_code":"options_container","value":"container2"},{"attribute_code":"sale","value":"0"},{"attribute_code":"thumbnail","value":"\/s\/v\/svinovaci-metr-ytong.png"},{"attribute_code":"meta_keyword","value":"Ytong svinovac\u00ed metr 7,5 m"},{"attribute_code":"swatch_image","value":"\/s\/v\/svinovaci-metr-ytong.png"},{"attribute_code":"meta_description","value":"Ytong svinovac\u00ed metr 7,5 m "},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"msrp_display_actual_price_type","value":"0"},{"attribute_code":"category_ids","value":["50"]},{"attribute_code":"required_options","value":"0"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"sw_featured","value":"0"},{"attribute_code":"am_shipping_type","value":"220"},{"attribute_code":"product_image_size","value":"0"}]},{"id":2312,"sku":"30011530","name":"Ta\u0161ka Ytong","attribute_set_id":4,"price":437,"status":1,"visibility":4,"type_id":"simple","created_at":"2022-05-06 11:40:16","updated_at":"2023-07-26 08:41:09","weight":1,"extension_attributes":{"website_ids":[1],"category_links":[{"position":15,"category_id":"2"},{"position":0,"category_id":"50"}]},"product_links":[],"options":[],"media_gallery_entries":[{"id":5158,"media_type":"image","label":null,"position":0,"disabled":false,"types":["image","small_image","thumbnail","swatch_image"],"file":"\/0\/0\/00_promovak-taska.png"},{"id":5064,"media_type":"image","label":null,"position":1,"disabled":true,"types":[],"file":"\/y\/t\/ytong-promovak_2_wrbsqrvhtwqvcrxk.jpg"},{"id":5060,"media_type":"image","label":null,"position":2,"disabled":true,"types":[],"file":"\/p\/r\/promovak_taska_main_3vw28qk0nenmbgyj.jpg"},{"id":5061,"media_type":"image","label":null,"position":3,"disabled":true,"types":[],"file":"\/p\/r\/promovak_taska_category_j4opsj2zsvm6dgaj.jpg"},{"id":5062,"media_type":"image","label":null,"position":4,"disabled":true,"types":[],"file":"\/y\/t\/ytong-promovak_1_1_jwgqmaa24compmi0.jpg"},{"id":5063,"media_type":"image","label":null,"position":5,"disabled":true,"types":[],"file":"\/y\/t\/ytong-taska_1_1_7ym3meuqh66qys8l.png"}],"tier_prices":[],"custom_attributes":[{"attribute_code":"short_description","value":"Praktick\u00e1 ta\u0161ka na n\u00e1\u0159ad\u00ed.<\/p>"},{"attribute_code":"image","value":"\/0\/0\/00_promovak-taska.png"},{"attribute_code":"url_key","value":"taska-ytong"},{"attribute_code":"gift_message_available","value":"2"},{"attribute_code":"table_technic","value":"
Parametry:<\/h3>\r\n\r\n- barva: \u010dern\u00e1 s logem Ytong<\/li>\r\n
- materi\u00e1l: 100% PES.<\/li>\r\n<\/ul>"},{"attribute_code":"new","value":"0"},{"attribute_code":"small_image","value":"\/0\/0\/00_promovak-taska.png"},{"attribute_code":"options_container","value":"container2"},{"attribute_code":"sale","value":"0"},{"attribute_code":"thumbnail","value":"\/0\/0\/00_promovak-taska.png"},{"attribute_code":"swatch_image","value":"\/0\/0\/00_promovak-taska.png"},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"msrp_display_actual_price_type","value":"0"},{"attribute_code":"label_znacka_firma","value":"243"},{"attribute_code":"category_ids","value":["2","50"]},{"attribute_code":"required_options","value":"0"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"sw_featured","value":"0"},{"attribute_code":"am_shipping_type","value":"220"},{"attribute_code":"product_image_size","value":"5"}]},{"id":2371,"sku":"30012882","name":"Pono\u017eky Ytong","attribute_set_id":4,"price":159,"status":1,"visibility":4,"type_id":"simple","created_at":"2023-11-24 14:08:58","updated_at":"2023-11-27 14:32:51","extension_attributes":{"website_ids":[1],"category_links":[{"position":0,"category_id":"50"}]},"product_links":[],"options":[],"media_gallery_entries":[{"id":5311,"media_type":"image","label":null,"position":1,"disabled":false,"types":["image","small_image","thumbnail","swatch_image"],"file":"\/p\/o\/ponozky-ytong.png"}],"tier_prices":[],"custom_attributes":[{"attribute_code":"short_description","value":"Pono\u017eky s unik\u00e1tn\u00edm designem Ytong.
\r\nBarva \u017elut\u00e1 s \u010dern\u00fdm vzorem. 80 % bavlna, 15 % nylon, 5 % elasten "},{"attribute_code":"image","value":"\/p\/o\/ponozky-ytong.png"},{"attribute_code":"url_key","value":"ponozky-ytong"},{"attribute_code":"gift_message_available","value":"2"},{"attribute_code":"new","value":"0"},{"attribute_code":"small_image","value":"\/p\/o\/ponozky-ytong.png"},{"attribute_code":"meta_title","value":"Pono\u017eky Ytong"},{"attribute_code":"options_container","value":"container2"},{"attribute_code":"sale","value":"0"},{"attribute_code":"thumbnail","value":"\/p\/o\/ponozky-ytong.png"},{"attribute_code":"meta_keyword","value":"Pono\u017eky Ytong"},{"attribute_code":"swatch_image","value":"\/p\/o\/ponozky-ytong.png"},{"attribute_code":"meta_description","value":"Pono\u017eky Ytong "},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"msrp_display_actual_price_type","value":"0"},{"attribute_code":"category_ids","value":["50"]},{"attribute_code":"required_options","value":"0"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"sw_featured","value":"0"},{"attribute_code":"am_shipping_type","value":"220"},{"attribute_code":"product_image_size","value":"0"}]},{"id":2370,"sku":"30012883","name":"Kulich Ytong","attribute_set_id":4,"price":140,"status":1,"visibility":4,"type_id":"simple","created_at":"2023-11-24 13:51:31","updated_at":"2023-11-27 14:33:13","extension_attributes":{"website_ids":[1],"category_links":[{"position":0,"category_id":"50"}]},"product_links":[],"options":[],"media_gallery_entries":[{"id":5310,"media_type":"image","label":null,"position":1,"disabled":false,"types":["image","small_image","thumbnail","swatch_image"],"file":"\/c\/e\/cepice-ytong.png"}],"tier_prices":[],"custom_attributes":[{"attribute_code":"short_description","value":"Ytong v\u00e1m v\u017edy zajist\u00ed tepelnou pohodu stejn\u011b jako tento kulich.
\r\nBarva \u010dern\u00e1 se \u0161t\u00edtkem Ytong. 100 % polyacryl"},{"attribute_code":"image","value":"\/c\/e\/cepice-ytong.png"},{"attribute_code":"url_key","value":"kulich-ytong"},{"attribute_code":"gift_message_available","value":"2"},{"attribute_code":"new","value":"0"},{"attribute_code":"small_image","value":"\/c\/e\/cepice-ytong.png"},{"attribute_code":"meta_title","value":"Kulich Ytong"},{"attribute_code":"options_container","value":"container2"},{"attribute_code":"sale","value":"0"},{"attribute_code":"thumbnail","value":"\/c\/e\/cepice-ytong.png"},{"attribute_code":"meta_keyword","value":"Kulich Ytong"},{"attribute_code":"swatch_image","value":"\/c\/e\/cepice-ytong.png"},{"attribute_code":"meta_description","value":"Kulich Ytong "},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"msrp_display_actual_price_type","value":"0"},{"attribute_code":"category_ids","value":["50"]},{"attribute_code":"required_options","value":"0"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"sw_featured","value":"0"},{"attribute_code":"am_shipping_type","value":"220"},{"attribute_code":"product_image_size","value":"0"}]},{"id":2372,"sku":"30012884","name":"K\u0161iltovka Ytong","attribute_set_id":4,"price":165,"status":1,"visibility":4,"type_id":"simple","created_at":"2023-11-24 14:13:07","updated_at":"2023-11-27 14:32:24","extension_attributes":{"website_ids":[1],"category_links":[{"position":0,"category_id":"50"}]},"product_links":[],"options":[],"media_gallery_entries":[{"id":5314,"media_type":"image","label":null,"position":1,"disabled":false,"types":["image","small_image","thumbnail","swatch_image"],"file":"\/k\/s\/ksiltovka-ytong.png"}],"tier_prices":[],"custom_attributes":[{"attribute_code":"short_description","value":"V\u00edte jak\u00e9 je to slunce prev\u00edt? Ochrana p\u0159ed sluncem je z\u00e1klad. Z\u016fstante v pohod\u011b s k\u0161iltovkou Ytong.
\r\nBarva \u010dern\u00e1 s v\u00fd\u0161ivkou Ytong. 100 % bavlna"},{"attribute_code":"image","value":"\/k\/s\/ksiltovka-ytong.png"},{"attribute_code":"url_key","value":"ksiltovka-ytong"},{"attribute_code":"gift_message_available","value":"2"},{"attribute_code":"new","value":"0"},{"attribute_code":"small_image","value":"\/k\/s\/ksiltovka-ytong.png"},{"attribute_code":"meta_title","value":"K\u0161iltovka Ytong"},{"attribute_code":"options_container","value":"container2"},{"attribute_code":"sale","value":"0"},{"attribute_code":"thumbnail","value":"\/k\/s\/ksiltovka-ytong.png"},{"attribute_code":"meta_keyword","value":"K\u0161iltovka Ytong"},{"attribute_code":"swatch_image","value":"\/k\/s\/ksiltovka-ytong.png"},{"attribute_code":"meta_description","value":"K\u0161iltovka Ytong "},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"msrp_display_actual_price_type","value":"0"},{"attribute_code":"category_ids","value":["50"]},{"attribute_code":"required_options","value":"0"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"sw_featured","value":"0"},{"attribute_code":"am_shipping_type","value":"220"},{"attribute_code":"product_image_size","value":"0"}]},{"id":2373,"sku":"30012886","name":"Ytong paletka - pozn\u00e1mkov\u00fd blok","attribute_set_id":4,"price":99,"status":1,"visibility":4,"type_id":"simple","created_at":"2023-11-24 14:25:01","updated_at":"2023-11-27 14:32:01","extension_attributes":{"website_ids":[1],"category_links":[{"position":0,"category_id":"50"}]},"product_links":[],"options":[],"media_gallery_entries":[{"id":5313,"media_type":"image","label":null,"position":1,"disabled":false,"types":["image","small_image","thumbnail","swatch_image"],"file":"\/b\/l\/blok-paleta-ytong.png"}],"tier_prices":[],"custom_attributes":[{"attribute_code":"short_description","value":"V\u0161echny va\u0161e pozn\u00e1mky na jedn\u00e9 palet\u011b.
\r\nD\u0159ev\u011bn\u00e1 paletka s odtrh\u00e1vac\u00edm pap\u00edrov\u00fdm blokem. Rozm\u011bry 11,7 x 11,7x 7,6 cm"},{"attribute_code":"image","value":"\/b\/l\/blok-paleta-ytong.png"},{"attribute_code":"url_key","value":"ytong-paletka-poznamkovy-blok"},{"attribute_code":"gift_message_available","value":"2"},{"attribute_code":"new","value":"0"},{"attribute_code":"small_image","value":"\/b\/l\/blok-paleta-ytong.png"},{"attribute_code":"meta_title","value":"Ytong paletka - pozn\u00e1mkov\u00fd blok"},{"attribute_code":"options_container","value":"container2"},{"attribute_code":"sale","value":"0"},{"attribute_code":"thumbnail","value":"\/b\/l\/blok-paleta-ytong.png"},{"attribute_code":"meta_keyword","value":"Ytong paletka - pozn\u00e1mkov\u00fd blok"},{"attribute_code":"swatch_image","value":"\/b\/l\/blok-paleta-ytong.png"},{"attribute_code":"meta_description","value":"Ytong paletka - pozn\u00e1mkov\u00fd blok "},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"msrp_display_actual_price_type","value":"0"},{"attribute_code":"category_ids","value":["50"]},{"attribute_code":"required_options","value":"0"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"sw_featured","value":"0"},{"attribute_code":"am_shipping_type","value":"220"},{"attribute_code":"product_image_size","value":"0"}]},{"id":2376,"sku":"30012888","name":"Ytong helmi\u010dka - p\u0159\u00edv\u011bsek","attribute_set_id":4,"price":39,"status":1,"visibility":4,"type_id":"simple","created_at":"2023-11-24 14:48:18","updated_at":"2023-11-24 14:48:18","extension_attributes":{"website_ids":[1],"category_links":[{"position":0,"category_id":"50"}]},"product_links":[],"options":[],"media_gallery_entries":[{"id":5316,"media_type":"image","label":null,"position":1,"disabled":false,"types":["image","small_image","thumbnail","swatch_image"],"file":"\/p\/r\/privesek-ytong.png"}],"tier_prices":[],"custom_attributes":[{"attribute_code":"short_description","value":"Myslete na bezpe\u010dnost a m\u011bjte svoji helmi\u010dku v\u017edy p\u0159i sob\u011b.
\r\nPlastov\u00fd p\u0159\u00edv\u011bsek ve tvaru helmy."},{"attribute_code":"image","value":"\/p\/r\/privesek-ytong.png"},{"attribute_code":"url_key","value":"ytong-helmicka-privesek"},{"attribute_code":"gift_message_available","value":"2"},{"attribute_code":"new","value":"0"},{"attribute_code":"small_image","value":"\/p\/r\/privesek-ytong.png"},{"attribute_code":"meta_title","value":"Ytong helmi\u010dka - p\u0159\u00edv\u011bsek"},{"attribute_code":"options_container","value":"container2"},{"attribute_code":"sale","value":"0"},{"attribute_code":"thumbnail","value":"\/p\/r\/privesek-ytong.png"},{"attribute_code":"meta_keyword","value":"Ytong helmi\u010dka - p\u0159\u00edv\u011bsek"},{"attribute_code":"swatch_image","value":"\/p\/r\/privesek-ytong.png"},{"attribute_code":"meta_description","value":"Ytong helmi\u010dka - p\u0159\u00edv\u011bsek "},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"msrp_display_actual_price_type","value":"0"},{"attribute_code":"category_ids","value":["50"]},{"attribute_code":"required_options","value":"0"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"sw_featured","value":"0"},{"attribute_code":"am_shipping_type","value":"220"},{"attribute_code":"product_image_size","value":"0"}]},{"id":2375,"sku":"30012890","name":"Odlamovac\u00ed n\u016f\u017e Ytong 18 mm","attribute_set_id":4,"price":129,"status":1,"visibility":4,"type_id":"simple","created_at":"2023-11-24 14:46:46","updated_at":"2023-11-27 14:30:55","extension_attributes":{"website_ids":[1],"category_links":[{"position":0,"category_id":"50"}]},"product_links":[],"options":[],"media_gallery_entries":[{"id":5315,"media_type":"image","label":null,"position":1,"disabled":false,"types":["image","small_image","thumbnail","swatch_image"],"file":"\/r\/e\/rezaci-nuz-ytong.png"}],"tier_prices":[],"custom_attributes":[{"attribute_code":"short_description","value":"P\u0159esn\u00e9 a rovn\u00e9 \u0159ezy, v tom je Ytong specialista.
\r\nOdlamovac\u00ed n\u016f\u017e s kovovou vod\u00edc\u00ed li\u0161tou, v\u00fdsuvnou \u010depel\u00ed s aretac\u00ed. M\u00e1 v sob\u011b i o\u0159ez\u00e1v\u00e1tko a 4 n\u00e1hradn\u00ed no\u017ee."},{"attribute_code":"image","value":"\/r\/e\/rezaci-nuz-ytong.png"},{"attribute_code":"url_key","value":"odlamovaci-nuz-ytong-18-mm"},{"attribute_code":"gift_message_available","value":"2"},{"attribute_code":"new","value":"0"},{"attribute_code":"small_image","value":"\/r\/e\/rezaci-nuz-ytong.png"},{"attribute_code":"meta_title","value":"Odlamovac\u00ed n\u016f\u017e Ytong 18 mm"},{"attribute_code":"options_container","value":"container2"},{"attribute_code":"sale","value":"0"},{"attribute_code":"thumbnail","value":"\/r\/e\/rezaci-nuz-ytong.png"},{"attribute_code":"meta_keyword","value":"Odlamovac\u00ed n\u016f\u017e Ytong 18 mm"},{"attribute_code":"swatch_image","value":"\/r\/e\/rezaci-nuz-ytong.png"},{"attribute_code":"meta_description","value":"Odlamovac\u00ed n\u016f\u017e Ytong 18 mm "},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"msrp_display_actual_price_type","value":"0"},{"attribute_code":"category_ids","value":["50"]},{"attribute_code":"required_options","value":"0"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"sw_featured","value":"0"},{"attribute_code":"am_shipping_type","value":"220"},{"attribute_code":"product_image_size","value":"0"}]}],"search_criteria":{"filter_groups":[{"filters":[{"field":"sku","value":"30011530","condition_type":"eq"},{"field":"sku","value":"30012883","condition_type":"eq"},{"field":"sku","value":"30012882","condition_type":"eq"},{"field":"sku","value":"30012884","condition_type":"eq"},{"field":"sku","value":"30012886","condition_type":"eq"},{"field":"sku","value":"30011476","condition_type":"eq"},{"field":"sku","value":"30012890","condition_type":"eq"},{"field":"sku","value":"30012888","condition_type":"eq"}]}]},"total_count":8} ;relatedProducts = relatedProducts.items.filter(elm => elm.visibility == 4 && elm.sku !="30012883").slice(0,4) ;
if(document.querySelector("#relatedProductContainer")){
document.querySelector("#relatedProductContainer").innerHTML = "";
for(var i = 0 ; i < relatedProducts.length; i++){
//var price = (Math.round(relatedProducts[i].price*121/100*10)/10).toFixed(2)+" Kč"; //@
var price = (Math.round(relatedProducts[i].price*121/100*10)/10).toLocaleString("cs-CZ", {style:"currency", currency:"CZK"}); //@
var image = "/media/catalog/product"+relatedProducts[i].custom_attributes.find(elm => elm.attribute_code == "image").value; //@@
var name = relatedProducts[i].name; //@@@
var link = "/"+relatedProducts[i].custom_attributes.find(elm => elm.attribute_code == "url_key").value+".html"; //@@@@
//document.querySelector("#relatedProductContainer").innerHTML += tempbox.replace("@@@",name).replace("@@",price).replace("@",image);
document.querySelector("#relatedProductContainer").innerHTML += tempbox.replace("@@@@",link).replace("@@@",name).replace("@@",price).replace("@",image);
}
}