jQuery(function($){var translations_array='{"prefix_lista":{"__default":"","pl_PL":""},"prefix_karta":{"__default":"","pl_PL":""}}';var active='1';var omnibus_update='1';var active_karta='1';var amount_type='procent';var bg_type='circ';var width='60';var height='60';var vertical_align='top';var horizontal_align='right';var position_y='-5';var position_x='-5';var color='rgb(231, 84, 128)';var font_color='rgb(255, 255, 255)';var font_size='20';var font='';var bold='0';var italic='0';var underscore='0';var shop_id='605';var karta_amount_type='procent';var karta_bg_type='circ';var karta_width='60';var karta_height='60';var karta_vertical_align='top';var karta_horizontal_align='right';var karta_position_y='0';var karta_position_x='0';var karta_color='rgb(231, 84, 128)';var karta_font_color='rgb(255, 255, 255)';var karta_font_size='20';var karta_font='';var karta_bold='0';var karta_italic='0';var karta_underscore='0';;$(document).ready(function(){var current_lang=Shop.lang.name;let flag_omnibus=parseInt(omnibus_update);translations_array=JSON.parse(translations_array);if(active_karta=='1'&&$('#box_productfull').length>0){let product=$('#box_productfull');let product_image_class=false;if(product.find('.mainimg').length>0){product_image_class='.mainimg';} if(product.find('div.price del').length>0&&!product.find('div.price del').hasClass('none')&&product_image_class){if(flag_omnibus&&product.find('.f-row > .price__inactive').length){old_price_noCur=product.find('.f-row > .price__inactive').text().replace(/[^0-9.,]/g,"");} else{old_price_noCur=product.find('div.price del').text().replace(/[^0-9.,]/g,"");} price_noCur=product.find('div.price em').text().replace(/[^0-9.,]/g,"");if(old_price_noCur[old_price_noCur.length-3]==","){old_price=parseFloat(old_price_noCur.replace('.','').replace(',','.'));price=parseFloat(price_noCur.replace('.','').replace(',','.'));} else if(old_price_noCur[old_price_noCur.length-3]=="."){old_price=parseFloat(old_price_noCur.replace(',',''));price=parseFloat(price_noCur.replace(',',''));} else{if(flag_omnibus&&product.find('div.price .f-row .price__inactive').length){old_price=parseFloat(product.find('div.price .f-row .price__inactive').text().replace(/[^0-9]/g,""));} else{old_price=parseFloat(product.find('div.price del').text().replace(/[^0-9]/g,""));} price=parseFloat(product.find('div.price em').text().replace(/[^0-9]/g,""));} if(old_price<=price||(isNaN(old_price)||isNaN(price))){return true;} if(karta_amount_type=='procent'){if(Math.round(100-(price*100 / old_price))==0)return true;show_text='-'+Math.round(100-(price*100 / old_price))+'%';} else{currency=product.find('div.price del').first().text().replace(/[0-9.,]/g,"");show_text='-'+(old_price-price).toFixed(2).replace('.',',')+currency;} if(!(current_lang in translations_array['prefix_karta'])){show_text=translations_array['prefix_karta']['__default']+show_text;} else{show_text=translations_array['prefix_karta'][current_lang]+show_text;} let wstazka=$('
');wstazka.addClass('maxsote_app_wstazka');wstazka.text(show_text);if(karta_bg_type!='reset'){product.find(product_image_class).css('position','relative');wstazka.css('position','absolute');wstazka.css('z-index','9');wstazka.css('text-align','center');wstazka.css('width',karta_width+'px');wstazka.css('height',karta_height+'px');wstazka.css('line-height',karta_height+'px');if(karta_vertical_align=='top'){wstazka.css('top',karta_position_y+'px');} else{wstazka.css('bottom',karta_position_y+'px');} if(karta_horizontal_align=='left'){wstazka.css('left',position_x+'px');} else if(karta_horizontal_align=='right'){wstazka.css('right',position_x+'px');} else{wstazka.css('left','50%');position_x_center=0-parseInt(width/2)+parseInt(karta_position_x);wstazka.css('margin-left',position_x_center+'px');} if(karta_bg_type=='rect'||karta_bg_type=='circ'){wstazka.css('background-color',karta_color);if(karta_bg_type=='circ'){wstazka.css('border-radius','100%');}} if(karta_font_color.length>0){wstazka.css('color',karta_font_color);} if(karta_font_size.length>0){wstazka.css('font-size',karta_font_size+'px');} if(karta_bold=='1'){wstazka.css('font-weight','bold');} if(karta_italic=='1'){wstazka.css('font-style','italic');} if(karta_underscore=='1'){wstazka.css('text-decoration','underline');}} product.find(product_image_class).append(wstazka);}} if(active=='1'){$('.product').each(function(){var product=$(this);product_image_class=false;if(product.find('.prodimage').length>0){product_image_class='.prodimage';} else if(product.find('.boximgsize').length>0){product_image_class='.boximgsize';} if(shop_id=='186'){old_price=parseFloat(product.find('div.price .mx_mod_otherprice').text());if(old_price>0){price=parseFloat(product.find('div.price em').text().replace(/[^0-9.,]/g,"").replace(',','.'));if(amount_type=='procent'){show_text='-'+Math.round(100-(price*100 / old_price))+'%';} else{currency=product.find('div.price del').first().text().replace(/[0-9.,]/g,"");show_text='-'+(old_price-price).toFixed(2).replace('.',',')+currency;} let wstazka=$('
');wstazka.addClass('maxsote_app_wstazka');wstazka.text(show_text);if(bg_type!='reset'){product.find(product_image_class).css('position','relative');wstazka.css('position','absolute');wstazka.css('z-index','9');wstazka.css('text-align','center');wstazka.css('width',width+'px');wstazka.css('height',height+'px');wstazka.css('line-height',height+'px');if(vertical_align=='top'){wstazka.css('top',position_y+'px');} else{wstazka.css('bottom',position_y+'px');} if(horizontal_align=='left'){wstazka.css('left',position_x+'px');} else if(horizontal_align=='right'){wstazka.css('right',position_x+'px');} else{wstazka.css('left','50%');position_x_center=0-parseInt(width/2)+parseInt(position_x);wstazka.css('margin-left',position_x_center+'px');} if(bg_type=='rect'||bg_type=='circ'){wstazka.css('background-color',color);if(bg_type=='circ'){wstazka.css('border-radius','100%');}} if(font_color.length>0){wstazka.css('color',font_color);} if(font_size.length>0){wstazka.css('font-size',font_size+'px');} if(bold=='1'){wstazka.css('font-weight','bold');} if(italic=='1'){wstazka.css('font-style','italic');} if(underscore=='1'){wstazka.css('text-decoration','underline');}} product.find(product_image_class).append(wstazka);} else{if(product.find('div.price del').length>0&&product_image_class){old_price_noCur=product.find('div.price del').text().replace(/[^0-9.,]/g,"");price_noCur=product.find('div.price em').text().replace(/[^0-9.,]/g,"");if(old_price_noCur[old_price_noCur.length-3]==","){old_price=parseFloat(old_price_noCur.replace('.','').replace(',','.'));price=parseFloat(price_noCur.replace('.','').replace(',','.'));} else if(old_price_noCur[old_price_noCur.length-3]=="."){old_price=parseFloat(old_price_noCur.replace(',',''));price=parseFloat(price_noCur.replace(',',''));} else{old_price=parseFloat(product.find('div.price del').text().replace(/[^0-9]/g,""));price=parseFloat(product.find('div.price em').text().replace(/[^0-9]/g,""));} if(amount_type=='procent'){show_text='-'+Math.round(100-(price*100 / old_price))+'%';} else{currency=product.find('div.price del').first().text().replace(/[0-9.,]/g,"");show_text='-'+(old_price-price).toFixed(2).replace('.',',')+currency;} let wstazka=$('
');wstazka.addClass('maxsote_app_wstazka');wstazka.text(show_text);if(bg_type!='reset'){product.find(product_image_class).css('position','relative');wstazka.css('position','absolute');wstazka.css('z-index','9');wstazka.css('text-align','center');wstazka.css('width',width+'px');wstazka.css('height',height+'px');wstazka.css('line-height',height+'px');if(vertical_align=='top'){wstazka.css('top',position_y+'px');} else{wstazka.css('bottom',position_y+'px');} if(horizontal_align=='left'){wstazka.css('left',position_x+'px');} else if(horizontal_align=='right'){wstazka.css('right',position_x+'px');} else{wstazka.css('left','50%');position_x_center=0-parseInt(width/2)+parseInt(position_x);wstazka.css('margin-left',position_x_center+'px');} if(bg_type=='rect'||bg_type=='circ'){wstazka.css('background-color',color);if(bg_type=='circ'){wstazka.css('border-radius','100%');}} if(font_color.length>0){wstazka.css('color',font_color);} if(font_size.length>0){wstazka.css('font-size',font_size+'px');} if(font.length>0){wstazka.css('font-family',font);} if(bold=='1'){wstazka.css('font-weight','bold');} if(italic=='1'){wstazka.css('font-style','italic');} if(underscore=='1'){wstazka.css('text-decoration','underline');}} product.find(product_image_class).append(wstazka);}}} else{if((product.find('div.price del').length>0||product.find('.price__inactive').length>0)&&product_image_class){if(flag_omnibus&&product.find('strong.price__inactive').length){old_price_noCur=product.find('strong.price__inactive').text().replace(/[^0-9.,]/g,"");} else{if(product.find('div.price del').length>0){old_price_noCur=product.find('div.price del').text().replace(/[^0-9.,]/g,"");} else if(product.find('.price__inactive').length>0){old_price_noCur=product.find('.price__inactive').text().replace(/[^0-9.,]/g,"");} else{old_price_noCur=product.find('.price__inactive').text().replace(/[^0-9.,]/g,"")}} price_noCur=product.find('div.price em').text().replace(/[^0-9.,]/g,"");if(old_price_noCur[old_price_noCur.length-3]==","){old_price=parseFloat(old_price_noCur.replace('.','').replace(',','.'));price=parseFloat(price_noCur.replace('.','').replace(',','.'));} else if(old_price_noCur[old_price_noCur.length-3]=="."){old_price=parseFloat(old_price_noCur.replace(',',''));price=parseFloat(price_noCur.replace(',',''));} else{if(flag_omnibus&&product.find('.price__inactive').length){old_price=parseFloat(product.find('.price__inactive').text().replace(/[^0-9]/g,""));} else{if(product.find('div.price del').length>0){old_price=parseFloat(product.find('div.price del').text().replace(/[^0-9]/g,""));} else if(product.find('.price__inactive').length>0){old_price=parseFloat(product.find('.price__inactive').text().replace(/[^0-9]/g,""));}} price=parseFloat(product.find('div.price em').text().replace(/[^0-9]/g,""));} if(old_price<=price||(isNaN(old_price)||isNaN(price))){return true;} if(amount_type=='procent'){if(Math.round(100-(price*100 / old_price))==0)return true;show_text='-'+Math.round(100-(price*100 / old_price))+'%';} else{currency=product.find('div.price del').first().text().replace(/[0-9.,]/g,"");show_text='-'+(old_price-price).toFixed(2).replace('.',',')+currency;} if(!(current_lang in translations_array['prefix_lista'])){show_text=translations_array['prefix_lista']['__default']+show_text;} else{show_text=translations_array['prefix_lista'][current_lang]+show_text;} wstazka=$('
');wstazka.addClass('maxsote_app_wstazka');wstazka.text(show_text);if(bg_type!='reset'){product.find(product_image_class).css('position','relative');wstazka.css('position','absolute');wstazka.css('z-index','9');wstazka.css('text-align','center');wstazka.css('width',width+'px');wstazka.css('height',height+'px');wstazka.css('line-height',height+'px');if(vertical_align=='top'){wstazka.css('top',position_y+'px');} else{wstazka.css('bottom',position_y+'px');} if(horizontal_align=='left'){wstazka.css('left',position_x+'px');} else if(horizontal_align=='right'){wstazka.css('right',position_x+'px');} else{wstazka.css('left','50%');position_x_center=0-parseInt(width/2)+parseInt(position_x);wstazka.css('margin-left',position_x_center+'px');} if(bg_type=='rect'||bg_type=='circ'){wstazka.css('background-color',color);if(bg_type=='circ'){wstazka.css('border-radius','100%');}} if(font_color.length>0){wstazka.css('color',font_color);} if(font_size.length>0){wstazka.css('font-size',font_size+'px');} if(font.length>0){wstazka.css('font-family',font);} if(bold=='1'){wstazka.css('font-weight','bold');} if(italic=='1'){wstazka.css('font-style','italic');} if(underscore=='1'){wstazka.css('text-decoration','underline');}} product.find(product_image_class).append(wstazka);}}});} $(document).on("wceAppDynamiclistCustomCallback",function(e,data){data.$products.each(function(){var product=$(this);product_image_class=false;if(product.find('.prodimage').length>0){product_image_class='.prodimage';} else if(product.find('.boximgsize').length>0){product_image_class='.boximgsize';} if(shop_id=='186'){old_price=parseFloat(product.find('div.price .mx_mod_otherprice').text());if(old_price>0){price=parseFloat(product.find('div.price em').text().replace(/[^0-9.,]/g,"").replace('.','').replace(',','.'));if(amount_type=='procent'){show_text='-'+Math.round(100-(price*100 / old_price))+'%';} else{currency=product.find('div.price del').first().text().replace(/[0-9.,]/g,"");show_text='-'+(old_price-price).toFixed(2).replace('.',',')+currency;} let wstazka=$('
');wstazka.addClass('maxsote_app_wstazka');wstazka.text(show_text);if(bg_type!='reset'){product.find(product_image_class).css('position','relative');wstazka.css('position','absolute');wstazka.css('z-index','9');wstazka.css('text-align','center');wstazka.css('width',width+'px');wstazka.css('height',height+'px');wstazka.css('line-height',height+'px');if(vertical_align=='top'){wstazka.css('top',position_y+'px');} else{wstazka.css('bottom',position_y+'px');} if(horizontal_align=='left'){wstazka.css('left',position_x+'px');} else if(horizontal_align=='right'){wstazka.css('right',position_x+'px');} else{wstazka.css('left','50%');position_x_center=0-parseInt(width/2)+parseInt(position_x);wstazka.css('margin-left',position_x_center+'px');} if(bg_type=='rect'||bg_type=='circ'){wstazka.css('background-color',color);if(bg_type=='circ'){wstazka.css('border-radius','100%');}} if(font_color.length>0){wstazka.css('color',font_color);} if(font_size.length>0){wstazka.css('font-size',font_size+'px');} if(bold=='1'){wstazka.css('font-weight','bold');} if(italic=='1'){wstazka.css('font-style','italic');} if(underscore=='1'){wstazka.css('text-decoration','underline');}} product.find(product_image_class).append(wstazka);} else{if(product.find('div.price del').length>0&&product_image_class){old_price=parseFloat(product.find('div.price del').text().replace(/[^0-9.,]/g,"").replace('.','').replace(',','.'));price=parseFloat(product.find('div.price em').text().replace(/[^0-9.,]/g,"").replace('.','').replace(',','.'));if(amount_type=='procent'){show_text='-'+Math.round(100-(price*100 / old_price))+'%';} else{currency=product.find('div.price del').first().text().replace(/[0-9.,]/g,"");show_text='-'+(old_price-price).toFixed(2).replace('.',',')+currency;} let wstazka=$('
');wstazka.addClass('maxsote_app_wstazka');wstazka.text(show_text);if(bg_type!='reset'){product.find(product_image_class).css('position','relative');wstazka.css('position','absolute');wstazka.css('z-index','9');wstazka.css('text-align','center');wstazka.css('width',width+'px');wstazka.css('height',height+'px');wstazka.css('line-height',height+'px');if(vertical_align=='top'){wstazka.css('top',position_y+'px');} else{wstazka.css('bottom',position_y+'px');} if(horizontal_align=='left'){wstazka.css('left',position_x+'px');} else if(horizontal_align=='right'){wstazka.css('right',position_x+'px');} else{wstazka.css('left','50%');position_x_center=0-parseInt(width/2)+parseInt(position_x);wstazka.css('margin-left',position_x_center+'px');} if(bg_type=='rect'||bg_type=='circ'){wstazka.css('background-color',color);if(bg_type=='circ'){wstazka.css('border-radius','100%');}} if(font_color.length>0){wstazka.css('color',font_color);} if(font_size.length>0){wstazka.css('font-size',font_size+'px');} if(font.length>0){wstazka.css('font-family',font);} if(bold=='1'){wstazka.css('font-weight','bold');} if(italic=='1'){wstazka.css('font-style','italic');} if(underscore=='1'){wstazka.css('text-decoration','underline');}} product.find(product_image_class).append(wstazka);}}} else{if(product.find('div.price del').length>0&&product_image_class){if(flag_omnibus&&product.find('div.price .f-row .price__inactive').length){old_price=parseFloat(product.find('div.price .f-row .price__inactive').text().replace(/[^0-9.,]/g,"").replace('.','').replace(',','.'));} else{old_price=parseFloat(product.find('div.price del').text().replace(/[^0-9.,]/g,"").replace('.','').replace(',','.'));} price=parseFloat(product.find('div.price em').text().replace(/[^0-9.,]/g,"").replace('.','').replace(',','.'));if(amount_type=='procent'){if(Math.round(100-(price*100 / old_price))==0)return true;show_text='-'+Math.round(100-(price*100 / old_price))+'%';} else{currency=product.find('div.price del').first().text().replace(/[0-9.,]/g,"");show_text='-'+(old_price-price).toFixed(2).replace('.',',')+currency;} if(!(current_lang in translations_array['prefix_lista'])){show_text=translations_array['prefix_lista']['__default']+show_text;} else{show_text=translations_array['prefix_lista'][current_lang]+show_text;} wstazka=$('
');wstazka.addClass('maxsote_app_wstazka');wstazka.text(show_text);if(bg_type!='reset'){product.find(product_image_class).css('position','relative');wstazka.css('position','absolute');wstazka.css('z-index','9');wstazka.css('text-align','center');wstazka.css('width',width+'px');wstazka.css('height',height+'px');wstazka.css('line-height',height+'px');if(vertical_align=='top'){wstazka.css('top',position_y+'px');} else{wstazka.css('bottom',position_y+'px');} if(horizontal_align=='left'){wstazka.css('left',position_x+'px');} else if(horizontal_align=='right'){wstazka.css('right',position_x+'px');} else{wstazka.css('left','50%');position_x_center=0-parseInt(width/2)+parseInt(position_x);wstazka.css('margin-left',position_x_center+'px');} if(bg_type=='rect'||bg_type=='circ'){wstazka.css('background-color',color);if(bg_type=='circ'){wstazka.css('border-radius','100%');}} if(font_color.length>0){wstazka.css('color',font_color);} if(font_size.length>0){wstazka.css('font-size',font_size+'px');} if(font.length>0){wstazka.css('font-family',font);} if(bold=='1'){wstazka.css('font-weight','bold');} if(italic=='1'){wstazka.css('font-style','italic');} if(underscore=='1'){wstazka.css('text-decoration','underline');}} product.find(product_image_class).append(wstazka);}}});});});});