<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Store</name><description>Create an online store</description><help>
			With the Store Block, you can create your own e-commerce website.&lt;br&gt; You can create as many categories as you need (shoes, t-shirts, bikes, ...) to sort your products. The categories can be easily renamed and sorted by clicking on the &quot;Manage categories&quot; button.&lt;br&gt; A product can be added to multiple categories.&lt;br&gt; Each Store Block is configurable to display the categories you want.&lt;br&gt; If your website uses the Pro package, configure your payment account and get paid directly via PayPal by the visitors. 
</help><api_version>1.0</api_version><server>local://StoreCptServer</server><size height='400' width='800' /><blog en='149' fr='148' /><max bg='0' url='1' /></metadata><view><content>&lt;div class=&quot;uis_warn&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;uis_bill&quot;&gt;
	&lt;div class=&apos;uis_bill_page uis_bill_c&apos;&gt;&lt;/div&gt;
	&lt;div class=&apos;uis_bill_page uis_bill_f&apos; style=&apos;display:none&apos;&gt;
		&lt;div class=uis_btn&gt;&lt;span class=&quot;uis_bsa uis_sc&quot;&gt;&amp;lt;&amp;lt; Back to Cart&lt;/span&gt;&lt;span class=&quot;uis_bse&quot;&gt;&lt;/span&gt;&lt;/div&gt;
		&lt;div class=uis_bill_mn&gt;&lt;h2&gt;Your details&lt;/h2&gt;&lt;div class=&apos;uis_bfb&apos;&gt;&lt;/div&gt;&lt;/div&gt;		
		&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;td colspan=2&gt;&lt;span class=_ui18_do_member_signup&gt;Please fill in your coordinates below&lt;/span&gt;&lt;span class=member_unconnected&gt; or &lt;span class=_ui18_do_member_signin&gt;Sign-in&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=2 class=&apos;uis_cerr&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;
		&lt;tbody class=&apos;uis_bft&apos;&gt;&lt;/tbody&gt;
		&lt;tfoot&gt;&lt;tr&gt;&lt;td colspan=2&gt;* Fields are required&lt;/td&gt;&lt;/tfoot&gt;&lt;/table&gt;
		&lt;div class=uis_btn style=&apos;float:right&apos;&gt;&lt;span class=&quot;uis_bsa uis_sbpm&quot;&gt;Next step &amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;uis_bse&quot;&gt;&lt;/span&gt;&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&apos;uis_bill_page uis_bill_cb&apos; style=&apos;display:none&apos;&gt;
        &lt;div class=uis_btn&gt;&lt;span class=&quot;uis_bsa uis_sc&quot;&gt;&amp;lt;&amp;lt; Back to Cart&lt;/span&gt;&lt;span class=&quot;uis_bse&quot;&gt;&lt;/span&gt;&lt;/div&gt;
        &lt;div class=uis_bill_mn&gt;&lt;h2&gt;Credit card selection&lt;/h2&gt;&lt;/div&gt;     
        &lt;div class=uis_cb_form&gt;&lt;/div&gt;
    &lt;/div&gt;
	&lt;div class=&apos;uis_bill_page uis_bill_m&apos; style=&apos;display:none&apos;&gt;
		&lt;div class=uis_bill_mn&gt;&lt;h2&gt;Congratulations&lt;/h2&gt;&lt;div class=&apos;uis_bfa&apos;&gt;&lt;/div&gt;&lt;/div&gt;
		&lt;div style=&quot;width: 100%; text-align: center; clear: both;&quot;&gt;
            &lt;span class=uis_btn style=&quot;display:inline-block;float:none&quot;&gt;&lt;span class=&quot;uis_bsa uis_back_to_store&quot;&gt;Back to Store&lt;/span&gt;&lt;span class=&quot;uis_bse&quot;&gt;&lt;/span&gt;&lt;/span&gt;
			&lt;span class=uis_btn style=&quot;display:inline-block;float:none&quot;&gt;&lt;span class=&quot;uis_bsa uis_order_follow&quot;&gt;Order follow&lt;/span&gt;&lt;span class=&quot;uis_bse&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
		    &lt;a href=&quot;#&quot; class=&quot;uis_sc&quot;&gt;Choose another payment method&lt;/a&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;uis_catalog&quot;&gt;
	&lt;div class=&quot;uis_search&quot;&gt;
		&lt;div&gt;
			&lt;div&gt;
				&lt;input type=&quot;text&quot; placeholder=&quot;Search a product, category, ...&quot;&gt;
				&lt;span id=&quot;uis_search_loading&quot;&gt;&lt;/span&gt;
			&lt;/div&gt;
			&lt;div class=&quot;uis_btn&quot;&gt;
				&lt;span class=&quot;fonticon&quot;&gt;&lt;/span&gt;
			&lt;/div&gt;
			&lt;div class=&quot;uis_close_search&quot;&gt;
				&lt;span class=&quot;fonticon&quot;&gt;&lt;/span&gt;
				&lt;div class=&quot;close_tooltip&quot;&gt;&lt;span&gt;Close search&lt;/span&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
		&lt;div class=uis_search_suggest&gt;
			&lt;div class=uis_suggest_category&gt;&lt;h3&gt;Categories&lt;/h3&gt;&lt;/div&gt;
			&lt;div class=uis_suggest_word&gt;&lt;h3&gt;Keywords&lt;/h3&gt;&lt;/div&gt;
			&lt;div class=uis_suggest_product&gt;&lt;h3&gt;Products&lt;/h3&gt;&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;uis_cat&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;uis_list&quot;&gt;
		&lt;div class=&quot;uis_search_header&quot;&gt;
			&lt;div class=&quot;uis_nbr_search_results&quot;&gt;&lt;/div&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uis_sort&quot;&gt;Sort by: &lt;span class=&quot;uis_sn uis_ss&quot; data-sort=&quot;n&quot;&gt;Name&lt;/span&gt; - &lt;span class=&quot;uis_sp&quot; data-sort=&quot;p&quot;&gt;Price&lt;/span&gt;&lt;/div&gt;
		&lt;div class=&quot;uis_pages&quot;&gt;&lt;/div&gt;
		&lt;ul&gt;&lt;/ul&gt;
		&lt;div class=&quot;uis_pages&quot;&gt;&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;uis_prod&quot;&gt;
		&lt;table width=&quot;100%&quot;&gt;&lt;tr&gt;
		&lt;td class=&quot;uis_td_imgs&quot;&gt;&lt;div&gt;
			&lt;div class=&quot;uis_img&quot;&gt;&lt;/div&gt;
			&lt;div class=&quot;uis_imgs&quot;&gt;
				&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;&lt;/td&gt;
		&lt;td class=&quot;uis_td_attr&quot;&gt;
			&lt;input type=&quot;hidden&quot; class=&quot;uis_prodid&quot;&gt;
			&lt;div class=&quot;uis_name&quot;&gt;&amp;nbsp;&lt;/div&gt;
			&lt;div&gt;&lt;table cellspacing=0 cellpadding=0&gt;&lt;tr class=&quot;uis_prod_cat&quot;&gt;
				&lt;td style=&quot;white-space: nowrap;&quot;&gt;&lt;b&gt;Categories:&lt;/b&gt;&lt;/td&gt;
				&lt;td&gt;&lt;ul class=&apos;uis_cat_list&apos;&gt;&lt;/ul&gt;&lt;/td&gt;
			&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
			&lt;div class=&quot;uis_price&quot;&gt;&lt;/div&gt;
			&lt;div class=&quot;uis_strike&quot;&gt;&lt;/div&gt;
			&lt;div class=&quot;uis_price_opts&quot;&gt;&lt;/div&gt;
			&lt;div class=&quot;uis_opt&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
		&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
		&lt;div class=&quot;uis_td_desc&quot;&gt;
			&lt;div class=&quot;uit_tbl uit_tbl_m&quot;&gt;
				&lt;div class=&quot;uit_ct&quot;&gt;
					&lt;div class=&quot;tl&quot;&gt;&lt;/div&gt;
					&lt;div class=&quot;tr&quot;&gt;&lt;/div&gt;
					&lt;div class=&quot;br&quot;&gt;&lt;/div&gt;
					&lt;div class=&quot;bl&quot;&gt;&lt;/div&gt;
					&lt;div class=&quot;c&quot;&gt;									
						&lt;div class=&quot;uis_seo_description&quot;&gt;
							&lt;b&gt;Search engine description (optional, 160 characters)&lt;/b&gt;
							&lt;textarea maxlength=160&gt;&lt;/textarea&gt;				
						&lt;/div&gt;
						&lt;div class=&quot;uis_desc uit_cttxt uit_cttxt_m&quot; uitype=&quot;editor&quot; placeholder=&quot;Enter the product description here&quot; uiname=&quot;description&quot; uinocb=&quot;true&quot;&gt;&lt;/div&gt;
					&lt;/div&gt;
				&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;</content><properties><hidden default='true' name='show_cat_all' /><server_manage help='Configure the payment methods.' icon='cb' name='payment_conf' text='Payment methods' url='/store_provider/all' /><server_manage help='Configure the shipping costs.' icon='send' name='shipping_conf' text='Shipping costs' url='/store_shipping/shipping/' /><server_manage help='Cart options can be useful to offer extra customized services.' icon='block' name='cart_options' text='Cart options' url='/store_options/options/' /><server_manage help='Create and manage your store coupons' icon='order' name='coupons_conf' text='Coupons' url='/store_coupon/list/' /><server_manage help='This feature allow the generation of valid bills for each received order.' icon='clipboard' name='billing_conf' text='Billing' url='/store_provider/billing/' /><server_manage help='This feature manages your product stocks (and their options), when an order is placed on your online shop' icon='stock' name='stocks_conf' text='Stocks' url='/cpt_store/stock_manage/' /><server_manage help='Add, delete, rename and order categories. Choose which categories are shown in this block.' icon='folder' name='manage' text='Manage Categories' url='/cpt_store/cat_manage' /></properties><design_properties><select class='uis_prop_style' default='&apos;m&apos;' display='Material design|Small, with borders|Large, no borders|Horizontal list' help='Set the style of the product list.' name='style' values='m|s|l|h' /><number default='3' help='Set how many rows of products are shown per page.' maximum='25' minimum='1' name='rows' title='Rows' /><checkbox default='true' help='By activating this feature, your visitors will be able to &lt;b&gt;search your store&lt;/b&gt; for products or categories.' name='search_field' plans='2' value='Search field' /><checkbox default='true' help='If checked, the height of the block will automatically be adapted to its content, possibly hiding blocks below it. In the other case a scrollbar will appear.' name='auto_size' value='Auto-Size' /><checkbox default='false' help='By activating this feature, &lt;b&gt;your visitors will not be able to download these images&lt;/b&gt; by right clicking on an image or by drag-dropping it or by browsing the source of the page.' name='protect' value='Anti-download' /><checkbox default='true' help='If checked, when the content of the page is loaded or the store page changes (product, shopping cart, category page...), the page will be automatically scrolled to the store block top.' name='auto_scroll' value='Auto-scroll' /><checkbox class='uis_prop_sitew' default='true' help='Enables stock status display: Available, Out of stock, Only X item(s) left.' name='show_stocks' plans='2' value='Show stock status' /><number class='uis_prop_sitew_sub' default='10' help='Allows to set the minimum product quantity to display an alert message such as &apos;Only X item(s) left&apos;' maximum='25' minimum='1' name='stock_limit' title='Set minimum stock level' /></design_properties></view><script>var Cache=Class.create();
Cache.prototype={initialize:function(){this.cache={}
},compute_default:function(){return null
},get:function(c,b){var d=this.cache[c]||(this.cache[c]=(b||this.compute_default)());
if(d.done){var a=this;
d.done(function(e){a.cache[c]=e
})
}return d
}};
UI_Store={init:function(){sigCtl.connect(&quot;Theme.changed&quot;,function(){if(!$(&quot;.accept_bg&quot;).length&amp;&amp;UI_Store.cpts.collect(function(a){return a.data.style
}).include(&quot;m&quot;)){UI_Store.cpts.each(function(a){a.ui._setProdListStyle()
})
}})
},cart:{items:{},num:0,price:0,coupons:[],options:{}},conf:{},cpts:[],categories:{},products:{},thumb_size:110,cache:new Cache(),getPaymentConf:function(b){var a=this;
this.cpts[0].ask({request:&quot;get_conf&quot;},function(c){a.conf=c;
if(b){b.call()
}},function(c){dbg.error(&quot;Impossible to get the payment conf.\n&quot;+c.join(&quot;\n&quot;))
})
},getCategories:function(a,d,c){if(this.cpts.length==0||!this.cpts[0].idserver){return
}if(this.load_req_sent&amp;&amp;!this.loaded){setTimeout(function(){UI_Store.getCategories(a,d,c)
},200);
return
}if(a&amp;&amp;this.loaded){if(d){d.call()
}return sigCtl.emit(&quot;UI_Store.updateCatListGui&quot;)
}this.load_req_sent=true;
var b=this;
(c||this.cpts[0]).ask({request:&quot;get_categories&quot;,all:(v.mode==&quot;editor&quot;),site:v.site_id},function(e){b.loaded=true;
if(e.conf){b.conf=e.conf
}b.coupon=e.coupon;
b.nopid=e.nopid;
b.trackers=e.trackers;
b.update_category_list(e.categories);
if(d){d.call(this,e.options)
}sigCtl.emit(&quot;UI_Store.updateCatListGui&quot;)
},function(e){dbg.error(&quot;Impossible to get the category list.\n&quot;+e.join(&quot;\n&quot;))
})
},getProducts:function(b){var a=this;
return a.cpts[0].ask({request:&quot;get_products&quot;,product_ids:b,all:(v.mode==&quot;editor&quot;)},function(d){var c=b.collect(function(e){return parseInt(e)
}).diff(d.products.collect(function(e){return parseInt(e.id)
}));
if(c.length&gt;0){c.each(function(e){delete UI_Store.cart.items[e]
})
}a.update_product_list(d.products,true)
},function(c){dbg.error(&quot;Impossible to get the products.\n&quot;+c.join(&quot;\n&quot;))
})
},getProduct:function(c,b){var a=this;
a.cpts[0].ask({request:&quot;get_product&quot;,product_id:c,all:(v.mode==&quot;editor&quot;)},function(d){a.products[c].desc=d.desc;
if(b){b.call(this,d.desc)
}},function(d){dbg.error(&quot;Impossible to get the product description.\n&quot;+d.join(&quot;\n&quot;))
})
},update_category_list:function(b,a){this.categories=b.to_h(a?this.products:null)
},update_product_list:function(b,a){this.checkCartItems(b);
this.products=b.to_h(a?this.products:null)
},add_product:function(b){this.products[b.id]=b;
this.categories[0].products=this.categories[0].products.insertAt(b.id,b.all[0]);
this.categories[0].products_by_price=this.categories[0].products_by_price.insertAt(b.id,b.all[1]);
var a=this;
b.category_ids.each(function(d){var e=a.categories[d[0]];
if(e){e.products=e.products.insertAt(b.id,d[1]);
e.products_by_price=e.products_by_price.insertAt(b.id,d[2])
}});
delete this.products[b.id].all;
this.products[b.id].category_ids=this.products[b.id].category_ids.collect(function(d){return d[0]
})
},del_product:function(b){delete this.products[b.id];
this.categories[0].products.removeAll(b.id);
this.categories[0].products_by_price.removeAll(b.id);
var a=this;
b.category_ids.each(function(d){var e=a.categories[d];
if(e){e.products.removeAll(b.id);
e.products_by_price.removeAll(b.id)
}})
},checkCoupon:function(c,b){if(this.coupon&amp;&amp;(this.cart.coupons.length==0||!b&amp;&amp;confirm(&quot;Only one coupon code is allowed. Do you want to replace the one already in your cart?&quot;))){this.cart.coupons=[];
var a=this;
this.cpts[0].ask({request:&quot;check_coupon&quot;,site:v.site_id,code:c},function(d){if(d.error){if(!b){alert(d.error)
}}else{d.code=c;
a.cart.coupons.push(d);
$(&quot;.uis_bill .uis_coup_f&quot;).hide()
}UI_Store.updateCartHtml()
},function(d){dbg.error(&quot;Impossible to check coupon.\n&quot;+d.join(&quot;\n&quot;))
})
}else{$(&quot;.uis_bill .uis_coup_f&quot;).hide()
}},cleanCartOptions:function(){for(var a in this.cart.options){if(this.conf.options.find(function(b){return b.name==a
})==null){delete this.cart.options[a]
}}},checkCartOptions:function(c,a,d){var b=true;
$(&quot;input, textarea&quot;,c).each(function(){input=$(this);
var f=a.find(function(g){return g.name.html_encode()==input.attr(&quot;name&quot;).html_encode()
});
input.removeClass(&quot;uis_options_error&quot;).parent().find(&quot;.uis_options_error_message&quot;).remove();
var e=input.val();
if(((d||!input.attr(&quot;firstTime&quot;)))&amp;&amp;(e.length&lt;f[&quot;&gt;&quot;]||e.length&gt;f[&quot;&lt;&quot;])){input.addClass(&quot;uis_options_error&quot;).parent().append(&quot;&lt;div class=&apos;uis_options_error_message&apos;&gt;&quot;+(sprintf(&quot;This cart option must contain %1$d to %2$d characters.&quot;,f[&quot;&gt;&quot;],f[&quot;&lt;&quot;]))+&quot;&lt;/div&gt;&quot;);
b=false
}});
$(&quot;select&quot;,c).each(function(f,h){var e=$(h);
e.removeClass(&quot;uis_options_error&quot;).parent().find(&quot;.uis_options_error_message&quot;).remove();
var g=e.val();
if((d||!e.attr(&quot;firstTime&quot;))&amp;&amp;g==&quot;uis_no_select&quot;){e.addClass(&quot;uis_options_error&quot;).parent().append(&quot;&lt;div class=&apos;uis_options_error_message&apos;&gt;Please choose an option.&lt;/div&gt;&quot;);
b=false
}});
return b
},checkCartItems:function(product_list){var self=this,product_missing=[];
$.each(this.cart.items,function(prod_id,option_amount){var prod=(product_list?product_list.find(function(p){return p.id==prod_id
}):UI_Store.products[prod_id]);
if(!prod){product_missing.push(prod_id);
return
}var all_option_invalid=true;
if(option_amount[&quot;-h-old_cookie&quot;]!=undefined){delete option_amount[&quot;-h-old_cookie&quot;];
$.each(option_amount,function(option_key,amount){delete self.cart.items[prod_id][option_key];
var new_options=[];
var options=option_key.split(&quot; ; &quot;);
if(options.length==prod.opts.length){var opt_used=[],old_option_valid=true;
for(var i=0;
old_option_valid&amp;&amp;i&lt;options.length;
i++){var opt=prod.opts.find(function(prod_opt){return(!opt_used.include(prod_opt.name)&amp;&amp;prod_opt.options&amp;&amp;prod_opt.options[options[i]]!=undefined)
});
if(!opt){old_option_valid=false
}else{opt_used.push(opt.name);
new_options.push([opt.options[options[i]].n,opt.order,opt.name,options[i]])
}}if(old_option_valid){new_options.sort(function(a,b){return a[0]-b[0]
});
new_options=$.map(new_options,function(a){return[[a[2],a[3]]]
});
option_key=JSON_.stringify(new_options);
self.cart.items[prod_id][option_key]=amount
}}});
option_amount=self.cart.items[prod_id]
}$.each(option_amount,function(option_key,amount){var options,option_valid=true;
options=eval(option_key);
var new_option_key=[];
var stock_key=[];
if(options!=null&amp;&amp;options.length==prod.opts.length){options.each(function(ov){var option=ov[0],value=ov[1];
if(!option_valid){return
}var prod_opt_id=prod.opts.find_index(function(prod_opt){if(prod_opt.name==option){if(prod_opt.options==undefined){var r=!(value.length&lt;prod_opt[&quot;&gt;&quot;]||value.length&gt;prod_opt[&quot;&lt;&quot;]);
return r
}else{var opt_exist=false;
var stock_managed=false;
$.each(prod_opt.options,function(val){if(value.html_encode()==val){opt_exist=true;
stock_managed=prod_opt.options[val].s
}});
stock_key.push(stock_managed?value.html_encode():&quot;|&quot;);
return opt_exist
}}else{return false
}});
if(prod.opts.length!=0&amp;&amp;!(prod_opt_id||prod_opt_id==0)){option_valid=false
}else{new_option_key[prod_opt_id]=ov
}});
if(option_valid){var new_option_key_s=JSON_.stringify(new_option_key);
if(new_option_key_s!=option_key){self.cart.items[prod_id][new_option_key_s]=self.cart.items[prod_id][option_key];
delete self.cart.items[prod_id][option_key];
options=new_option_key;
option_key=new_option_key_s
}var stock_key=JSON_.stringify(stock_key);
var amount_min=Math.min(self.cart.items[prod_id][option_key],Math.min(prod.max,(prod.stocks[stock_key]||prod.stocks[stock_key]==0)?prod.stocks[stock_key]:prod.max));
self.cart.items[prod_id][option_key]=amount_min;
if(self.cart.items[prod_id][option_key]&lt;1){option_valid=false
}}}else{option_valid=false
}all_option_invalid&amp;=!option_valid;
if(!option_valid){delete self.cart.items[prod_id][option_key]
}});
if(all_option_invalid){delete self.cart.items[prod_id]
}});
return product_missing
},option2select:function(g,f){var e=&quot;&lt;div class=&apos;select_style&apos;&gt;&quot;;
e+=&quot;&lt;select name=&apos;&quot;+g.name.html_encode()+&quot;&apos; &quot;+(f==undefined?&quot;firstTime=1 &quot;:&quot;&quot;)+&quot; style=&apos;width:100%&apos;&gt;&quot;;
var d=[];
for(var a in g.options){var b=jQuery.extend({},g.options[a]);
b.name=a;
d.push(b)
}d=d.sort(function(i,h){return i.n-h.n
});
if(g.label){e+=&quot;&lt;option value=&apos;uis_no_select&apos; class=&apos;label&apos;&gt; - &quot;+g.label+&quot; - &lt;/option&gt;&quot;
}for(var c=0;
c&lt;d.length;
c++){var a=d[c];
a.p=parseInt(a.p);
e+=&quot;&lt;option value=&apos;&quot;+a.name+&quot;&apos;&quot;;
if(a.s){e+=&quot; data-managed=true&quot;
}if((!f&amp;&amp;!g.label)||f==a.name){f=a.name;
e+=&quot; selected=&apos;selected&apos;&quot;
}e+=&quot;&gt;&quot;+a.name+(a.p&gt;0?&quot; (+&quot;+UI_Store.show_price(a.p/100)+&quot;)&quot;:&quot;&quot;)+&quot;&lt;/option&gt;&quot;
}e+=&quot;&lt;/select&gt;&lt;/div&gt;&quot;;
return e
},option2input:function(b,a){var c=(b[&quot;&lt;&quot;]&gt;25);
if(a){a.substr(0,b[&quot;&lt;&quot;])
}return(&quot;&lt;&quot;+(c?&quot;textarea style=&apos;resize: none;&apos; cols=25 rows=&quot;+Math.floor(b[&quot;&lt;&quot;]/25-1):&quot;input type=text value=&apos;&quot;+(a||&quot;&quot;)+&quot;&apos; &quot;)+&quot; name=&apos;&quot;+b.name.html_encode()+&quot;&apos; &quot;+(a==undefined?&quot;firstTime=1 &quot;:&quot;&quot;)+&quot;maxlength=&apos;&quot;+b[&quot;&lt;&quot;]+&quot;&apos; &quot;+(c?&quot;&gt;&quot;+(a||&quot;&quot;)+&quot;&lt;/textarea&quot;:&quot; /&quot;)+&quot;&gt;&quot;)
},options2html:function(b){var a=this;
if(b.length==0){return&quot;&quot;
}else{if(b.length==1){return this.option2html(b[0])
}else{return&quot;&lt;ul&gt;&lt;li&gt;&quot;+$.map(b,function(c){return a.option2html(c)
}).join(&quot;&lt;li&gt;&quot;)+&quot;&lt;/ul&gt;&quot;
}}},option2html:function(a){return(a[0].match(/^-h-\d+/)?&quot;&quot;:&quot;&lt;b&gt;&quot;+a[0]+&quot;:&lt;/b&gt; &quot;)+a[1]
},catjoin:function(e){var c=&quot;&quot;;
var b=[];
for(var d in UI_Store.categories){b.push(UI_Store.categories[d])
}b.sort(function(a,f){return a.order-f.order
});
b.each(function(a){c+=(e.call(a,d))
});
return c
},addCpt:function(a){this.cpts.push(a);
if(!this.cpts[0].idserver&amp;&amp;a.idserver){this.cpts.reverse()
}},remCpt:function(a){this.cpts.remove(a)
},setImage:function(g,f,k,d,a){var m=this,n=f[0],e=((this.cpts[0].data.protect||v.page_bg.security.content_protection)&amp;&amp;v.mode!=&quot;editor&quot;);
if(!k){k=[g.width(),null]
}g.setImage(n,k[0],k[1],{protect:e});
if(v.mode==&quot;viewer&quot;&amp;&amp;d){g.unbind(&quot;click&quot;).click(function(){tb_show(&quot;&quot;,0,f,e)
})
}if(a){a.hide().unbind(&quot;click&quot;).parent().hide();
if(f.length&gt;1){var c=(f.length&gt;3?1:0);
for(var b=c;
b&lt;=a.length&amp;&amp;b&lt;f.length;
b++){var l=$(a[b-c]),h=200;
l.setImage(f[b],Math.min(Math.max(f[b].width,f[b].height),UI_Store.thumb_size),null,{protect:e});
l.show().parents(&quot;.uis_imgs:first&quot;).show(0,(function(p,i,q){var o=q.find(&quot;span:last&quot;);
if(!o.length){o=q.find(&quot;img:first&quot;)
}m._setZoomProduct(o,f[p]);
if(v.mode==&quot;viewer&quot;){q.click(function(){tb_show(&quot;&quot;,p,i,e);
return false
})
}})(b,f,l))
}}}},_setZoomProduct:function(d,a,b){if(b){$(&quot;.zoomContainer, .zoomWindowContainer&quot;).remove();
$.removeData(d.find(&quot;img&quot;),&quot;elevateZoom&quot;)
}else{var c=d.closest(&quot;.component&quot;),e=c.hasClass(&quot;uis_prod_responsive&quot;)?c.find(&quot;.uis_td_imgs .uis_img&quot;):c.find(&quot;.uis_td_attr&quot;);
d.data(&quot;zoom-image&quot;,a.url);
if(!e.is(d.closest(&quot;.uis_img&quot;))){d.elevateZoom({zoomWindowFadeIn:200,zoomWindowFadeOut:200,zoomWindowPosition:e,zoomWindowWidth:e.width(),zoomWindowHeight:e.height(),borderSize:0,scrollZoom:true,zoomWindowBgColour:&quot;transparent&quot;,cursor:&quot;pointer&quot;})
}else{d.elevateZoom({zoomWindowFadeIn:200,zoomWindowFadeOut:200,zoomType:&quot;inner&quot;,cursor:&quot;crosshair&quot;,borderSize:0,cursor:&quot;pointer&quot;})
}}},loadCookie:function(){try{var c=$.cookie(&quot;uis_cart&quot;);
if(c){eval(&quot;var j=&quot;+c.obfuscate());
if(j&amp;&amp;j.num){this.cart=j
}}else{var c=$.cookie(&quot;uis&quot;);
if(c){eval(&quot;var j=&quot;+c.obfuscate());
if(j&amp;&amp;j.num){this.cart=j;
for(var i in this.cart.items){this.cart.items[i][&quot;-h-old_cookie&quot;]=true
}}}}if(this.cart.coupons&amp;&amp;this.cart.coupons.length&gt;0){var c=this.cart.coupons[0].code;
this.cart.coupons=[];
this.checkCoupon(c,true)
}else{this.cart.coupons=[]
}if(this.cart.options){this.cleanCartOptions()
}else{this.cart.options={}
}this.saveCookie()
}catch(e){dbg.error(&quot;Error loading store cookie&quot;,$.cookie(&quot;uis&quot;));
return $.cookie(&quot;uis_cart&quot;,null)
}},saveCookie:function(){$.cookie(&quot;uis_cart&quot;,JSON_.stringify(this.cart).obfuscate(),{expires:365,path:&quot;/&quot;})
},updateItem:function(a,b,e,d,f){b=parseInt(b);
if(typeof this.cart.items[a.id]!=&quot;object&quot;){this.cart.items[a.id]={}
}var c=parseInt(this.cart.items[a.id][e]|=0);
if(b!=NaN){if(d&amp;&amp;b&gt;0&amp;&amp;b==c){return
}else{if(b&gt;0){this.cart.items[a.id][e]=b+(d?0:c)
}else{delete UI_Store.cart.items[a.id][e];
if(UI_Store.cart.items[a.id].length==0){delete UI_Store.cart.items[a.id]
}}}}else{this.cart.items[a.id][e]+=1
}if(!f){this.updateCartHtml()
}},updateItems:function(b){if(b.length&gt;0){for(var c=0;
c&lt;b.length;
c++){if(!UI_Store.products[b[c][0]]){delete UI_Store.cart.items[b[c][0]]
}else{this.updateItem(UI_Store.products[b[c][0]],b[c][1],b[c][2],true,true)
}}this.updateCartHtml()
}},removeItems:function(){this.cart={items:{},num:0,price:0,coupons:this.cart.coupons||[],options:{}};
$.cookie(&quot;uis_last_unpaid_order&quot;,null);
this.updateCartHtml()
},createCartHtml:function(){var b=this;
this.html=$(&apos;&lt;div style=&quot;display:none&quot;&gt;&lt;/div&gt;&apos;).appendTo(&quot;body&quot;);
if(this.conf.methods.paypal){this.pp_form=$(&apos;&lt;form action=&quot;https://www.paypal.com/cgi-bin/webscr&quot; method=&quot;post&quot;&gt;&lt;input type=&quot;submit&quot;&gt;&lt;INPUT TYPE=&quot;hidden&quot; name=&quot;charset&quot; value=&quot;utf-8&quot;&gt;&lt;INPUT TYPE=&quot;hidden&quot; name=&quot;FORMcharset&quot; value=&quot;utf-8&quot;&gt;&lt;input id=&quot;pp_custom&quot; type=&quot;hidden&quot; name=&quot;custom&quot; value=&quot;&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;no_shipping&quot; value=&quot;2&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;country&quot; value=&quot;US&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;shipping&quot; value=&quot;0&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;tax&quot; value=&quot;0&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;no_ird&quot; value=&quot;2&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;cmd&quot; value=&quot;_cart&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;upload&quot; value=&quot;1&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;notify_url&quot; value=&quot;http://www.sitew.com/store_provider/notify/&apos;+this.conf.methods.paypal.id+&apos;&quot;&gt;&lt;input id=&quot;pp_return&quot; type=&quot;hidden&quot; name=&quot;return&quot; value=&quot;&quot;&gt;&lt;input id=&quot;pp_cancel&quot; type=&quot;hidden&quot; name=&quot;cancel_return&quot; value=&quot;&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;currency_code&quot; value=&quot;&apos;+this.conf.currency+&apos;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/form&gt;&apos;).appendTo(this.html);
if(this.conf.methods.paypal.paypal_integral){this.pp_form.attr(&quot;action&quot;,&quot;https://securepayments.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolution&quot;);
this.pp_form.find(&quot;input[name=cmd]&quot;).val(&quot;_hosted-payment&quot;);
this.pp_form.append(&quot;&lt;input type=hidden name=subtotal val=0&gt;&quot;)
}this.pp_return=this.pp_form.find(&quot;#pp_return&quot;);
this.pp_cancel=this.pp_form.find(&quot;#pp_cancel&quot;);
this.pp_custom=this.pp_form.find(&quot;#pp_custom&quot;);
this.pp=this.pp_form.find(&quot;span&quot;)
}this.ct=$(&quot;&lt;div&gt;&lt;div class=title&gt;Your Shopping Cart&lt;/div&gt;&lt;div class=uis_payment_err&gt;&lt;/div&gt;&lt;table class=&apos;main_cart&apos;&gt;&lt;thead&gt;&lt;tr&gt;&lt;td&gt;Product&lt;/td&gt;&lt;td&gt;Price&lt;/td&gt;&lt;td&gt;Quantity&lt;/td&gt;&lt;td&gt;Total&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;tfoot&gt;&lt;tr&gt;&lt;td colspan=3 style=&apos;text-align: right&apos; class=&apos;uis_total_label&apos;&gt;Item Total&lt;/td&gt;&lt;td class=&apos;uis_ar&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=3 class=&apos;uis_extra uis_options&apos;&gt;&lt;div class=&apos;uis_c_thead&apos;&gt;Cart options&lt;/div&gt;&lt;table class=&apos;uis_options_table&apos;&gt;&lt;/table&gt;&lt;/td&gt;&lt;td class=&apos;uis_extra uis_ar uis_option_price&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=3 class=&apos;uis_extra uis_ship&apos;&gt;Shipping costs&lt;/td&gt;&lt;td class=&apos;uis_extra uis_ar&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=3 class=&apos;uis_extra uis_coup&apos;&gt;&lt;/td&gt;&lt;td class=&apos;uis_extra uis_ar&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=uis_total&gt;&lt;td colspan=3 style=&apos;text-align: right&apos; class=&apos;uis_total_label&apos;&gt;&quot;+(this.conf.billing.enabled?&quot;Total with VAT&quot;:&quot;TOTAL&quot;)+&quot;&lt;/td&gt;&lt;td class=&apos;uis_ar&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&quot;+(this.conf.billing.enabled?&quot;&lt;tr class=uis_vat&gt;&lt;td colspan=3 class=&apos;uis_extra uis_total_label&apos;&gt;&quot;+sprintf(&quot;of which VAT at %1$s&quot;,sprintf(&quot;%.1f %%&quot;,this.conf.billing.vat_rate))+&quot;&lt;/td&gt;&lt;td class=&apos;uis_ar uis_extra&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&quot;:&quot;&quot;)+&quot;&lt;/tfoot&gt;&lt;/table&gt;&lt;/div&gt;&quot;);
this.tb=this.ct.find(&quot;tbody&quot;);
$(UI_Store.btn({&quot;class&quot;:&quot;uis_sb&quot;,txt:&quot;&lt;span class=&apos;uis_bsa&apos;&gt;&lt;&lt; Back to Store&lt;/span&gt;&quot;})).prependTo(this.ct);
if(this.coupon){this.cp=$(&quot;&lt;div class=&apos;uis_coup&apos;&gt;&lt;a href=&apos;javascript:&apos;&gt;Do you have a coupon code?&lt;/a&gt;&lt;div class=&apos;uis_coup_f&apos;&gt;&lt;div class=&apos;uis_coup_e&apos;&gt;&lt;/div&gt;Please enter your coupon code:&lt;input type=text&gt;&lt;input type=submit value=&apos;ok&apos;&lt;/div&gt;&lt;/div&gt;&quot;).appendTo(this.ct);
this.cp.find(&quot;a&quot;).click(function(){$(this).parent(&quot;.uis_coup&quot;).find(&quot;.uis_coup_f&quot;).toggle().find(&quot;input:text&quot;).val(&quot;&quot;).focus();
return false
});
this.cp.find(&quot;input:submit&quot;).click(function(){UI_Store.checkCoupon($(this).parent().find(&quot;input:text&quot;).val())
});
this.cp.find(&quot;input:text&quot;).returnKey(function(){UI_Store.checkCoupon($(this).val())
})
}var f=this.pay_btn=$(&quot;&lt;div style=&apos;margin:5px 0&apos;&gt;&lt;/div&gt;&quot;).appendTo(this.ct);
$(UI_Store.btn({txt:&quot;&lt;span class=&apos;uis_bsa&apos;&gt;Update Cart&lt;/span&gt;&quot;})).appendTo(f).click(function(){b.updateCartFromHtml($(this).parents(&quot;.uis_bill:first&quot;))
});
$(UI_Store.btn({txt:&quot;&lt;span class=&apos;uis_bsa&apos;&gt;Empty Cart&lt;/span&gt;&quot;})).appendTo(f).click(function(){if(confirm(&quot;Do you really want to remove all the items?&quot;)){b.removeItems()
}});
var a=$.fn.hash_to_a(b.conf.methods).sort(),g,c=&quot;float:right;clear:right;&quot;,e=&quot;div&quot;;
if(a.length&gt;0){if(a.length&gt;1){f=$(&apos;&lt;div style=&quot;width: 100%; text-align: center; clear: both;padding-top:20px&quot;&gt;&lt;a href=&quot;javascript:&quot; class=&quot;uis_sb&quot;&gt;Continue shopping&lt;/a&gt; or Choose your payment method&lt;br&gt;&lt;/div&gt;&apos;).appendTo(f);
c=&quot;display:inline-block;float:none;&quot;;
e=&quot;span&quot;
}else{f=$(&apos;&lt;div&gt;&lt;div style=&quot;float:right&quot;&gt;&lt;a href=&quot;javascript:&quot; class=&quot;uis_sb&quot;&gt;Continue shopping&lt;/a&gt; or&lt;/div&gt;&lt;/div&gt;&apos;).appendTo(f)
}a.each(function(d){switch(d){case&quot;paypal&quot;:var l=$(&quot;&lt;br&gt;&lt;div style=&apos;&quot;+c+&quot;margin:10px;cursor:pointer;&apos;&gt;&lt;img src=&apos;/assets/partners/cb.png&apos;&gt;&lt;/div&gt;&quot;);
var h=$(UI_Store.btn({node:e,style:c,txt:(&quot;&lt;span class=&apos;uis_bsa uis_pp&apos;&gt;&lt;span class=&apos;fonticon&apos;&gt;&quot;+$.fn.fonticon(&quot;paypal&quot;)+&quot;&lt;/span&gt;&lt;b&gt;Paypal&lt;/b&gt;&lt;/span&gt;&quot;)})).appendTo(f);
$(document).HandleHelpTooltip();
var k=[l,h];
if(a.indexOf(&quot;cb&quot;)==-1){k.push($(UI_Store.btn({node:e,style:c,txt:(&quot;&lt;span class=&apos;uis_bsa&apos;&gt;&lt;span class=&apos;fonticon&apos;&gt;&quot;+$.fn.fonticon(&quot;cb&quot;)+&quot;&lt;/span&gt;&lt;b&gt;Credit card&lt;/b&gt;&lt;/span&gt;&quot;)})).appendTo(f).tooltip(&quot;To pay by credit card, click and then choose the card payment method in the next page.&quot;))
}k.each(function(m){m.click(function(){if(b.cart.num==0){return alert(&quot;Your shopping cart is empty.&quot;)
}if(!UI_Store.checkCartOptions($(this).parents(&quot;.uis_bill_page:first&quot;).find(&quot;.uis_options table&quot;),UI_Store.conf.options,true)){return alert(&quot;Please fill in your cart options.&quot;)
}b.pp_return.val(location.protocol+&quot;//&quot;+location.host+v.selectedPageFg.getUrl(false,&quot;/s1b/Congratulations&quot;));
b.pp_cancel.val(location.protocol+&quot;//&quot;+location.host+v.selectedPageFg.getUrl(false,&quot;/s0b/View-shopping-cart&quot;));
sigCtl.getVariable(&quot;UI_Store.&quot;+b.create_cart_ref,function(n,o){b.pp_custom.val(o);
$.cookie(&quot;uis_last_unpaid_order&quot;,&quot;cart_ref:&quot;+o,{expires:365,path:&quot;/&quot;});
b.pp_form.submit()
})
})
});
break;
default:var i=function(){var m={check:&quot;check_payement&quot;,form:&quot;txt&quot;,transfer:&quot;transfer&quot;};
$(UI_Store.btn({node:e,style:c,txt:(&quot;&lt;span class=&apos;uis_bsa uis_sbp&apos; method=&quot;+d+&quot;&gt;&lt;span class=&apos;fonticon&apos;&gt;&quot;+$.fn.fonticon(m[d])+&quot;&lt;/span&gt;&quot;+(a.length==1?&quot;Check out by &quot;:&quot;&quot;)+&quot;&lt;b&gt;&quot;+b.conf.methods[d][&quot;btn&quot;]+&quot;&lt;/b&gt;&quot;+(a.length==1?&quot; &amp;gt;&amp;gt; &quot;:&quot;&quot;)+&quot;&lt;/span&gt;&quot;)})).appendTo(f)
};
if(!b.conf.methods[d][&quot;testmode&quot;]){i()
}else{sigCtl.getVariable(&quot;User.site_owner&quot;,function(m,n){if(n.owner){i()
}})
}}});
if(g!=null){g.appendTo(f)
}f.find(&quot;.uis_btn&quot;).mousedown(function(){b.callTrackers()
})
}else{f.append(&quot;&lt;div style=&apos;&quot;+c+&quot;&apos;&gt;The merchant did not configure any payment method yet.&lt;br&gt;Please come back later...&lt;/div&gt;&quot;)
}},extractBonusAndStockKey:function(f,h){var g=0;
var c=[];
if(f.opts.length&gt;0){for(var a=0;
a&lt;h.length&amp;&amp;a&lt;f.opts.length;
a++){try{if(f.opts[a].options){var b=h[a][1].html_encode();
if(b!=&quot;uis_no_select&quot;){g+=(parseFloat(f.opts[a].options[b][&quot;p&quot;])||0);
c.push(f.opts[a].options[b][&quot;s&quot;]?b:&quot;|&quot;)
}}}catch(d){dbg.error(&quot;Store TryCatch&quot;,d,h,f.opts,a)
}}}c=JSON_.stringify(c);
return[g,c]
},callTrackers:function(){try{if(UI_Store.trackers){sigCtl.getVariable(&quot;UI_Store.&quot;+UI_Store.create_cart_ref,function(b,c){$.each(UI_Store.trackers,function(h,g){try{var f=UI_Store.cart.total-(UI_Store.cart.shipping||0);
if(UI_Store.conf.billing.vat_rate){f=f/(1+UI_Store.conf.billing.vat_rate/100)
}var l=g.replace(&quot;-CMD-&quot;,c).replace(&quot;-RAWPRICE-&quot;,sprintf(&quot;%.2f&quot;,f)).replace(&quot;-PRICE-&quot;,sprintf(&quot;%.2f&quot;,UI_Store.cart.total));
var d=$(&quot;&lt;img /&gt;&quot;).attr(&quot;src&quot;,l).on(&quot;load&quot;,function(){if(!this.complete||typeof this.naturalWidth==&quot;undefined&quot;||this.naturalWidth==0){dbg.error(&quot;FAIL Loading tracker&quot;,l,this)
}})
}catch(k){dbg.error(&quot;Tracker Call Exception&quot;,g,k)
}})
})
}}catch(a){dbg.error(&quot;Trackers Exception&quot;,a)
}},updateCartHtml:function(prod_loaded){if(!this.html){this.createCartHtml()
}else{if(this.pp){this.pp.empty()
}this.tb.empty()
}this.create_cart_ref=(this.create_cart_ref||0)+1;
var self=this;
var product_to_load=[];
var to_update=[];
product_to_load=this.checkCartItems();
if(product_to_load.length==0){if(this.conf.methods.paypal&amp;&amp;this.pp){this.pp.empty().append($(&apos;&lt;input type=&quot;hidden&quot; name=&quot;business&quot;&gt;&apos;).val(this.conf.methods.paypal.address))
}var self=this,item_counter=0;
this.cart.num=0;
this.cart.price=0;
this.cartHtmlProd=$(&quot;&lt;ul&gt;&lt;/ul&gt;&quot;);
for(var k in this.cart.items){var p=this.products[k];
for(var o in this.cart.items[k]){var n=parseInt(this.cart.items[k][o]);
if(p.max&gt;0&amp;&amp;n&gt;0){var ks=[];
try{eval(&quot;ks=&quot;+o)
}catch(e){dbg.error(&quot;ERROR during EVAL&quot;,o)
}this.cart.num+=n;
var bsk=this.extractBonusAndStockKey(p,ks);
var bonus=bsk[0];
var stock_key=bsk[1];
var d=p.stocks[stock_key];
var max=Math.min(p.max,(d||d==0)?d:p.max);
var tot=(p.price+bonus/100)*n;
this.cart.price+=tot;
var prod_list_cart=$(&quot;&lt;li&gt;&quot;).html(&quot;&lt;div class=&apos;uis_itimg&apos;&gt;&lt;/div&gt;&lt;div class=&apos;uis_prodInfos&apos;&gt;&lt;/div&gt;&quot;).data(&quot;id&quot;,p.id);
self.setImage(prod_list_cart.find(&quot;.uis_itimg&quot;),p.img,[50,null],true);
prod_list_cart.find(&quot;.uis_prodInfos&quot;).html(&quot;&lt;div&gt;&quot;+p.name+&quot;&lt;/div&gt;&lt;div&gt;&quot;+n+(n==1?&quot; Item&quot;:&quot; Items&quot;)+&quot;&lt;/div&gt;&lt;div&gt;&quot;+UI_Store.show_price((p.price+bonus/100))+&quot;&lt;/div&gt;&quot;);
if(ks.length&gt;0){prod_list_cart.find(&quot;.uis_iname&quot;).append(&quot;&lt;div class=&apos;uis_ciopt&apos;&gt;&quot;+self.options2html(ks)+&quot;&lt;/div&gt;&quot;)
}prod_list_cart.appendTo(this.cartHtmlProd);
var tr=$(&quot;&lt;tr item-value=&quot;+k+&quot;&gt;&lt;td&gt;&lt;div class=uis_bi&gt;&lt;/div&gt;&quot;+p.name+&quot; &quot;+(ks.length&gt;0?&quot;&lt;div class=&apos;uis_cp_opts&apos;&gt;&lt;span class=&apos;uis_opts&apos;&gt;Options:&amp;nbsp;&lt;/span&gt;&lt;span class=&apos;uis_opts&apos;&gt;&quot;+self.options2html(ks)+&quot;&lt;/span&gt;&quot;:&quot;&quot;)+&quot; &lt;/div&gt;&lt;/td&gt;&lt;td class=uis_ar&gt;&quot;+UI_Store.show_price(p.price)+(bonus!=0?&quot;&lt;br&gt;&lt;small&gt;+&quot;+UI_Store.show_price(bonus/100)+&quot;&lt;/small&gt;&quot;:&quot;&quot;)+&quot;&lt;/td&gt;&lt;td class=&apos;uis_cp_qte&apos;&gt;&lt;div class=&apos;uis_br fonticon&apos;&gt;&quot;+$.fn.fonticon(&quot;close&quot;)+&quot;&lt;/div&gt;&lt;span class=uis_c_rem&gt;Remove&lt;/span&gt;&quot;+(max&gt;1?&quot;&lt;input type=text value=&quot;+n+&quot; size=1&gt; items&lt;div&gt;&lt;div class=uis_alert&gt;&lt;div&gt;&quot;+max+&quot;&amp;nbsp;items maximum&lt;/div&gt;&quot;+sprintf(&quot;&lt;div&gt;Use the button %1$s to remove this item&lt;/div&gt;&lt;/div&gt;&quot;,&quot;&lt;img src=&apos;/assets/icons/drop.gif&apos;&gt;&quot;)+&quot;&lt;/div&gt;&quot;:&quot;1 item &lt;input type=hidden value=1&gt;&quot;)+&quot;&lt;/td&gt;&lt;td class=uis_ar&gt;&quot;+UI_Store.show_price(tot)+&quot;&lt;/td&gt;&lt;/tr&gt;&quot;).appendTo(this.tb);
tr.attr(&quot;data-itemkey&quot;,o);
tr.find(&quot;input&quot;).restrictTo(&quot;int&quot;,1,max,function(d,m,x){var s=$(this).parent().find(&quot;.uis_alert div&quot;);
if(d&gt;x||d&lt;m){if(d&gt;x){s=s.eq(0)
}else{s=s.eq(1).unbind(&quot;click&quot;).click(function(){s.parents(&quot;td:first&quot;).find(&quot;img&quot;).click()
})
}s.show();
setTimeout(function(){s.hide()
},3000)
}}).blur(function(){var t=$(this);
setTimeout(function(){self.updateCartFromHtml(t.parents(&quot;.uis_bill:first&quot;))
},50)
});
this.setImage(tr.find(&quot;.uis_bi:first&quot;),p.img,[110,null],true);
$(&quot;.uis_br&quot;,tr).click(function(e){var p=self.products[$(e.target).parents(&quot;tr:first&quot;).attr(&quot;item-value&quot;)];
if(confirm(sprintf(&quot;Do you really want to remove the item &apos;%1$s&apos; from your shopping cart?&quot;,p.name))){self.updateItem(p,0,$(e.target).parents(&quot;tr:first&quot;).attr(&quot;data-itemkey&quot;))
}});
item_counter++;
if(this.pp){$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;item_name_&apos;+item_counter+&apos;&quot;&gt;&apos;).val(p.name+&quot; &quot;+(this.nopid?&quot;&quot;:&quot;[&quot;+p.id+((p.reference?&quot;/&quot;+p.reference:&quot;&quot;)+&quot;] &quot;))+(o!=&quot;&quot;?&quot;(&quot;+JSON_.parse(o).collect(function(opt){return(opt[0].match(/^-h-\d+/)?&quot;&quot;:opt[0]+&quot;=&quot;)+opt[1]
}).join(&quot; &amp; &quot;)+&quot;)&quot;:&quot;&quot;)).appendTo(this.pp);
$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;quantity_&apos;+item_counter+&apos;&quot;&gt;&apos;).val(n).appendTo(this.pp);
$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;amount_&apos;+item_counter+&apos;&quot;&gt;&apos;).val(sprintf(&quot;%.2f&quot;,(p.price+bonus/100))).appendTo(this.pp)
}}}}if(this.cart.num==0){$(&quot;&lt;tr&gt;&lt;td colspan=4&gt;Your shopping cart is empty. &lt;a href=&apos;javascript:&apos; class=uis_sb&gt;Back to Store&lt;/a&gt;&lt;/tr&gt;&quot;).prependTo(this.tb)
}this.cart.price=parseFloat(sprintf(&quot;%.2f&quot;,UI_Store.cart.price));
this.ct.find(&quot;tfoot tr:first td:last&quot;).html(UI_Store.show_price(UI_Store.cart.price));
this.update_shipping();
var tro=this.ct.find(&quot;tfoot &gt; tr:eq(1)&quot;).css(&quot;display&quot;,&quot;none&quot;);
var trot=tro.find(&quot;table:last&quot;).empty();
var trs=this.ct.find(&quot;tfoot &gt; tr:eq(2)&quot;).css(&quot;display&quot;,&quot;none&quot;);
var trc=this.ct.find(&quot;tfoot &gt; tr:eq(3)&quot;).css(&quot;display&quot;,&quot;none&quot;);
var trt=this.ct.find(&quot;tfoot &gt; tr.uis_total&quot;).css(&quot;display&quot;,&quot;none&quot;);
var tr_vat=this.ct.find(&quot;tfoot &gt; tr.uis_vat&quot;).css(&quot;display&quot;,&quot;none&quot;);
var set_total=function(total,total_no_display){UI_Store.cart.total=total;
if(!total_no_display){trt.show().find(&quot;td:last&quot;).html(UI_Store.show_price(total))
}if(self.conf.billing.enabled){tr_vat.show().find(&quot;td:last&quot;).html(UI_Store.show_price((total*self.conf.billing.vat_rate/100)/(1+self.conf.billing.vat_rate/100)))
}if(self.conf.methods.paypal&amp;&amp;self.conf.methods.paypal.paypal_integral){self.pp_form.find(&quot;input[name=subtotal]&quot;).val(sprintf(&quot;%.2f&quot;,total))
}};
set_total(UI_Store.cart.price,true);
var option_bonus=0;
if((item_counter!=0||v.mode==&quot;editor&quot;)&amp;&amp;this.conf.options.length&gt;0){var option_list=[];
if(v.mode==&quot;editor&quot;){var action=propertyConverter.convertServer_manage(UI_Store.cpts[0],$(&quot;&lt;server_manage name=&apos;payment_conf&apos; url=&apos;/store_options/options&apos;&gt;&quot;)).defaultAction;
tro.find(&quot;.uis_c_thead&quot;).html(fake_button({text:&quot;Edit cart options&quot;,&quot;class&quot;:&quot;fb2&quot;,icon:$.fn.fonticon(&quot;block&quot;)}).click(function(){action(blockSelector.selectedCpt())
}))
}tro.show();
UI_Store.conf.options.each(function(o){var input=$(&quot;&lt;tr&gt;&lt;td class=&apos;uis_extra uis_extra_name&apos;&gt;&quot;+o.name+&quot;&lt;/td&gt;&lt;td class=&apos;uis_extra&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&quot;).appendTo(trot).find(&quot;td:last&quot;);
if(o.options){var sel=$(self.option2select(o,UI_Store.cart.options[o.name]));
sel.appendTo(input);
sel=sel.find(&quot;select:first&quot;);
sel.change(function(){var t=$(this).removeAttr(&quot;firstTime&quot;);
UI_Store.cart.options[o.name]=t.val().html_encode();
setTimeout(function(){self.updateCartFromHtml(t.parents(&quot;.uis_bill:first&quot;))
},50)
});
if(o.options[sel.val().html_encode()]){option_bonus+=(o.options[sel.val().html_encode()][&quot;p&quot;]/100||0);
option_list.push(o.name+&quot;: &quot;+sel.val());
UI_Store.cart.options[o.name]=sel.val().html_encode()
}}else{var inp=self.option2input(o,UI_Store.cart.options[o.name]);
$(inp).appendTo(input).blur(function(){var t=$(this).removeAttr(&quot;firstTime&quot;),val=t.val().substr(0,o[&quot;&lt;&quot;]);
t.val(val);
UI_Store.cart.options[o.name]=val.html_encode();
UI_Store.checkCartOptions(t.parent(),UI_Store.conf.options);
UI_Store.saveCookie()
});
UI_Store.cart.options[o.name]=$(inp).val().html_encode()
}});
UI_Store.checkCartOptions(trot,UI_Store.conf.options);
set_total(UI_Store.cart.price+option_bonus);
tro.find(&quot;td:last&quot;).html(UI_Store.show_price(option_bonus));
if(option_bonus&gt;0){item_counter++;
if(this.pp){$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;item_name_&apos;+item_counter+&apos;&quot;&gt;&apos;).val(&quot;Order options: &quot;+option_list.join(&quot; &amp; &quot;).html_decode()).appendTo(this.pp);
$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;quantity_&apos;+item_counter+&apos;&quot;&gt;&apos;).val(1).appendTo(this.pp);
$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;amount_&apos;+item_counter+&apos;&quot;&gt;&apos;).val(sprintf(&quot;%.2f&quot;,option_bonus)).appendTo(this.pp)
}}}if(this.cart.shipping){trs.show().find(&quot;td:last&quot;).html(UI_Store.show_price(UI_Store.cart.shipping));
var txt=&quot;&lt;b&gt;&quot;;
var range_unit=&quot;&quot;,ship_unit_replace,ship_unit_post;
switch(this.conf.shipping.method){case&quot;p&quot;:ship_unit_replace=&quot;+%.2f&amp;#37;&quot;;
case&quot;c&quot;:range_unit=&quot;cur&quot;;
txt+=&quot;Shipping cost depends on the cart price: &quot;+UI_Store.show_price(this.cart.price);
break;
case&quot;i&quot;:ship_unit_post=&quot;/item&quot;;
txt+=&quot;Shipping cost depends on the number of items: &quot;+this.cart.num;
break;
case&quot;g&quot;:ship_unit_post=&quot;/gram&quot;;
case&quot;w&quot;:range_unit=&quot;grams&quot;;
txt+=&quot;Shipping cost depends on your cart weight: &quot;+this.cart.weight+&quot; grams&quot;;
break;
default:this.cart.shipping=0
}var ctr=0;
var show_range_unit=function(n){return(range_unit==&quot;cur&quot;?UI_Store.show_price(n):n+&quot; &quot;+range_unit)
};
if(this.cart.shipping&amp;&amp;this.conf.shipping.ranges.length&gt;0){txt+=&quot;&lt;/b&gt;&lt;br&gt;&lt;table border=0&gt;&lt;tr&gt;&lt;td&gt;&quot;+this.conf.shipping.ranges.collect(function(i){ctr+=1;
var next=UI_Store.conf.shipping.ranges[ctr];
return show_range_unit(i[0]+(i[0]==0?0:0.01))+(next?&quot; to &quot;+show_range_unit(next[0]):&quot; and more&quot;)+&quot; : &lt;td&gt; &quot;+(ship_unit_replace?sprintf(ship_unit_replace,i[1]):UI_Store.show_price(i[1]))+(ship_unit_post||&quot;&quot;)
}).join(&quot;&lt;tr&gt;&lt;td&gt;&quot;)+&quot;&lt;/table&gt;&quot;
}$(document).HandleHelpTooltip();
trs.tooltip(txt);
set_total(UI_Store.cart.price+option_bonus+UI_Store.cart.shipping);
if(this.pp){item_counter++;
$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;item_name_&apos;+item_counter+&apos;&quot;&gt;&apos;).val(&quot;Shipping cost&quot;).appendTo(this.pp);
$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;quantity_&apos;+item_counter+&apos;&quot;&gt;&apos;).val(1).appendTo(this.pp);
$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;amount_&apos;+item_counter+&apos;&quot;&gt;&apos;).val(sprintf(&quot;%.2f&quot;,UI_Store.cart.shipping)).appendTo(this.pp)
}}if(this.coupon&amp;&amp;this.cart.coupons.length&gt;0){var coup=this.cart.coupons[0];
coup.red=0;
if(coup.minimum&lt;=this.cart.price){switch(coup.mode){case&quot;price&quot;:coup.red=coup.amount;
break;
case&quot;percent&quot;:coup.red=Math.floor(this.cart.price*coup.amount)/100;
break;
case&quot;ship&quot;:coup.red=this.cart.shipping
}}trc.show().find(&quot;td:last&quot;).html(UI_Store.show_price(-coup.red));
var td_coup=trc.find(&quot;td:first&quot;).html(&quot;&lt;u&gt;&lt;b&gt;Coupon:&lt;/b&gt;&lt;/u&gt; &quot;+coup.code+&quot;&lt;br&gt;&quot;+coup.txt);
$(&quot;&lt;img class=uis_br src=&apos;/assets/icons/remove.png&apos; width=10&gt;&quot;).prependTo(td_coup).click(function(){UI_Store.cart.coupons=[];
UI_Store.updateCartHtml()
});
set_total(UI_Store.cart.price+option_bonus+UI_Store.cart.shipping-coup.red);
if(this.pp){$(&apos;&lt;input type=&quot;hidden&quot; name=&quot;discount_amount_cart&quot;&gt;&apos;).val(sprintf(&quot;%.2f&quot;,coup.red)).appendTo(this.pp)
}}this.saveCookie();
if(this.cart.num==0){this.pay_btn.hide()
}else{this.pay_btn.show();
var key=&quot;UI_Store.&quot;+self.create_cart_ref;
this.cpts[0].ask({request:&quot;save_cart&quot;,data:{cart:UI_Store.cart,pp_form_html:(this.pp_form?this.pp_form.html():null)}},function(r){sigCtl.emitVariable(key,r.cart_ref)
},function(){sigCtl.emitVariable(key,null)
})
}sigCtl.emit(&quot;UI_Store.updateCart&quot;)
}else{this.tb.html(&quot;&lt;tr&gt;&lt;td colspan=4&gt;&lt;img src=&apos;/assets/loadingAnimation.gif&apos;&gt;&lt;/tr&gt;&quot;);
UI_Store.getProducts(product_to_load).done(function(){self.updateCartHtml(true)
})
}},updateCartFromHtml:function(c){var b=[];
c.find(&quot;tbody tr&quot;).each(function(){var a=$(this);
b.push([a.attr(&quot;item-value&quot;),parseInt(a.find(&quot;input&quot;).val())||0,a.attr(&quot;data-itemkey&quot;)])
});
this.updateItems(b)
},update_shipping:function(){if(this.cart.price==0){this.cart.shipping=0
}else{var c=0,b=this.conf.shipping.ranges;
if(this.conf.shipping.method==&quot;i&quot;){while(c+1&lt;b.length&amp;&amp;b[c+1][0]&lt;UI_Store.cart.num){c++
}this.cart.shipping=b[c][1]*this.cart.num
}else{while(c+1&lt;b.length&amp;&amp;b[c+1][0]&lt;this.cart.price){c++
}switch(this.conf.shipping.method){case&quot;c&quot;:this.cart.shipping=b[c][1];
break;
case&quot;p&quot;:this.cart.shipping=Math.floor(b[c][1]*this.cart.price)/100;
break;
case&quot;w&quot;:case&quot;g&quot;:this.cart.weight=0;
for(var a in this.cart.items){for(var d in this.cart.items[a]){var e=parseInt(this.cart.items[a][d]);
this.cart.weight+=(this.products[a].weight||0)*e
}}c=0;
while(c+1&lt;b.length&amp;&amp;b[c+1][0]&lt;this.cart.weight){c++
}if(this.conf.shipping.method==&quot;g&quot;){this.cart.shipping=b[c][1]*this.cart.weight
}else{this.cart.shipping=b[c][1]
}break;
default:this.cart.shipping=0
}}}},btn:function(a){var e=a[&quot;class&quot;]||&quot;&quot;;
var d=a.node||&quot;div&quot;;
var b=a.style||&quot;&quot;;
return&quot;&lt;&quot;+d+&quot; class=&apos;uis_btn &quot;+e+&quot;&apos; style=&quot;+b+&quot;&gt;&quot;+a.txt+&quot;&lt;span class=&apos;uis_bse&apos;&gt;&lt;/span&gt;&lt;/&quot;+d+&quot;&gt;&quot;
},_rate:1,_price_display:&quot;%.2f&amp;nbsp;%s&quot;,show_price:function(a,b){if(!this._cur){if(this.conf.custom&amp;&amp;this.conf.custom.currency){if(this.conf.custom.currency.price_display){this._price_display=this.conf.custom.currency.price_display
}if(this.conf.custom.currency.rate){this._rate=parseFloat(this.conf.custom.currency.rate)
}}this._cur=this.currency_sym()
}return((a||a==0)?sprintf(this._price_display,a*(b?1:this._rate),this._cur):sprintf(&quot;&amp;nbsp;%s&quot;,(b?this.currency_sym(true):this._cur)))
},currency_sym:function(a){if(!a&amp;&amp;this.conf.custom&amp;&amp;this.conf.custom.currency&amp;&amp;this.conf.custom.currency.name){return this.conf.custom.currency.name
}return this.conf.currency.replace(/EUR/,&quot;&amp;euro;&quot;).replace(/JPY/,&quot;&amp;yen;&quot;).replace(/GBP/,&quot;&amp;pound;&quot;).replace(/(\w\wD)/,&quot;$$$1&quot;)
}};
UI_List.UI_Store={initialize:function(a){this.cpt=a;
UI_Store.addCpt(a);
this.url=null;
this.pageSelected=0;
this.prodSelected=null;
this.catSelected=null;
this.cat_ids=[];
a.setOptions([&quot;locked&quot;])
},onDisplay:function(c){var k=this;
this.next_show=$.Deferred();
var b=this.n={main:c,warn:c.find(&quot;.uis_warn&quot;),catal:c.find(&quot;.uis_catalog&quot;),bill:c.find(&quot;.uis_bill&quot;),billc:c.find(&quot;.uis_bill_c&quot;),cat:c.find(&quot;.uis_cat&quot;),sort:c.find(&quot;.uis_sort&quot;),pages:c.find(&quot;.uis_pages&quot;),list:c.find(&quot;.uis_list&quot;),ul:c.find(&quot;.uis_list ul&quot;),search:c.find(&quot;.uis_search&quot;),search_header:c.find(&quot;.uis_search_header&quot;)};
var h=c.find(&quot;.uis_prod&quot;);
b.prod={main:h,id:h.find(&quot;.uis_prodid&quot;),name:h.find(&quot;.uis_name&quot;),desc:h.find(&quot;.uis_desc&quot;),price:h.find(&quot;.uis_price&quot;),strike:h.find(&quot;.uis_strike&quot;),opt_price:h.find(&quot;.uis_price_opts&quot;),opt:h.find(&quot;.uis_opt&quot;),img:h.find(&quot;.uis_img&quot;),imgs:h.find(&quot;.uis_imgs &gt; div&quot;),cat:h.find(&quot;.uis_prod_cat&quot;),clist:h.find(&quot;.uis_prod_cat ul&quot;)};
this.size_getter_el=$(&quot;&lt;div&gt;&lt;/div&gt;&quot;).appendTo(c).css(&quot;clear&quot;,&quot;both&quot;)[0];
this.member_controller=new MemberController(c);
if(this.cpt.idserver){b.warn.html(&quot;&lt;img src=&apos;/assets/types/UI_Store/64.png&apos;&gt;&lt;br&gt;&lt;img src=&apos;/assets/loadingAnimation.gif&apos;&gt;&quot;)
}else{var g=function(){if(confirm(sprintf(&quot;Do you want to save site as a draft and start the Store block configuration?&quot;,k.cpt.page.name))){v.save()
}};
b.warn.html(&quot;Save the page (as a draft) and start the Store block configuration.&quot;).css(&quot;cursor&quot;,&quot;pointer&quot;).click(g);
setTimeout(g,0)
}this.n.sort.find(&quot;span&quot;).click(function(){var f=k._getProdListSort();
var d=$(this).data(&quot;sort&quot;);
k._setProdListSort(d,d==f[0]?!f[1]:true);
k.updateProdListGui()
});
if(v.mode==&quot;editor&quot;){this.n.main.addClass(&quot;uic_editable&quot;);
b.prod.name.html(&quot;&lt;input type=text size=15 maxlength=200&gt;&quot;).find(&quot;input&quot;).click(function(){var d=$(this);
if(d.val()==&quot;Product name&quot;){d.val(&quot;&quot;)
}});
b.prod.ref=$(&quot;&lt;div class=uis_ref&gt;&lt;b&gt;Reference:&lt;/b&gt; &lt;input type=text maxlength=30&gt;&lt;/div&gt;&quot;).insertBefore(b.prod.price);
b.prod.visi=$(&quot;&lt;div class=uis_visi&gt;&lt;b&gt;Show this product on your website:&lt;/b&gt; &lt;input type=checkbox&gt;&lt;/div&gt;&quot;).insertAfter(b.prod.price);
b.prod.weight=$(&quot;&lt;div class=uis_weight&gt;&lt;b&gt;Weight:&lt;/b&gt; &lt;input type=text size=5&gt; grams&lt;/div&gt;&quot;).insertAfter(b.prod.price);
var l=$(&quot;&lt;div&gt;&lt;b&gt; Number of items in stock:&lt;/b&gt; &lt;input type=text size=3&gt;&lt;/div&gt;&quot;).insertAfter(b.prod.visi);
l.prepend(HelpTag(&quot;Maximum number of items a customer can buy (between 0 and 999).&lt;ul&gt;&lt;li&gt;&lt;b&gt;If you enter 0&lt;/b&gt;, customers will see this product, but will not be able to add it to the shopping cart.&lt;/li&gt;&lt;li&gt;&lt;b&gt;If you enter 1&lt;/b&gt;, they will be able to buy only one product.&lt;/li&gt;&lt;li&gt;&lt;b&gt;If more than 1&lt;/b&gt;, they will be able to choose how many items they want to order.&lt;/li&gt;&lt;/ul&gt;&quot;));
b.prod.max=l.find(&quot;input&quot;).restrictTo(&quot;int&quot;,0,999);
b.prod.clist.click(function(f){var d=$(f.target);
k.tmp_cat.removeAll(d.data(&quot;cat_id&quot;));
k._setProdCat()
});
var i=$(&quot;&lt;td&gt;&lt;div class=&apos;uis_cat_select uis_cat_list disable_drag&apos;&gt;&lt;/div&gt;&lt;/td&gt;&quot;).appendTo(b.prod.cat).find(&quot;div&quot;);
b.prod.cat_select=$(&quot;&lt;ul&gt;&lt;/ul&gt;&quot;).appendTo(i).hide().click(function(m){var f=$(m.target);
var d=f.data(&quot;cat_id&quot;);
if(d){k.tmp_cat.push(d)
}k._setProdCat()
});
b.prod.cat_none=$(&quot;&lt;td&gt;&lt;span&gt;No categories yet.&lt;/span&gt;&lt;/td&gt;&quot;).appendTo(b.prod.cat).hide().append(HelpTag(&quot;Click on the &apos;Manage categories&apos; button in the properties to add new categories.&quot;));
b.prod.cat_add=$(&quot;&lt;img src=&apos;/assets/icons/roundplus.gif&apos; style=&apos;cursor:pointer&apos;&gt;&quot;).appendTo(i).click(function(){b.prod.cat_select.toggle();
return false
});
HelpTag(&quot;Strike-through price to show a promotion on this product&quot;).prependTo(b.prod.strike.find(&quot;div:first&quot;));
b.prod.img_btn=$(&apos;&lt;img src=&quot;/assets/edit/edit_64.jpg&quot; class=&quot;uis_img_ed&quot;/&gt;&apos;).insertAfter(b.prod.img);
var e=$(&apos;&lt;div class=&quot;uis_cmd_p&quot;&gt;&lt;/div&gt;&apos;).prependTo(b.prod.main);
b.prod.save=fake_button({text:&quot;Save &amp;amp; Publish&quot;,size:&quot;main&quot;,icon:$.fn.fonticon(&quot;apply&quot;)}).css(&quot;margin-right&quot;,&quot;3px&quot;).prependTo(e);
b.prod.copy=fake_button({text:&quot;Duplicate&quot;,icon:$.fn.fonticon(&quot;dupplicate&quot;)}).css(&quot;margin-right&quot;,&quot;3px&quot;).prependTo(e);
b.prod.del=fake_button({text:&quot;Delete&quot;,icon:$.fn.fonticon(&quot;close&quot;)}).css(&quot;margin-right&quot;,&quot;3px&quot;).prependTo(e);
b.prod.cancel=fake_button({text:&quot;Cancel&quot;,icon:$.fn.fonticon(&quot;undo&quot;)}).css(&quot;margin-right&quot;,&quot;3px&quot;).prependTo(e);
b.prod.save.click(function(){k.saveProduct()
});
b.prod.copy.click(function(){k.saveProduct(true)
});
b.prod.cancel.click(function(){k.selectCat(null,k.prodSelected!=null)
});
b.prod.del.click(function(){if(k.send_once){return
}if(k.prodSelected&amp;&amp;k.prodSelected!=&quot;new&quot;){if(confirm(&quot;Do you really want to delete this product?\nIf you only want to hide it, untick the &apos;Show on the website&apos; checkbox.&quot;)){this.send_once=true;
k.cpt.ask({request:&quot;delete_product&quot;,id:b.prod.id.val()},function(f){k.send_once=false;
UI_Store.del_product(k.prodSelected);
k.prodSelected=null;
sigCtl.emit(&quot;UI_Store.updateProdListGui&quot;)
},function(d){k.send_once=false;
dbg.error(&quot;Impossible to delete product.\n&quot;+d.join(&quot;\n&quot;))
})
}}else{k.prodSelected=null;
sigCtl.emit(&quot;UI_Store.updateProdListGui&quot;)
}});
b.prod.img.parent().click(function(){filesSelector.open({type:&quot;image&quot;,maxItems:25,files:((k.tmp_img&amp;&amp;k.tmp_img.length&gt;0&amp;&amp;!k.tmp_img[0].is_default)?k.tmp_img:[])},function(f){if(f&amp;&amp;f[0]){k.tmp_img=f;
UI_Store.setImage(k.n.prod.img,f,null,true,k.n.prod.imgs);
UI_Store._setZoomProduct(k.n.prod.img.find(&quot;img&quot;),f)
}})
});
b.prod.main.click(function(d){k.n.prod.cat_select.hide();
if($(d.target).hasClass(&quot;uis_desc&quot;)){return
}k.deselectEditor();
if(d.target.type&amp;&amp;(d.target.type.match(/textarea/i)||d.target.nodeName.match(/input/i))){return
}k.updateCptSize()
});
sigCtl.connect(&quot;Theme.changed&quot;,function(){k.reset=true
});
sigCtl.connect(&quot;CSS.changed&quot;,function(){k.reset=true
})
}else{b.prod.clist.click(function(f){var d=$(f.target);
k.selectCat(parseInt(d.data(&quot;cat_id&quot;)),true)
})
}k.createCartHeaderNeeded=false;
sigCtl.connect(&quot;UI_Store.createCartHeader&quot;,function(){if(k.createCartHeaderNeeded){return
}k.createCartHeaderNeeded=true;
k.next_show.done(function(){k.createCartHeaderNeeded=false;
k.createCartHeader()
})
});
k.updateCatListGuiNeeded=false;
sigCtl.connect(&quot;UI_Store.updateCatListGui&quot;,function(){if(k.updateCatListGuiNeeded){return
}k.updateCatListGuiNeeded=true;
k.next_show.done(function(){k.updateCatListGuiNeeded=false;
k.updateCatListGui(true)
})
});
k.updateProdListGuiNeeded=false;
sigCtl.connect(&quot;UI_Store.updateProdListGui&quot;,function(){if(k.updateProdListGuiNeeded){return
}k.updateProdListGuiNeeded=true;
k.next_show.done(function(){k.updateProdListGuiNeeded=false;
k.updateProdListGui()
})
});
this._setProdListStyle();
UI_Store.getCategories(true,function(){UI_Store.loadCookie();
sigCtl.emit(&quot;UI_Store.createCartHeader&quot;)
});
this.search_field_available=(v.mode==&quot;editor&quot;||v.planid&gt;=1);
this.bindSearch();
this.onPropertyChanged([&quot;search_field&quot;]);
this.updateCptClass();
var a=function(){setTimeout(function(){k.next_show.done(function(){k.updateCptClass()
})
},100)
};
$(window).resize(a);
sigCtl.connect(&quot;Page.shown&quot;,a)
},onPropertyChanged:function(a){var b=this;
if(a.include(&quot;search_field&quot;)){this.n.search.toggle(!!(this.search_field_available&amp;&amp;this.cpt.data.search_field))
}if(a.include(&quot;manage&quot;)){UI_Store.getCategories(false,function(c){b.cpt.data.show_cat_all=c.show_cat_all
},this.cpt)
}if(a.include(&quot;payment_conf&quot;)){UI_Store.getPaymentConf(function(){UI_Store._cur=null;
UI_Store.updateCartHtml();
sigCtl.emit(&quot;UI_Store.createCartHeader&quot;);
sigCtl.emit(&quot;UI_Store.updateCart&quot;);
sigCtl.emit(&quot;UI_Store.updateProdListGui&quot;)
})
}if(a.include(&quot;style&quot;)){if(this.cpt.data.style==&quot;m&quot;&amp;&amp;!$(&quot;.accept_bg&quot;).length){statusController.message(&quot;This functionality is not available for your template. Please change your template to either Cristal or Elegance, thanks to the button below.&quot;,&quot;warning&quot;,5000)
}this._setProdListStyle();
this.updateProdListGui();
this._changeProperties()
}if(a.include(&quot;auto_size&quot;)){this.updateCptSize()
}if(a.include(&quot;rows&quot;)){this.items_per_row=null;
if(!this.prodSelected){clearTimeout(this.rwto);
this.rwto=setTimeout(function(){b.updateProdListGui()
},500)
}}if(a.include(&quot;show_stocks&quot;)||a.include(&quot;stock_limit&quot;)){this.updateProdListGui();
this._changeProperties()
}},_changeProperties:function(){$(&quot;.uis_prop_sitew, .uis_prop_sitew_sub&quot;).hide();
if(this.cpt.data.style==&quot;m&quot;&amp;&amp;$(&quot;.accept_bg&quot;).length){$(&quot;.uis_prop_sitew&quot;).show();
if(this.cpt.data.show_stocks){$(&quot;.uis_prop_sitew_sub&quot;).show()
}}},onSelect:function(){this._changeProperties()
},onDeselect:function(){this.n.prod.img_btn.hide()
},onEdit:function(){this.n.prod.img_btn.show()
},onShow:function(){if(this.reset){this.reset=null;
this._setProdListStyle();
this.selectCat(null,true)
}else{this._setUrl()
}this.n.list.find(&quot;h3&quot;).ellipsis();
$(&quot;input&quot;,this.n.search).val(&quot;&quot;).change();
this.next_show.resolve()
},onHide:function(){this.next_show=$.Deferred()
},onHashChange:function(){UI_Store._setZoomProduct(this.n.prod.main,null,true);
this._setUrl()
},deselectEditor:function(){if(v.mode==&quot;editor&quot;){editorController.deselect();
this.n.prod.desc.height(&quot;auto&quot;);
this.n.prod.desc.height(this.n.prod.desc.height())
}},saveProduct:function(c){if(this.send_once){return
}var a=this;
var b=this.n;
if(this.prodSelected&amp;&amp;this.prodSelected!=&quot;new&quot;&amp;&amp;this.prodSelected.desc==undefined){return setTimeout(function(){a.saveProduct(c)
},100)
}if(c){this.prodSelected=&quot;new&quot;;
b.prod.id.val(&quot;&quot;)
}this.deselectEditor();
this.send_once=true;
this.cpt.ask({request:&quot;update_product&quot;,id:b.prod.id.val(),reference:b.prod.ref.find(&quot;input&quot;).val(),name:b.prod.name.find(&quot;input&quot;).val(),desc:editorController.getContent(b.prod.desc),opts:this.tmp_opts,stocks:this.tmp_stocks,img:this.tmp_img,price:b.prod.price.find(&quot;input&quot;).val(),weight:b.prod.weight.find(&quot;input&quot;).val(),strike:b.prod.strike.find(&quot;input&quot;).val(),seo_description:$(&quot;.uis_seo_description textarea&quot;,b.prod.main).val(),max:b.prod.max?b.prod.max.val():99,visible:b.prod.visi.find(&quot;input&quot;).is(&quot;:checked&quot;),category_ids:a.tmp_cat},function(e){a.send_once=false;
if(a.prodSelected&amp;&amp;a.prodSelected!=&quot;new&quot;){UI_Store.del_product(a.prodSelected)
}UI_Store.add_product(e);
a.prodSelected=null;
sigCtl.emit(&quot;UI_Store.updateProdListGui&quot;)
},function(d){a.send_once=false;
dbg.error(&quot;Impossible to update product.\n&quot;+d.join(&quot;\n&quot;));
statusController.message(d.join(&quot;\n&quot;),&quot;warning&quot;)
})
},updateCptClass:function(){this.cpt.node.removeClass(&quot;uis_s0 uis_s1 uis_s2 uis_prod_responsive uis_sf&quot;);
var a=this.cpt.node.width(),b=&quot;uis_s2&quot;;
if(a&lt;400){b=&quot;uis_sf&quot;
}else{if(a&lt;700){b=&quot;uis_s0&quot;
}else{if(a&lt;1000){b=&quot;uis_s1&quot;
}}}if(a&lt;(({s:365}[this.cpt.data.style])||580)){this.cpt.node.addClass(&quot;uis_prod_responsive&quot;);
this.cpt.node.find(&quot;.uis_total_label,.uis_ship,.uis_coup&quot;).attr(&quot;colspan&quot;,2)
}else{this.cpt.node.find(&quot;.uis_total_label,.uis_ship,.uis_coup&quot;).attr(&quot;colspan&quot;,3)
}this.cpt.node.addClass(b)
},onResizeStop:function(){if(this.cpt.W()&lt;320){this.cpt.setSize({w:320})
}this.onResize();
this.items_per_row=null;
this.hideCart();
if(!this.prodSelected){this.updateProdListGui()
}},onResize:function(){var a=this.n.ul.find(&quot;li:last&quot;);
this.ratio=a.height()/a.width();
this.updateCptClass();
this.setImagesRatio()
},onSave:function(){UI_Store.getCategories(true)
},onRemove:function(){UI_Store.remCpt(this.cpt)
},updateCptSize:function(){Misc.deferred_method(this,this._updateCptSize,200)
},_updateCptSize:function(b){if(this.cpt.data.auto_size){b|=0;
var a=this;
a.n.main.css(&quot;overflow-y&quot;,&quot;hidden&quot;);
a.cpt.setSize({h:10000});
a.cpt.setSize({h:Math.max(this.cpt.data.search_field?600:0,a.size_getter_el.offsetTop+50),w:a.cpt.W()&gt;320?null:320});
if(b&lt;3){b+=1;
setTimeout(function(){a._updateCptSize(b)
},(b)*100)
}}else{this.n.main.css(&quot;overflow-y&quot;,&quot;auto&quot;)
}},updateCatListGui:function(c){if(this.cpt.idserver){var a=this;
this.n.warn.hide();
if(c){this.cat_ids=(this.cpt.data.show_cat_all)?[0]:[];
for(var b in UI_Store.categories){if(UI_Store.categories[b].stores.include(this.cpt.idserver)){this.cat_ids.push(parseInt(b))
}}this.cat_ids.sort(function(d,e){return UI_Store.categories[d].order-UI_Store.categories[e].order
})
}if(this.cat_ids.length&gt;1){this.n.cat.html(&quot;&lt;ul&gt;&quot;+this.cat_ids.collect(function(d){return&quot;&lt;li data-cat_id=&apos;&quot;+d+&quot;&apos;&gt;&quot;+$.trim(UI_Store.categories[d].name)+&quot;&lt;/li&gt;&amp;nbsp; &quot;
}).join(&quot;&quot;)+&quot;&lt;/ul&gt;&quot;);
this.n.cat.find(&quot;li&quot;).each(function(e,d){d=$(d);
d.click(function(){a.selectCat(parseInt(d.data(&quot;cat_id&quot;)),a.prodSelected!=null)
})
})
}else{this.n.cat.html(&quot;&lt;ul&gt;&lt;li&gt;&amp;lt;&amp;lt; Back to product list&lt;/li&gt;&lt;/ul&gt;&quot;).find(&quot;li&quot;).click(function(){a.selectCat(null,a.prodSelected!=null)
})
}$(&quot;&lt;li class=uis_search_back&gt;Back to search results&lt;/li&gt;&quot;).click(function(){a.triggerSearch()
}).appendTo($(&quot;ul&quot;,this.n.cat));
this.showCatList();
if(this.prodIdToSelect){this.selectProd(this.prodIdToSelect);
this.prodIdToSelect=null
}else{if(this.prodSelected){this._setProdCat()
}}if(v.selectedPageFg.cptUrl&amp;&amp;v.selectedPageFg.cptUrl.match(/s\db/)){this.n.catal.hide()
}else{this.n.catal.show();
this.selectList(this.catSelected,true,this.prodSelected!=null)
}}},selectList:function(a){if(!a){this.selectCat.apply(this,arguments)
}else{if(a[0]==&quot;search_query&quot;){this.selectSearch(a[1],0)
}else{arguments[0]=a[1];
this.selectCat.apply(this,arguments)
}}},showCatList:function(){this.n.cat.toggle(!!(this.prodSelected||(this.catSelected&amp;&amp;this.catSelected[0]==&quot;category_id&quot;&amp;&amp;this.cat_ids.length&gt;1)));
var a=!(this.prodSelected&amp;&amp;this.catSelected&amp;&amp;this.catSelected[0]==&quot;search_query&quot;);
$(&quot;.uis_search_back&quot;,this.n.cat).toggle(!a);
$(&quot;li:not(.uis_search_back)&quot;,this.n.cat).toggle(a);
$(&quot;.uis_search_suggest&quot;,this.n.main).removeClass(&quot;uis_typing&quot;)
},selectCat:function(h,e,a,d){if($.fn.hash_size(UI_Store.categories)==0){this.catSelected=[&quot;category_id&quot;,h];
return
}var g=this.pageSelected;
this.pageSelected=d||0;
this.hideCart();
if(h==null||!UI_Store.categories[h]||!(h==0&amp;&amp;this.cpt.data.show_cat_all||UI_Store.categories[h].stores.include(this.cpt.idserver))){e=true;
h=this.cat_ids[0]
}if(h!=(this.catSelected&amp;&amp;this.catSelected[1])||g!=this.pageSelected||e){var b=$();
if(this.n.cat.find(&quot;li&quot;).length&gt;1){b=this.n.cat.find(&quot;li[data-cat_id=&quot;+h+&quot;]&quot;)
}var f=UI_Store.categories[h];
if(!f){return
}if(!a&amp;&amp;this.preventNotSaved()){return
}this.catSelected=[&quot;category_id&quot;,h];
this.n.cat.find(&quot;li&quot;).removeClass(&quot;uis_sel&quot;);
b.addClass(&quot;uis_sel&quot;);
if(!a){this.updateProdListGui()
}}},preventNotSaved:function(){return v.mode==&quot;editor&quot;&amp;&amp;this.prodSelected&amp;&amp;!confirm(&quot;Do you really want to exit without saving the product?\n&quot;+$(&quot;&lt;div&gt;&quot;).html(&quot;If not, cancel and press the &apos;Save &amp;amp; Publish&apos; button: your changes will be recorded and you will be redirected to the product list.&quot;).text())
},triggerSearch:function(a){if(typeof(a)!=&quot;undefined&quot;){$(&quot;input&quot;,this.n.search).val(a).change()
}$(&quot;.uis_btn&quot;,this.n.search).click()
},selectSearch:function(c,b){$(&quot;input&quot;,this.n.search).val(c).change();
this.n.search.toggleClass(&quot;uis_search_result&quot;,c!=&quot;&quot;);
this.prodSelected=null;
if(c==&quot;&quot;){this.selectCat(null)
}else{this.catSelected=[&quot;search_query&quot;,c];
this.showCatList();
this.n.list.hide();
var d=this.pageSelected;
this.pageSelected=b||0;
this.hideCart();
var a=this;
$.when(UI_Store.cache.get(&quot;search:&quot;+c,function(){a.searchLoading(1);
return a.cpt.ask({request:&quot;search_query&quot;,query:c}).always(function(){a.searchLoading(-1)
})
})).done(function(){a.updateProdListGui()
})
}},updateProdListGui:function(){var f=this._getProdListSort();
if(!this.catSelected){return
}if(this.catSelected[0]==&quot;category_id&quot;){var g=UI_Store.categories[this.catSelected[1]];
if(!g){return
}if(v.selectedPageFg==this.cpt.page&amp;&amp;(!this.cpt.page.cptUrl||this.cpt.page.cptUrl.substr(1,1)==&quot;s&quot;)){this.cpt.page.setCptUrl(&quot;/s&quot;+g.id+&quot;c&quot;+(this.pageSelected?this.pageSelected:&quot;&quot;)+&quot;/&quot;+g.name.to_alphanumeric(),g.name,this.cpt)
}var a=(f[0]==&quot;p&quot;?g.products_by_price:g.products).slice();
if(f[1]){a.reverse()
}this.n.sort.removeClass(&quot;uis_sort_hidden&quot;).find(&quot;span&quot;).removeClass(&quot;uis_ss uis_ssa&quot;);
this.n.sort.find(&quot;span.uis_s&quot;+f[0]).addClass(&quot;uis_ss&quot;+(f[1]?&quot; uis_ssa&quot;:&quot;&quot;));
this.n.search_header.hide()
}else{var a=UI_Store.cache.get(&quot;search:&quot;+this.catSelected[1]).products;
this.cpt.page.setCptUrl(&quot;/s0s&quot;+(this.pageSelected||&quot;0&quot;)+&quot;/&quot;+encodeURI(this.catSelected[1]),this.catSelected[1],this.cpt);
this.n.sort.addClass(&quot;uis_sort_hidden&quot;);
this.n.search_header.show();
$(&quot;.uis_nbr_search_results&quot;,this.n.search_header).html(sprintf(&quot;%1$d results for %2$s&quot;,a.length,&quot;&lt;span&gt;&quot;+$(&quot;&lt;div&gt;&quot;).text(this.catSelected[1]).html()+&quot;&lt;/span&gt;&quot;))
}var k=this;
this.n.pages.empty();
if(a.length&gt;0){this.showList();
if(!this.items_per_row){this._prodRow()
}var b=0,h=this.cpt.data.rows*this.items_per_row;
if(h&gt;0&amp;&amp;a.length&gt;h){var i=Math.ceil(a.length/h);
this.pageSelected=Math.min(this.pageSelected,i-1);
$.fn.paginate(this.n.pages.show(),i,this.pageSelected,1,3,function(c){if(k.pageSelected!=c){k.pageSelected=c;
k.updateProdListGui()
}});
a=a.slice(this.pageSelected*h,(this.pageSelected+1)*h)
}this.n.ul.empty();
var e=[],d={};
a.each(function(c){var l=UI_Store.products[c];
if(l){k._drawProdListItem(l,$(&quot;&lt;li&gt;&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;&lt;/li&gt;&quot;).appendTo(k.n.ul))
}else{e.push(c);
d[c]=$(&quot;&lt;li&gt;&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;&lt;div class=uis_list_img&gt;&lt;img src=&apos;/assets/loading/66x66.gif&apos; class=&apos;no_css&apos;&gt;&lt;/div&gt;&lt;div class=uis_list_price&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&quot;).appendTo(k.n.ul)
}});
if(e.length&gt;0){UI_Store.getProducts(e).done(function(){e.each(function(c){k._drawProdListItem(UI_Store.products[c],d[c])
});
k.setImagesRatio()
})
}k.setImagesRatio()
}else{this.n.ul.html(&quot;No products yet...&quot;);
this.showList()
}if(v.mode==&quot;editor&quot;){$(&quot;&lt;li&gt;&quot;).attr(&quot;title&quot;,&quot;Create a new product&quot;).html(&quot;&lt;div&gt;&lt;div class=&apos;fonticon&apos;&gt;&quot;+$.fn.fonticon(&quot;add&quot;)+&quot;&lt;/div&gt;&lt;div class=&apos;uis_cmd_tt&apos;&gt;Create a new product&lt;/div&gt;&lt;/div&gt;&quot;).addClass(&quot;uis_cmd_l&quot;).appendTo(this.n.ul).on(&quot;click&quot;,function(){k.selectProd()
});
this.updateCptSize()
}},showList:function(){this.prodSelected=null;
if(v.mode==&quot;editor&quot;){this.deselectEditor()
}this.n.prod.main.hide();
this.showCatList();
this.n.list.show()
},_getProdListSort:function(){return(this.cpt.data.sort||[&quot;n&quot;,true])
},_setProdListSort:function(a,b){this.pageSelected=0;
if(v.mode==&quot;editor&quot;){this.cpt.setData(&quot;sort&quot;,[a,b]);
statusController.message(sprintf(&quot;When the Store block is loaded, products will now be sorted by &lt;b&gt;%1$s&lt;/b&gt; in &lt;b&gt;%2$s order&lt;/b&gt;. Publish your website to apply changes.&quot;,a==&quot;p&quot;?&quot;prices&quot;:&quot;names&quot;,b?&quot;ascending&quot;:&quot;descending&quot;))
}else{this.cpt.data.sort=[a,b]
}},_setProdListStyle:function(){this.n.main.add(this.n.ul).removeClass(&quot;uisl_s uisl_l uisl_m uisl_h&quot;).addClass(&quot;uisl_&quot;+(this.cpt.data.style||&quot;l&quot;));
this.items_per_row=null;
this.setImagesRatio()
},_prodRow:function(){this.pageSelected=0;
this.n.ul.empty();
this.items_per_row=0;
var a,b=$(&quot;&lt;li&gt;&lt;/li&gt;&quot;).appendTo(this.n.ul);
if(b.width()==0){return
}do{this.items_per_row+=1;
a=$(&quot;&lt;li&gt;&lt;/li&gt;&quot;).appendTo(this.n.ul)
}while(b[0].offsetTop==a[0].offsetTop&amp;&amp;this.items_per_row&lt;10);
this.n.ul.empty()
},_drawProdListItem:function(e,f){var a=this;
f.attr(&quot;title&quot;,e.summary);
var b=null;
if($.fn.hash_size(UI_Store.conf.methods)&gt;0){if(e.opts.length==0&amp;&amp;e.max&gt;0){b=[&quot;p_buy&quot;,&quot;cart&quot;,&quot;Buy&quot;]
}if(a._getMaxStock(e)&amp;&amp;Object.keys(e.stocks).length){b=[&quot;&quot;,&quot;exe&quot;,&quot;Options&quot;]
}}f.html(&quot;&lt;div class=&apos;uis_list_img&apos;&gt;&lt;/div&gt;&lt;h3&gt;&lt;span&gt;&quot;+(e.visible?&quot;&quot;:&quot;&lt;img src=&apos;/assets/icons/ghost.png&apos; title=&apos;Product not visible on your website&apos; width=16 height=16/&gt;&quot;)+e.name+&quot;&lt;/span&gt;&quot;+(this.cpt.data.style==&quot;h&quot;?&quot;&lt;span style=&apos;display:block;&apos;&gt;&quot;+e.summary+&quot;&lt;/span&gt;&quot;:&quot;&quot;)+&quot;&lt;/h3&gt;&lt;div class=&apos;uis_list_price&apos;&gt;&quot;+((e.strike&amp;&amp;e.strike&gt;e.price)?&quot;&lt;span class=&apos;uis_ps&apos;&gt;&quot;+UI_Store.show_price(e.price)+&quot;&lt;/span&gt;&lt;span class=&apos;uis_list_strike&apos;&gt;&quot;+UI_Store.show_price(e.strike)+&quot;&lt;/span&gt;&quot;:UI_Store.show_price(e.price))+&quot;&lt;/div&gt;&quot;+(b?&quot;&lt;div class=&apos;ov_prod&apos;&gt;&lt;div class=&apos;&quot;+b[0]+&quot;&apos;&gt;&lt;div class=&apos;fonticon&apos;&gt;&quot;+$.fn.fonticon(b[1])+&quot;&lt;/div&gt;&lt;div class=&apos;ov_text&apos;&gt;&quot;+b[2]+&quot;&lt;/div&gt;&lt;/div&gt;&lt;div class=&apos;ov_added&apos;&gt;&lt;/div&gt;&lt;/div&gt;&quot;:&quot;&quot;));
if(!a._getMaxStock(e)&amp;&amp;$.fn.hash_size(UI_Store.conf.methods)&gt;0){f.find(&quot;.uis_list_price&quot;).html(&quot;Sold out&quot;)
}else{if(this.cpt.data.show_stocks){var d=[&quot;Available&quot;,&quot;a&quot;,&quot;&quot;];
if(Object.keys(e.stocks).length==0){if(e.max&gt;this.cpt.data.stock_limit){d[0]=&quot;Available&quot;;
d.removeAt(2)
}else{if(e.max&lt;=this.cpt.data.stock_limit&amp;&amp;e.max&gt;1){d=[sprintf(&quot;Only %1$d products left&quot;,e.max),&quot;l&quot;]
}else{if(e.max==1){d=[&quot;Only one product left&quot;,&quot;l&quot;]
}}}}$(&quot;&lt;span class=&apos;uis_available uisa_&quot;+d[1]+&quot;&apos;&gt;&lt;/span&gt;&quot;).html(d[0]+(d[2]?&quot; - &lt;span&gt;&quot;+d[2]+&quot;&lt;/span&gt;&quot;:&quot;&quot;)).insertAfter(f.find(&quot;.uis_list_price&quot;))
}}f.find(&quot;h3&quot;).ellipsis();
f.click(function(){a.selectProd(e.id)
});
f.find(&quot;.ov_prod .p_buy&quot;).on(&quot;click&quot;,function(){if(v.mode==&quot;viewer&quot;&amp;&amp;UI_Store.checkCartOptions(a.n.prod.opt,e.opts,true)){var g=$(this).parents(&quot;li:first&quot;);
g.addClass(&quot;added&quot;);
setTimeout(function(){g.removeClass(&quot;added&quot;)
},1500);
UI_Store.updateItem(e,1,&quot;[]&quot;);
a.addToCart(e);
return false
}});
var c=f.find(&quot;.uis_list_img&quot;);
UI_Store.setImage(c,e.img);
c.find(&quot;img&quot;).addClass(&quot;img_height&quot;);
e.img_loaded=true
},setImagesRatio:function(){var b,a=this;
this.n.ul.find(&quot;.uis_list_img &gt; div&quot;).hide(0).promise().done(function(){a.n.ul.find(&quot;.uis_list_img img&quot;).each(function(c,e){var f=$(e);
if(/loading/.test(f.attr(&quot;src&quot;))){return
}var d=f.closest(&quot;.uis_list_img&quot;);
b=b||(d.height()/d.width());
f.on(&quot;load&quot;,function(){if(b&lt;=f.height()/f.width()){f.addClass(&quot;img_height&quot;)
}else{f.removeClass(&quot;img_height&quot;)
}f.css(&quot;opacity&quot;,1)
})
});
a.n.ul.find(&quot;.uis_list_img &gt; div&quot;).show()
})
},refreshRatio:function(){var a=this,b=this.n.ul.find(&quot;li:last .uis_list_img&quot;);
b.find(&quot;img&quot;).hide(0,function(){a.ratio=b.height()/b.width();
$(this).show();
a.n.ul.find(&quot;.uis_list_img &gt; div&quot;).show()
})
},addToCart:function(c){var b=this,a=$(&quot;.uis_cart ul li&quot;).eq($(&quot;.uis_cart ul li&quot;).collect(function(e,d){return $(e).data(&quot;id&quot;)==c.id
}).indexOf(true));
this.n.cart.main.find(&quot;.uis_cextend&quot;).slideDown(&quot;650&quot;,function(){$(this).find(&quot;ul&quot;).scrollTop(a.position().top)
});
a.addClass(&quot;blinking&quot;);
setTimeout(function(){b.n.cart.main.find(&quot;.uis_cextend&quot;).slideUp(&quot;650&quot;,function(){b.n.cart.main.find(&quot;.uis_cextend&quot;).removeAttr(&quot;style&quot;)
});
a.removeClass(&quot;blinking&quot;)
},1500)
},selectProd:function(d){if(this.cat_ids.length==0){return this.prodIdToSelect=d
}var c=this;
this.hideCart();
this.n.ul.html(&quot;&quot;);
if(d){$.when(UI_Store.products[d]||UI_Store.getProducts([d])).done(function(){var a=UI_Store.products[d];
if(a!=c.prodSelected){c.prodSelected=a;
c.cpt.page.setCptUrl(&quot;/s&quot;+a.id+&quot;p/&quot;+a.name.to_alphanumeric(),a.name,c.setCptUrl);
c._setProdGui(a)
}else{c._setImagesAndZoom(a)
}c._setProdCart(a)
})
}else{if(v.mode==&quot;editor&quot;){this.prodSelected=&quot;new&quot;;
var b={id:&quot;&quot;,name:&quot;Product name&quot;,reference:&quot;&quot;,desc:&quot;&quot;,img:[{thumbnails:{small:&quot;/images/thumbnails/default_prod.png&quot;},width:350,url:&quot;/images/thumbnails/default_prod.png&quot;,height:350,name:&quot;default_prod.png&quot;,id:0,removable:false,is_default:true}],price:10,strike:0,opts:[],stocks:{},max:99,visible:true,weight:null,category_ids:(this.catSelected&amp;&amp;this.catSelected[0]==&quot;category_id&quot;?[this.catSelected[1]]:[])};
this._setProdGui(b)
}else{this.showList()
}}},_setProdGui:function(c){var d=this.n;
var a=this;
d.prod.id.val(c.id);
function b(){editorController.setContent(d.prod.desc,c.id?UI_Store.products[c.id].desc:c.desc);
a.deselectEditor()
}if(c.desc||c.id==&quot;&quot;){b()
}else{editorController.disable(true);
d.prod.desc.html(&quot;&lt;img src=&apos;/assets/loadingAnimation.gif&apos;&gt;&quot;);
UI_Store.getProduct(c.id,function(){editorController.disable(false);
b();
a.updateCptSize()
})
}this._setProdName(c.name);
this._setProdReference(c.reference);
this._setProdMax(c.max);
this._setProdWeight(c.weight);
this.tmp_img=c.img;
this.tmp_opts=c.opts.slice();
this.tmp_stocks=jQuery.extend({},c.stocks);
this.tmp_cat=c.category_ids.removeAll(0);
this._setProdPrice(c.price,(c.options&amp;&amp;c.options.find(function(e){return $.fn.hash_to_a(e).find_index(function(f){return e[f][&quot;p&quot;]&gt;0
})!=null
})));
this._setProdStrike(c.strike);
this._setProdVisi(c.visible);
this._setProdOpt(c);
this._setProdCart(c);
this._setProdCat();
if(v.mode==&quot;viewer&quot;){$(&quot;.uis_seo_description&quot;,this.n.prod.main).remove()
}else{$(&quot;.uis_seo_description textarea&quot;,this.n.prod.main).val(c.seo_description)
}this.n.list.hide();
this.n.prod.main.show();
this.showCatList();
this.updateCptSize();
this._setImagesAndZoom(c);
if(v.mode!=&quot;viewer&quot;){this.n.prod.img.parent().find(&quot;.uis_img_ed&quot;).css(&quot;top&quot;,(this.n.prod.img.find(&quot;img:first&quot;).height()/2)-32)
}},_setImagesAndZoom:function(a){UI_Store.setImage(this.n.prod.img,a.img,null,true,this.n.prod.imgs);
UI_Store._setZoomProduct(this.n.prod.img.find(&quot;img&quot;),a.img[0])
},_setProdReference:function(a){if(v.mode==&quot;editor&quot;){this.n.prod.ref.find(&quot;input&quot;).val(a||&quot;&quot;)
}},_setProdName:function(a){if(v.mode==&quot;editor&quot;){this.n.prod.name.find(&quot;input&quot;).val(a)
}else{this.n.prod.name.html(a)
}},_setProdPrice:function(c,b){if(v.mode==&quot;editor&quot;){this.n.prod.price.html(&apos;&lt;b&gt;Price:&lt;/b&gt; &lt;input type=&quot;text&quot; size=&quot;5&quot;&gt;&apos;+UI_Store.show_price(null,true)).find(&quot;input&quot;).restrictTo(&quot;price&quot;).val(c).trigger(&quot;blur&quot;).trigger(&quot;change&quot;)
}else{var a=&quot;&quot;;
if(b===true){a+=&quot;from &quot;
}if(b&amp;&amp;b!==true&amp;&amp;b&gt;0){a+=UI_Store.show_price(c+b);
this.n.prod.opt_price.html(sprintf(&quot;%s + %s for the options&quot;,UI_Store.show_price(c),UI_Store.show_price(b)))
}else{a+=UI_Store.show_price(c);
this.n.prod.opt_price.empty()
}this.n.prod.price.html(a)
}},_setProdStrike:function(a){if(v.mode==&quot;editor&quot;){this.n.prod.strike.html(&apos;&lt;b&gt;Strike-through price:&lt;/b&gt; &lt;input type=&quot;text&quot; size=&quot;5&quot;&gt;&apos;+UI_Store.show_price(null,true)).find(&quot;input&quot;).restrictTo(&quot;price&quot;).val(a||0).trigger(&quot;blur&quot;).trigger(&quot;change&quot;)
}else{if(a){this.n.prod.strike.html(&quot;&lt;span class=&apos;uis_strike_price&apos;&gt;&quot;+UI_Store.show_price(a)+&quot;&lt;/span&gt;&quot;).show()
}else{this.n.prod.strike.hide()
}}},_setProdMax:function(a){if(v.mode==&quot;editor&quot;&amp;&amp;this.n.prod.max&amp;&amp;typeof(a)==&quot;number&quot;){this.n.prod.max.val(a).trigger(&quot;blur&quot;).trigger(&quot;change&quot;)
}},_setProdVisi:function(a){if(v.mode==&quot;editor&quot;){this.n.prod.visi.find(&quot;input&quot;).prop(&quot;checked&quot;,a)
}},_setProdWeight:function(a){if(v.mode==&quot;editor&quot;){this.n.prod.weight.find(&quot;input&quot;).restrictTo(&quot;int&quot;).val(a||0).trigger(&quot;blur&quot;).trigger(&quot;change&quot;)
}},_setProdOpt:function(e){var b=this,f=(v.mode==&quot;editor&quot;)?this.tmp_opts:e.opts,a=true,g=this.n.prod.opt.find(&quot;&gt;div:last&quot;).empty();
this.n.prod.opt.hide();
if(f&amp;&amp;f.length&gt;0){var d=&quot;&lt;table&gt;&quot;;
for(var c=0;
c&lt;f.length;
c++){if(f[c]){d+=&quot;&lt;tr&gt;&lt;td&gt;&quot;+(!f[c][&quot;name&quot;].match(/^-h-\d+/)?f[c][&quot;name&quot;]:&quot;&quot;)+&quot;&lt;td&gt;&quot;
}if(f[c].options&amp;&amp;$.fn.hash_size(f[c].options)&gt;0){d+=UI_Store.option2select(f[c])
}else{d+=UI_Store.option2input(f[c],&quot;&quot;)
}a=false
}if(d.length&gt;0){g.html(d).find(&quot;select&quot;).change(function(){$(this).removeAttr(&quot;firstTime&quot;);
b._setProdCart(e)
});
g.find(&quot;input, textarea&quot;).blur(function(){var h=$(this).removeAttr(&quot;firstTime&quot;),i=h.val().substr(0,f[&quot;&lt;&quot;]);
h.val(i)
});
this.n.prod.opt.show()
}}if(v.mode==&quot;editor&quot;){if(a){$(&quot;&lt;div&gt;No option defined&lt;/div&gt;&quot;).appendTo(g)
}fake_button({text:&quot;Edit product options&quot;,icon:$.fn.fonticon(&quot;block&quot;)}).appendTo(g).click(function(){tb_show(null,&quot;/store_options/options?product=1&amp;alone=1&amp;width=1000&amp;height=500&amp;TB_iframe&quot;)
});
this.n.prod.opt.show()
}},_getOptMax:function(e){var d=this.n.prod.opt.find(&quot;&gt;div:last&quot;).find(&quot;option:selected&quot;).collect(function(f){return $(f).attr(&quot;data-managed&quot;)?$(f).val().html_encode():&quot;|&quot;
});
var c=e.stocks[JSON_.stringify(d)],b=-1,a=d.slice();
while(c==undefined&amp;&amp;b++&lt;a.length){d=a.slice();
d[b]=&quot;|&quot;;
c=e.stocks[JSON_.stringify(d)]
}return c
},_getMaxStock:function(c){var a=false;
var b=$.map(c.stocks,function(e,d){if(e===null){a=true
}return e
});
if(b.length==0){return c.max
}else{if(a||c.opts.find(function(d){return d.options&amp;&amp;$.map(d.options,function(f,e){return f
}).find(function(e){return !e.s
})
})){b.push(c.max)
}return Math.max.apply(Math,b)
}},saveOptAndStock:function(a,b){this.tmp_opts=[].concat(a);
this.tmp_stocks=jQuery.extend({},b);
this._setProdOpt(this.cpt);
tb_remove()
},optionsVal:function(){var b=this.n.prod.opt.find(&quot;select, input, textarea&quot;).collect(function(a){return[$(a).attr(&quot;name&quot;),$(a).val()]
});
return JSON_.stringify(b)
},_setProdCart:function(p){if(this.n.cart&amp;&amp;this.n.cart.add){var c=[],a=UI_Store.cart.items[p.id],n=this.n.cart.prod.hide(),t=[];
for(var i in a){try{eval(&quot;c=&quot;+i);
t.push(&quot;&lt;b&gt;&quot;+a[i]+&quot; &quot;+(a[i]&gt;1?&quot;items&quot;:&quot;item&quot;)+&quot;&lt;/b&gt; &lt;i&gt;&quot;+UI_Store.options2html(c)+&quot;&lt;/i&gt;&quot;)
}catch(e){}}if(t.length&gt;0){n.show().find(&quot;div:last&quot;).html(t.join(&quot;&lt;br&gt;&quot;))
}var max=this._getOptMax(p);
max=Math.min((max||max==0)?max:p.max,p.max);
this.n.cart.add.find(&quot;.uis_addcart_x&quot;).hide();
if(max==0){this.n.cart.add.find(&quot;.uis_addcart_0&quot;).show()
}else{if(max==1){this.n.cart.add.find(&quot;.uis_addcart_1&quot;).show()
}else{var s=this.n.cart.add.find(&quot;.uis_alert div&quot;);
s.find(&quot;span&quot;).html(max);
this.n.cart.add.find(&quot;input&quot;).restrictTo(&quot;int&quot;,0,max,function(v){if(v&gt;max){s.show();
setTimeout(function(){s.hide()
},3000)
}});
this.n.cart.add.find(&quot;.uis_addcart_n&quot;).show();
this.n.cart.add.find(&quot;input&quot;).val(1);
if(this.cpt.data.show_stocks&amp;&amp;this.cpt.data.style==&quot;m&quot;){if(max&gt;1&amp;&amp;max&lt;=this.cpt.data.stock_limit){this.n.cart.add.find(&quot;.uis_addcart_n_limit&quot;).show().find(&quot;span:first&quot;).text(max)
}else{if(max&gt;this.cpt.data.stock_limit){this.n.cart.add.find(&quot;.uis_addcart_n_available&quot;).show()
}}}}}var self=this;
setTimeout(function(){var ks=[];
try{eval(&quot;ks=&quot;+self.optionsVal())
}catch(e){dbg.error(&quot;ERROR during EVAL&quot;)
}var bsk=UI_Store.extractBonusAndStockKey(self.prodSelected,ks);
self._setProdPrice(p.price,bsk[0]/100)
})
}},_setProdCat:function(h){if(h==null){h=this.tmp_cat||[]
}var e=this;
if(v.mode==&quot;editor&quot;){this.n.prod.cat_select.hide();
var g=0;
for(var f in UI_Store.categories){g++
}if(g&gt;1){this.n.prod.cat_add.show();
this.n.prod.cat_none.hide();
var d=&quot;&quot;;
var c=UI_Store.catjoin(function(){var a=&quot;&lt;li data-cat_id=&quot;+this.id+&quot; class=uis_ed&gt;&quot;+this.name;
if(!this.id||!h.include(this.id)){if(this.id){d+=a
}return&quot;&quot;
}return a
});
this.n.prod.clist.show().html(c.length&gt;0?c:&quot;&lt;i&gt;No category selected&lt;/i&quot;);
this.n.prod.cat_select.html(d.length&gt;0?d:&quot;&lt;li&gt;&lt;i&gt;All the categories are already selected [Close]&lt;/i&gt;&quot;)
}else{this.n.prod.clist.hide();
this.n.prod.cat_add.hide();
this.n.prod.cat_none.show()
}}else{var c=UI_Store.catjoin(function(){if(!this.id||!h.include(this.id)||!UI_Store.categories[this.id].stores.include(e.cpt.idserver)){return&quot;&quot;
}return&quot;&lt;li data-cat_id=&quot;+this.id+&quot;&gt;&quot;+this.name
});
if(c.length&gt;0){this.n.prod.cat.show();
this.n.prod.clist.html(c)
}else{this.n.prod.cat.hide()
}}},_setUrl:function(){if(this.cpt.page.cptUrl){if(this.cpt.data.auto_scroll&amp;&amp;!this.n.main.isTopIntoView()){this.n.main.scrollIntoView(true)
}var a=this.cpt.page.cptUrl.match(/s(\d+)([pcbs])(\d*)\/(.*)/);
if(a){var c=parseInt(a[1]);
var b=this;
if(a[2]==&quot;p&quot;){if(UI_Store.products[c]){return this.selectProd(c)
}else{return UI_Store.getProducts([c]).done(function(){b.selectProd(c)
}).fail(function(){b.selectCat(null,true)
})
}}else{if(a[2]==&quot;b&quot;){if(a[1]==1){return this.showCart(&quot;m&quot;)
}else{return this.showCart()
}}else{if(a[2]==&quot;s&quot;){return this.selectSearch(decodeURI(a[4]),parseInt(a[3]))
}else{return this.selectCat(c,this.prodSelected!=null,null,a[3])
}}}}}if((a&amp;&amp;a[0]==&quot;s&quot;)||!this.cpt.page.cptUrl){this.selectCat(null,true)
}},createCartHeader:function(){var b=$(&apos;&lt;div class=&quot;uis_cart&quot;&gt;&lt;div class=&quot;uis_headf&quot;&gt;&lt;div class=&quot;fonticon&quot;&gt;&apos;+$.fn.fonticon(&quot;cart&quot;)+&apos;&lt;/div&gt;&lt;div class=&quot;uis_ttlcf&quot;&gt;Cart&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;uis_headf_no&quot;&gt;&lt;div class=&quot;fonticon&quot;&gt;&apos;+$.fn.fonticon(&quot;favicon&quot;)+&apos;&lt;/div&gt;&lt;div class=&quot;uis_ttlcf&quot;&gt;Click to add a payment method&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;uis_cresume&quot;&gt;&lt;div class=uis_pr&gt;&lt;img src=&quot;/assets/loading/16x16.gif&quot;&gt;&lt;/div&gt; (&lt;div class=uis_ttl&gt;&lt;img src=&quot;/assets/loading/16x16.gif&quot;&gt;&lt;/div&gt;&lt;div class=&quot;uis_unit&quot;&gt;items&lt;/div&gt;)&lt;/div&gt;&lt;div class=&quot;uis_cextend&quot;&gt;&lt;div class=&quot;uis_ul_w&quot;&gt;&lt;/div&gt;&lt;div class=&quot;uis_exbtn&quot;&gt;&apos;+UI_Store.btn({txt:&apos;&lt;span class=&quot;uis_bsa&quot;&gt;View Cart&lt;/span&gt;&apos;})+&quot;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;);
if(!this.n.cart){this.n.cart={}
}else{if(v.mode!=&quot;editor&quot;&amp;&amp;this.n.cart.add){return
}}var a=this;
if(!this.n.cart.main){this.n.cart.main=b.insertBefore(this.n.cat)
}else{this.n.cart.main=b.replaceAll(this.n.cart.main)
}if($.fn.hash_size(UI_Store.conf.methods)&gt;0){this.n.cart.items=this.n.cart.main.find(&quot;.uis_ttl&quot;);
this.n.cart.price=this.n.cart.main.find(&quot;.uis_pr&quot;);
this.n.cart.articles=this.n.cart.main.find(&quot;.uis_cextend&quot;);
this.n.cart.main.find(&quot;.uis_cresume, .uis_headf, .uis_exbtn&quot;).click(function(){a.showCart()
});
if(v.mode!=&quot;editor&quot;){var c=this.n.prod.main.find(&quot;.uis_td_attr&quot;);
this.n.cart.add=$(&quot;&lt;div class=&apos;uis_addcart&apos;&gt;&lt;div class=&apos;uis_addcart_x uis_addcart_0 uisa_s&apos;&gt;Product sold out&lt;/div&gt;&lt;div class=&apos;uis_addcart_x uis_addcart_1&apos;&gt;&lt;div class=&apos;uisa_l&apos; style=&apos;width: 100%&apos;;&gt;Only one product left&lt;/div&gt;&quot;+UI_Store.btn({txt:&quot;&lt;span class=&apos;uis_bsa&apos;&gt;Add to cart&lt;/span&gt;&quot;})+&quot;&lt;/div&gt;&lt;div class=&apos;uis_addcart_x uis_addcart_n&apos;&gt;&lt;div class=&apos;uis_addcart_x uis_addcart_n_limit uisa_l&apos;&gt;Only &lt;span&gt;&lt;/span&gt; Products left&lt;/div&gt;&lt;div class=&apos;uis_addcart_x uis_addcart_n_available uisa_a&apos;&gt;Available&lt;/div&gt;&lt;div&gt;&lt;b&gt;Add to cart: &lt;/b&gt;&lt;/div&gt;&lt;input type=text size=1&gt;&quot;+UI_Store.btn({txt:&quot;&lt;span class=&apos;uis_bsa&apos;&gt;Add&lt;/span&gt;&quot;})+&quot;&lt;div class=uis_alert&gt;&lt;div&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp;items maximum&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;).appendTo(c);
this.n.cart.prod=$(&quot;&lt;div class=uis_prodcart&gt;&lt;small&gt;Items already in your shopping cart: &lt;div&gt;&lt;/div&gt;&lt;/small&gt;&lt;/div&gt;&quot;).appendTo(c);
this.n.cart.add.find(&quot;.uis_btn:first&quot;).click(function(){if(UI_Store.checkCartOptions(a.n.prod.opt,a.prodSelected.opts)){UI_Store.updateItem(a.prodSelected,1,a.optionsVal()||&quot;&quot;,true);
a.addToCart(a.prodSelected)
}});
this.n.cart.add.find(&quot;.uis_btn:last&quot;).click(function(){if(UI_Store.checkCartOptions(a.n.prod.opt,a.prodSelected.opts,true)){UI_Store.updateItem(a.prodSelected,a.n.cart.add.find(&quot;input&quot;).val(),a.optionsVal()||&quot;&quot;);
a.addToCart(a.prodSelected)
}});
if(this.prodSelected){this._setProdGui(this.prodSelected)
}}else{this.n.cart.main.find(&quot;.uis_headf_no&quot;).hide()
}sigCtl.connect(&quot;UI_Store.updateCart&quot;,function(){a.next_show.done(function(){a.updateCart()
})
});
UI_Store.updateCartHtml();
if(UI_Store.cart.items.price!=0&amp;&amp;$.cookie(&quot;uis_last_unpaid_order&quot;)){a.cpt.ask({request:&quot;order_status&quot;,data:{order:$.cookie(&quot;uis_last_unpaid_order&quot;)}},function(d){if(d.paid){UI_Store.removeItems()
}})
}else{$.cookie(&quot;uis_last_unpaid_order&quot;,null)
}this.n.cart.main.show()
}else{if(this.n.cart){if(v.mode==&quot;editor&quot;&amp;&amp;this.n.prod.max){this.n.prod.max.parent().hide()
}if(v.mode==&quot;editor&quot;){this.n.cart.main.find(&quot;.uis_headf_no&quot;).show().on(&quot;click&quot;,function(){propertyConverter.convertServer_manage(UI_Store.cpts[0],$(&quot;&lt;server_manage name=&apos;payment_conf&apos; url=&apos;/store_provider/all&apos; /&gt;&quot;)).defaultAction(blockSelector.selectedCpt())
});
this.n.cart.main.find(&quot;.uis_headf, .uis_cresume&quot;).hide()
}else{this.n.cart.main.hide()
}}}this.updateCptSize()
},updateCart:function(){if(this.n.cart){var a=this;
a.n.cart.main.desactivate();
setTimeout(function(){if(UI_Store.cart.num&gt;0){a.n.cart.main.activate()
}},500);
this.n.cart.items.html(&quot;&quot;+UI_Store.cart.num);
this.n.cart.price.html(&quot;&quot;+UI_Store.show_price(UI_Store.cart.price));
this.n.cart.articles.find(&quot;.uis_ul_w&quot;).html(UI_Store.cartHtmlProd.clone(true)).find(&quot;li&quot;).each(function(){$(this).on(&quot;click&quot;,function(){a.selectProd($(this).data(&quot;id&quot;));
return false
})
});
this.n.billc.html(UI_Store.ct.clone(true));
if(!this.payment_error){this.payment_error=location.pathname.match(/-PEN(\d+)$/);
if(this.payment_error){var b={&quot;4001&quot;:&quot;Transaction refused&quot;,&quot;4002&quot;:&quot;Not enough funds on this card&quot;,&quot;4003&quot;:&quot;Transaction refused&quot;,&quot;4004&quot;:&quot;Transaction abandoned&quot;,&quot;4005&quot;:&quot;Suspicion of fraud&quot;,&quot;4006&quot;:&quot;Card in opposition&quot;,&quot;4007&quot;:&quot;Card in opposition&quot;,&quot;4008&quot;:&quot;Authentication failed&quot;,&quot;4009&quot;:&quot;Authentication expired&quot;,&quot;4010&quot;:&quot;Invalid transaction&quot;,&quot;4011&quot;:&quot;Double transaction&quot;,&quot;4012&quot;:&quot;Incorrect card informations&quot;,&quot;4013&quot;:&quot;Transaction refused&quot;};
$(&quot;.uis_payment_err&quot;,this.n.billc).show().html(&quot;Payment error: &quot;+(b[this.payment_error[1]]||this.payment_error[1])+&quot;&lt;br&gt;Please retry your payment&quot;)
}else{this.payment_error=-1
}}this.updateCptClass();
this.updateCptSize();
this.n.bill.find(&quot;.uis_order_follow&quot;).unbind(&quot;click&quot;).click(function(){UI_Store.removeItems();
a.selectList(a.catSelected,true);
a.hideCart();
tb_show(null,&quot;/cpt_member/member_space?site_id=&quot;+v.site_id+&quot;TB_iframe=true&amp;height=500&amp;width=1000&quot;)
});
this.n.bill.find(&quot;.uis_back_to_store&quot;).unbind(&quot;click&quot;).click(function(){UI_Store.removeItems();
a.selectList(a.catSelected,true);
a.hideCart()
});
this.n.bill.find(&quot;.uis_sb&quot;).unbind(&quot;click&quot;).click(function(){a.selectList(a.catSelected,true);
a.hideCart()
});
this.n.bill.find(&quot;.uis_sc&quot;).unbind(&quot;click&quot;).click(function(){a.showCartPage(&quot;c&quot;);
return false
});
this.n.bill.find(&quot;.uis_sbp&quot;).unbind(&quot;click&quot;).click(function(){if(UI_Store.cart.num==0){return alert(&quot;Your shopping cart is empty.&quot;)
}if(!UI_Store.checkCartOptions($(&quot;.uis_options table&quot;,a.n.billc),UI_Store.conf.options,true)){return alert(&quot;Please fill in your cart options.&quot;)
}a.updatePaymentFormHtml($(this).attr(&quot;method&quot;));
a.showCartPage(&quot;f&quot;)
});
this.n.bill.find(&quot;.uis_sbpm&quot;).unbind(&quot;click&quot;).click(function(){var f=this;
$(f).parent().hide();
var h=$(&quot;&lt;img style=&apos;float: right;&apos; src=&apos;/assets/loadingAnimation.gif&apos;&gt;&quot;).appendTo($(f).parent().parent());
var e=a.n.bill.find(&quot;.uis_cerr&quot;).empty();
var c=a.n.bill.find(&quot;.uis_bft&quot;).find(&quot;input, textarea, select&quot;).removeClass(&quot;uis_pf_err&quot;);
var d={};
c.each(function(){var i=$(this);
d[i.attr(&quot;name&quot;)]=i.val()
});
d.name=d.member_name+&quot; &quot;+d.member_firstname;
var g=$(&quot;._ui18_member_signin:visible&quot;,a.n.bill).length&gt;0;
a.cpt.ask({request:&quot;order&quot;,data:{normal_return_url:location.protocol+&quot;//&quot;+location.host+v.selectedPageFg.getUrl(false,&quot;/s1b/Congratulations&quot;),cancel_return_url:location.protocol+&quot;//&quot;+location.host+v.selectedPageFg.getUrl(false,&quot;/s0b/View-shopping-cart&quot;),cart:UI_Store.cart,user:d,signin:g}},function(i){if(i.success){if(g){a.updatePaymentFormHtml($(f).attr(&quot;method&quot;))
}else{if(d.m==&quot;cb&quot;){a.n.bill.find(&quot;.uis_cb_form&quot;).html(i.form);
if(i.mode==&quot;submit&quot;){a.n.bill.find(&quot;.uis_cb_form form&quot;).submit();
h=&quot;keep_loading&quot;
}else{if(i.mode==&quot;show&quot;){a.showCartPage(&quot;cb&quot;)
}}}else{a.showCart();
var k=a.showCartPage(&quot;m&quot;);
if(UI_Store.conf.methods.length==1){k.find(&quot;.uis_sc&quot;).hide()
}else{k.find(&quot;.uis_sc&quot;).show()
}}}$.cookie(&quot;uis_last_payment_method&quot;,d.m,{expires:1,path:&quot;/&quot;});
if(i.order_reference){$.cookie(&quot;uis_last_unpaid_order&quot;,i.order_reference,{expires:365,path:&quot;/&quot;})
}}if(h!=&quot;keep_loading&quot;){h.remove();
$(f).parent().show()
}},function(l){$(f).parent().show();
h.remove();
var m=[];
for(var k in l){var o=c.filter(&quot;[name=&quot;+k+&quot;]:visible&quot;);
if(o.length==0){m.push(l[k])
}else{o.addClass(&quot;uis_pf_err&quot;);
m.push((k.match(/^member/)?&quot;&quot;:o.parents(&quot;tr:first&quot;).find(&quot;td:first&quot;).html().replace(/\*/,&quot;&quot;))+l[k])
}}e.html(&quot;&lt;div style=&apos;padding:10px&apos;&gt;Please fix the errors below:&lt;div style=&apos;font-weight:normal&apos;&gt;&quot;+m.join(&quot;&lt;br&gt;&quot;)+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);
a.updateCptSize()
})
})
}},updatePaymentFormHtml:function(d){d=d||this.current_provider;
this.current_provider=d;
var c=this.n.bill;
var b=UI_Store.conf.methods[d];
c.find(&quot;.uis_bfb&quot;).html(b.before);
c.find(&quot;.uis_bfa&quot;).html(b.after);
var f=c.find(&quot;.uis_bft&quot;).empty();
if(MemberController.isConnected()){f.append(&quot;&lt;tr class=_ui18_member_signup&gt;&lt;td&gt;Name *&lt;/td&gt;&lt;td&gt;&lt;input type=hidden name=m value=&apos;&quot;+d+&quot;&apos;&gt;&lt;input type=text name=member_name&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=_ui18_member_signup&gt;&lt;td&gt;Firstname *&lt;/td&gt;&lt;td&gt;&lt;input type=text name=member_firstname&gt;&lt;/td&gt;&lt;/tr&gt;&quot;);
$(&quot;.member_unconnected&quot;,c).hide();
var a=this;
var e=$(&quot;&lt;tr&gt;&lt;td colspan=2&gt;&lt;img src=&apos;/assets/loadingAnimation.gif&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&quot;).prependTo(f);
this.cpt.ask({request:&quot;member_coordinates&quot;,data:{}},function(k){e.remove();
if(k.coordinates&amp;&amp;k.coordinates.length&gt;0){f.prepend(&quot;&lt;tr&gt;&lt;td colspan=2&gt;&lt;div style=&apos;font-size:20px;&apos;&gt;Previous personal details:&lt;/div&gt;&lt;div class=previous_coordinates&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&quot;);
var i=f.find(&quot;.previous_coordinates&quot;);
var g=[];
k.coordinates.each(function(m){var l=$(&quot;&lt;div style=&apos;float:left;line-height:normal&apos;&gt;&lt;/div&gt;&quot;).appendTo(i);
g.push(l);
$(&quot;&lt;div&gt;&quot;+m.html+&quot;&lt;/div&gt;&quot;).appendTo(l);
$(&quot;&lt;div class=&apos;uis_btn&apos;&gt;&lt;span class=&apos;uis_bsa uis_sc&apos;&gt;Use this address&lt;/span&gt;&lt;span class=&apos;uis_bse&apos;&gt;&lt;/span&gt;&lt;/div&gt;&quot;).appendTo(l).click(function(){$(&quot;[name=member_name]&quot;,f).val((m.name||&quot;&quot;).split(&quot; &quot;)[0]);
$(&quot;[name=member_firstname]&quot;,f).val((m.name||&quot;&quot;).split(&quot; &quot;)[1]||&quot;&quot;);
if(m.street){$(&quot;[name=street]&quot;,f).val(m.street)
}if(m.zip){$(&quot;[name=zip]&quot;,f).val(m.zip)
}if(m.city){$(&quot;[name=city]&quot;,f).val(m.city)
}if(m.country_id){$(&quot;[name=country_id]&quot;,f).val(m.country_id)
}if(m.phone){$(&quot;[name=phone]&quot;,f).val(m.phone)
}if(m.comment){$(&quot;[name=comment]&quot;,f).val(m.comment)
}})
});
var h=g.collect(function(l){return l.height()
}).max();
g.each(function(l){l.height(h)
});
a.updateCptSize()
}},function(g){e.remove()
})
}else{f.append(&quot;&lt;tr class=_ui18_member_signin&gt;&lt;td&gt;Email *&lt;/td&gt;&lt;td&gt;&lt;input type=text name=member_email autocomplete=&apos;email&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=_ui18_member_signin&gt;&lt;td&gt;Password *&lt;/td&gt;&lt;td&gt;&lt;input type=password name=member_password autocomplete=&apos;current-password&apos;&gt;&lt;br&gt;Contact us to get back your password.&lt;/td&gt;&lt;/tr&gt;&lt;tr class=_ui18_member_signup&gt;&lt;td&gt;Name *&lt;/td&gt;&lt;td&gt;&lt;input type=hidden name=m value=&apos;&quot;+d+&quot;&apos;&gt;&lt;input type=text name=member_name autocomplete=&apos;family-name&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=_ui18_member_signup&gt;&lt;td&gt;Firstname *&lt;/td&gt;&lt;td&gt;&lt;input type=text name=member_firstname autocomplete=&apos;given-name&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=_ui18_member_signup&gt;&lt;td&gt;Email *&lt;/td&gt;&lt;td&gt;&lt;input type=text name=member_email autocomplete=&apos;email&apos;&gt;&lt;/td&gt;&lt;/tr&gt;&quot;);
$(&quot;.member_unconnected&quot;,c).show()
}$(&quot;._ui18_member_signin&quot;,f).hide();
[[&quot;street&quot;,&quot;Address&quot;,&quot;textarea&quot;,&quot;a&quot;,&quot;street-address&quot;],[&quot;zip&quot;,&quot;Zip&quot;,&quot;text&quot;,&quot;a&quot;,&quot;postal-code&quot;],[&quot;city&quot;,&quot;City&quot;,&quot;text&quot;,&quot;a&quot;,&quot;address-level2&quot;],[&quot;country_id&quot;,&quot;Country&quot;,&quot;country_select&quot;,&quot;co&quot;,null],[&quot;phone&quot;,&quot;Phone&quot;,&quot;text&quot;,&quot;p&quot;,&quot;tel&quot;],[&quot;comment&quot;,&quot;Comment&quot;,&quot;textarea&quot;,&quot;c&quot;,null]].each(function(h){var k=b.data[h[3]];
if(k!=&quot;h&quot;){html=&quot;&lt;tr class=_ui18_member_signup&gt;&lt;td&gt;&quot;+h[1]+&quot; &quot;+(k==&quot;c&quot;?&quot;*&quot;:&quot;&quot;)+&quot;&lt;/td&gt;&lt;td&gt;&quot;;
var g=(k==&quot;c&quot;?&quot;uis_req&quot;:&quot;&quot;);
var i=(h[4]?&quot; autocomplete=&apos;&quot;+h[4]+&quot;&apos;&quot;:&quot;&quot;);
switch(h[2]){case&quot;text&quot;:html+=&quot;&lt;input type=text name=&quot;+h[0]+&quot; class=&apos;&quot;+g+&quot;&apos;&quot;+i+&quot;&gt;&quot;;
break;
case&quot;textarea&quot;:html+=&quot;&lt;textarea name=&quot;+h[0]+&quot; class=&apos;&quot;+g+&quot;&apos;&quot;+i+&quot;&gt;&lt;/textarea&gt;&quot;;
break;
case&quot;country_select&quot;:html+=&quot;&lt;select id=country_select name=&quot;+h[0]+&quot; class=&apos;&quot;+g+&quot;&apos;&quot;+i+&quot;&gt;&lt;/select&gt;&quot;;
break
}html+=&quot;&lt;/td&gt;&lt;/tr&gt;&quot;;
f.append(html)
}});
$.get(&quot;/cpt_store/country_list&quot;,function(g){$(&quot;#country_select&quot;).replaceWith($(g).find(&quot;select&quot;).attr(&quot;name&quot;,&quot;country_id&quot;).attr(&quot;class&quot;,$(&quot;#country_select&quot;).attr(&quot;class&quot;)))
})
},showCart:function(b){if(this.cpt.id&amp;&amp;this.n.bill.is(&quot;:hidden&quot;)){this.n.catal.hide();
if(b==&quot;m&quot;){if($.fn.hash_size(UI_Store.conf)==0){var a=this;
return setTimeout(function(){a.showCart(b)
},100)
}UI_Store.removeItems();
this.n.bill.find(&quot;.uis_bfa&quot;).html(UI_Store.conf.methods[$.cookie(&quot;uis_last_payment_method&quot;)||&quot;paypal&quot;].after);
$.cookie(&quot;uis_last_payment_method&quot;,null);
this.showCartPage(&quot;m&quot;).find(&quot;.uis_sc&quot;).hide();
this.cpt.page.setCptUrl(&quot;/s1b/Congratulations&quot;,&quot;Order successfully sent&quot;,this.cpt)
}else{this.showCartPage(&quot;c&quot;);
this.cpt.page.setCptUrl(&quot;/s0b/View-shopping-cart&quot;,&quot;View shopping cart&quot;,this.cpt)
}this.n.bill.show();
this.updateCptSize()
}},hideCart:function(){if(this.cpt.id){if(UI_Store.loaded){this.n.catal.show()
}this.n.bill.hide();
this.updateCptSize()
}},showCartPage:function(b){var a=this;
if(b==&quot;f&quot;){sigCtl.connect(&quot;Member.connection_state_changed&quot;,function(e,d){a.updatePaymentFormHtml()
},&quot;store_update&quot;)
}else{sigCtl.disconnect(&quot;Member.connection_state_changed&quot;,&quot;store_update&quot;)
}this.n.bill.find(&quot;.uis_bill_page&quot;).hide();
var c=this.n.bill.find(&quot;.uis_bill_&quot;+b).show();
this.updateCptSize();
return c
},showSearchResult:function(c,d){if(this.preventNotSaved()){return
}var b=this;
switch(c){case&quot;word&quot;:this.triggerSearch(d);
break;
case&quot;category&quot;:case&quot;product&quot;:var e;
var a=d[1];
if((c==&quot;category&quot;&amp;&amp;this.cat_ids.indexOf(a)!=-1)||(c==&quot;product&quot;&amp;&amp;((this.cat_ids.length==1&amp;&amp;this.cat_ids[0]==0)||(this.cat_ids.find(function(f){if(f==0){return false
}else{return UI_Store.categories[f].products.indexOf(a)!=-1
}}))))){e=v.getSelectedPage()
}else{e=v.selectPageFromUrl(d[0])
}$.when(e).done(function(g){var f=g.cpts.find(function(h){return h.component_type.class_name==&quot;UI_Store&quot;
});
if(f){$(&quot;input&quot;,f.ui.n.search).val($(&quot;input&quot;,b.n.search).val()).change();
if(c==&quot;category&quot;){f.ui.selectCat(a,true)
}else{f.ui.selectProd(a)
}}});
break;
case&quot;search&quot;:$(&quot;.uis_search_suggest&quot;,this.n.search).removeClass(&quot;uis_typing&quot;);
this.cpt.page.setCptUrl(&quot;/s0s0/&quot;+encodeURI(d),d);
break
}},searchLoading:function(a){this.search_loading+=a;
this.n.search.toggleClass(&quot;uis_search_loading&quot;,this.search_loading!=0)
},bindSearch:function(){var d=this;
this.search_loading=0;
UI_Store.suggestions=UI_Store.suggestions||{};
var e=this.n.search;
$(&quot;.uis_btn .fonticon&quot;,e).html($.fn.fonticon(&quot;search&quot;));
$(&quot;.uis_close_search .fonticon&quot;,e).html($.fn.fonticon(&quot;close&quot;));
$(&quot;.uis_close_search&quot;,this.n.search).click(function(){d.triggerSearch(&quot;&quot;)
});
var b=&quot;&quot;;
var a=&quot;&quot;;
var c=function(){var f=$(&quot;.uis_search_suggest&quot;,e).removeClass(&quot;uis_result_available&quot;);
$(&quot;&gt;div&gt;div&quot;,f).remove();
$(&quot;&gt;div&quot;,f).hide();
if(b.length==0){return
}var h=UI_Store.suggestions[b];
if(!h){var g=b;
while(!h&amp;&amp;g.length&gt;1){g=g.substr(0,g.length-1);
h=UI_Store.suggestions[g]
}if(!h){return
}var i={results:[]};
h.results.each(function(k){if(k[0].remove_accents().toLowerCase().indexOf(b)!=-1){i.results.push(k)
}});
h=i
}if(h.results.length&gt;0){f.addClass(&quot;uis_result_available&quot;)
}h.results.each(function(k){var l=$(&quot;&lt;div&gt;&quot;).appendTo(f.find(&quot;.uis_suggest_&quot;+k[1]).show()).text(k[0]).click(function(){d.showSearchResult(k[1],k[2])
});
if(k[3]){l.prepend($(&quot;&lt;img&gt;&quot;).attr(&quot;src&quot;,cdn_url(k[3])))
}});
b.split(/\s+/).sort(function(l,k){return l-k
}).each(function(k){if(k.length&gt;0){$(&quot;&gt;div&gt;div&quot;,f).highlight(k)
}})
};
$(&quot;input&quot;,e).on($.change_events,function(g){if(g.which==27){$(this).val(&quot;&quot;)
}b=$(this).val().remove_accents().toLowerCase();
if(g.which==13){return d.triggerSearch()
}if(a==b){return
}$(&quot;.uis_search_suggest&quot;,e).addClass(&quot;uis_typing&quot;);
a=b;
var f=b;
if(!UI_Store.suggestions[f]&amp;&amp;f.length&gt;0){d.searchLoading(1);
d.cpt.ask({request:&quot;search_suggest&quot;,query:f},function(h){UI_Store.suggestions[f]=h;
c()
}).always(function(){d.searchLoading(-1)
})
}c()
});
$(&quot;.uis_btn&quot;,e).click(function(){d.showSearchResult(&quot;search&quot;,b)
})
},onFontFamilyUpdate:function(){this.updateCptSize()
}};</script><style>.uis_warn,.uis_payment_err{color:#b00;background-color:#FFF;padding:5px;font-size:16px;font-weight:800;text-decoration:underline;text-align:center}
.uis_catalog,.uis_payment_err{display:none}
.uis_cat{clear:both;margin:20px 0}
.uis_cat ul{margin:0;padding:10px 0;text-align:center;line-height:50px}
.uis_cat li{display:inline;text-decoration:underline;cursor:pointer;margin:0 5px 0 0;padding:10px;border:1px solid #000;white-space:nowrap;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}
.uis_cat li.uis_sel{border:2px solid #000;text-decoration:none;font-weight:800;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0}
.uis_page{display:none}
.uis_cmd_p{margin:10px;text-align:right}
.uis_sort{padding:10px 0;float:left;margin:9px 0 0}
.uis_sort span{text-decoration:underline;cursor:pointer}
.uis_sort_hidden{display:none}
.uis_ss{font-weight:900;padding-right:17px;background:transparent url(/stylesheets/components/UI_Store/ascw.gif) no-repeat center right}
.uis_ssa{background-image:url(/stylesheets/components/UI_Store/descw.gif)}
.uis_list{clear:both;margin:10px 0}
.uis_list ul{margin:10px 0;padding:0;clear:both}
.uis_cp_opts{clear:both}
.uis_pages{padding:10px 0;float:right}
.uis_pages li{display:inline;list-style:none;padding:1px 5px;margin:1px 5px;cursor:pointer}
.uis_pages li.selected{background-color:#EEE;cursor:default}
.uis_pages li:hover{font-weight:700}
.uis_pages li.selected:hover{font-weight:400}
.uisl_m .uis_list_img img:not(.no_css){-webkit-user-select:none;-moz-user-select:none;user-select:none;height:auto;width:100%;filter:alpha(Opacity=0);opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}
.uisl_m .uis_list_img img:not(.no_css).img_height{height:100%;width:auto}
.uisl_m .uis_list_img img.no_css{left:calc(50% - 33px);position:absolute;top:calc(50% - 33px)}
.uisl_s .uis_list&gt;ul li{float:left;cursor:pointer;margin:0 5px 5px 0;padding:10px;border:1px solid #000;width:155px;height:180px;overflow:hidden;list-style:none;border-radius:20px;-moz-border-radius:20px;-webkit-border-radius:20px}
.uisl_s .uis_list&gt;ul h3{font-size:12px;height:18px;overflow:hidden;text-align:center}
.uisl_s .uis_list&gt;ul h3 img{float:left}
.uisl_s .uis_list&gt;ul .uis_list_price{text-align:center}
.uisl_s .uis_list_img{width:150px;height:150px;text-align:center;display:table-cell;vertical-align:middle}
.uis_list_strike,.uis_strike_price{font-weight:700;text-decoration:line-through}
.uis_list_strike{color:#b00}
.uisl_m .uis_list_strike,.uisl_m .uis_strike_price{text-decoration:line-through;font-weight:400;color:rgba(255,255,255,.5)}
.uisl_h .uis_list_strike{display:block}
.uisl_l .uis_list&gt;ul li{float:left;cursor:pointer;margin:0 5px 5px 0;padding:10px;border:1px solid #000;width:249px;height:300px;overflow:hidden;list-style:none;border:none;background:0 0}
.uisl_l .uis_list&gt;ul h3{font-size:12px;height:36px;overflow:hidden;text-align:center}
.uisl_l .uis_list&gt;ul h3 img{float:left}
.uisl_l .uis_list&gt;ul .uis_list_price{text-align:center;font-weight:700}
.uisl_l .uis_list_img{width:250px;height:240px;text-align:center;display:table-cell;vertical-align:middle}
.uis_list ul{display:table;margin:10px 0;padding:0;width:100%}
.uisl_h .uis_list&gt;ul li{clear:both;cursor:pointer;overflow:hidden;list-style:none;display:table-row;padding:5px 0}
.uisl_h .uis_list&gt;ul li.uis_lio{background-color:#F7F7F7}
.uisl_h .uis_list&gt;ul h3,.uisl_h .uis_list&gt;ul .uis_list_img,.uisl_h .uis_list&gt;ul .uis_list_price{display:table-cell;vertical-align:middle}
.uisl_h .uis_list&gt;ul h3{font-size:14px;padding-left:5px;text-align:left}
.uisl_h .uis_list&gt;ul h3 span:first-child{font-size:16px;font-weight:700;padding-bottom:3px;display:inline-block}
.uisl_h .uis_list&gt;ul .uis_list_price{padding:0 5px;text-align:right;font-size:14px}
.uisl_h .uis_list_img{padding:1px 0;text-align:center;display:table-cell;vertical-align:middle;height:120px}
.uisl_h .uis_list_img&gt;div{width:160px}
.uisl_h .uis_list_img&gt;div&gt;img{width:100%;height:auto}
.uisl_m .uis_ar{font-weight:700}
.uisl_m .uis_available{display:block}
.uis_list_img{height:220px;width:300px}
.uisl_m .uis_list_img{height:305px;width:100%}
.uisl_h .uis_list_img{width:auto}
.uis_available,.uis_addcart_n_limit,.uis_addcart_n_available{display:none}
.uis_addcart .uis_addcart_n_limit,.uis_addcart .uis_addcart_n_available{width:100%}
.uisa_l{color:#e87035;font-weight:600}
.uisa_a{color:#69c91a}
.uisa_s{color:#b00}
.uis_addcart_0,.uis_addcart_n_available,.uis_addcart_n_limit,.uis_addcart_1 .uisa_l{font-size:20px}
.ov_prod{display:none}
.uisl_m .uis_list&gt;ul li{margin:3px!important;min-height:380px;position:relative;display:inline-block;vertical-align:middle;list-style:none;cursor:pointer;text-align:center}
.uisl_m .uis_list&gt;ul li h3{min-height:24px;padding-top:10px}
.uisl_m .uis_list&gt;ul li .uis_list_img{text-align:center;position:relative;background-color:#fff;display:table;font-size:0}
.uisl_m .uis_list&gt;ul li .uis_list_img&gt;div{display:table-cell;vertical-align:middle;height:305px}
.uisl_m .uis_list&gt;ul li .uis_list_price{font-size:18px;font-weight:700;color:#B00}
.uisl_m .uis_list&gt;ul li .ov_prod{background-color:rgba(255,255,255,.8);height:60px;left:0;position:absolute;right:0;top:calc(305px - 60px);z-index:10;display:block;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear;opacity:0;pointer-events:none}
.uisl_m .uis_list&gt;ul li .ov_prod&gt;div{color:#333;padding-top:8px}
.uisl_m .uis_list&gt;ul li .ov_prod&gt;div&gt;div{display:inline-block}
.uisl_m .uis_list&gt;ul li .ov_prod&gt;div .fonticon{font-size:39px;cursor:pointer}
.uisl_m .uis_list&gt;ul li .ov_prod&gt;div .ov_text{font-size:18px;padding-left:10px;position:relative;top:-7px}
.uisl_m .uis_list&gt;ul li:hover .ov_prod,.uisl_m .uis_list&gt;ul li.added .ov_prod{opacity:1;pointer-events:auto}
.uisl_h .uis_list&gt;ul li .ov_prod{display:table-cell;vertical-align:middle;text-align:center;padding:0 8px}
.uisl_h .uis_list&gt;ul li .ov_prod&gt;div{background-color:#fff;font-size:16px;color:#333;box-shadow:0 0 2px rgba(0,0,0,.1),2px 2px 2px 0 rgba(0,0,0,.15);border-radius:2px;padding:5px;cursor:pointer}
.uisl_h .uis_list&gt;ul li .ov_prod&gt;div .fonticon{cursor:pointer}
.uis_list&gt;ul li .uis_ps{margin-right:3px}
.uis_sf .uisl_m .uis_list&gt;ul li{width:calc(100% - 6px)}
.uis_s0 .uisl_m .uis_list&gt;ul li{width:calc(50% - 6px)}
.uis_s1 .uisl_m .uis_list&gt;ul li{width:calc(33% - 6px)}
.uis_s2 .uisl_m .uis_list&gt;ul li{width:calc(25% - 6px)}
.uis_prod_responsive .uis_prod .uis_td_imgs,.uis_prod_responsive .uis_prod .uis_td_attr{display:table-row}
.uis_prod_responsive .uis_search{float:none;width:calc(100% - 8px)}
.uis_prod_responsive .uis_cart{float:none}
.uis_prod_responsive .uis_cextend::after{display:none}
.uis_prod_responsive .uis_cextend{border-right:0 none;box-shadow:none;left:0;padding:5px}
.uis_prod_responsive .uisl_l .uis_list&gt;ul li{height:auto;margin-right:0;width:calc(100% - 20px);padding:0}
.uis_prod_responsive .uisl_l .uis_list_img{display:block;height:auto;width:100%}
.uis_prod_responsive .uisl_s .uis_list&gt;ul li{float:none;height:auto;width:calc(100% - 14px);margin:5px 0;padding:0}
.uis_prod_responsive .uisl_s .uis_list_img{display:block;height:auto;text-align:center;width:100%}
.uis_prod_responsive .main_cart&gt;thead td:last-child,.uis_prod_responsive .main_cart&gt;tbody td:last-child,.uis_prod_responsive .main_cart&gt;tfoot td.uis_option_price{display:none}
.uis_prod_responsive .uis_bill .main_cart tbody td{padding:5px 10px}
.uis_prod_responsive .uis_cp_qte{text-align:center}
.uis_prod_responsive td.uis_extra.uis_total_label{text-align:right}
.uis_prod_responsive .uis_bi,.uis_prod_responsive .uis_br{float:none}
.uis_prod_responsive .uis_br{margin-bottom:5px}
.uis_prod_responsive .uis_c_rem{display:none;margin:0;padding:0}
.ov_added{pointer-events:none;background-color:#69c91a;bottom:0;height:50px;left:0;position:absolute;right:0;filter:alpha(Opacity=0);opacity:0;-webkit-transition:opacity .34s ease-in-out;-moz-transition:opacity .34s ease-in-out;-o-transition:opacity .34s ease-in-out;transition:opacity .34s ease-in-out}
.ov_added::after{content:&quot;\2714&quot;;color:#fff;font-family:Icon,sans-serif;font-size:40px;left:0;position:absolute;right:0;text-align:center;top:8px;filter:alpha(Opacity=0);opacity:0;-webkit-transition:-webkit-transform .34s ease-in-out,opacity .34s ease-in-out;-webkit-transition-delay:.1s,.1s;-moz-transition:-moz-transform .34s ease-in-out .1s,opacity .34s ease-in-out .1s;-o-transition:-o-transform .34s ease-in-out .1s,opacity .34s ease-in-out .1s;transition:transform .34s ease-in-out .1s,opacity .34s ease-in-out .1s;transform:translateY(15px);-webkit-transform:translateY(15px)}
.added .ov_added{filter:alpha(Opacity=100);opacity:1}
.added .ov_added::after{transform:translateY(0px);-webkit-transform:translateY(0px);filter:alpha(Opacity=100);opacity:1}
.uis_price{color:#B00;font-weight:700}
.uis_list&gt;ul li.uis_cmd_l{display:inline-table;text-align:center;background-color:rgba(0,0,0,.5);border:3px dashed rgba(255,255,255,.5);background-image:none!important}
.uis_list&gt;ul li.uis_cmd_l&gt;div{color:rgba(255,255,255,.7);display:table-cell;vertical-align:middle}
.uis_list&gt;ul li.uis_cmd_l&gt;div&gt;.fonticon{font-size:31px;cursor:pointer}
.uis_list&gt;ul li.uis_cmd_l&gt;div .uis_cmd_tt{visibility:hidden}
.uis_list&gt;ul li.uis_cmd_l:hover{border:3px dashed rgba(255,255,255,.3)}
.uis_list&gt;ul li.uis_cmd_l:hover .uis_cmd_tt{visibility:visible}
.uisl_m .main_cart{border-collapse:collapse;border-spacing:0;-webkit-box-shadow:0 5px 12px 0 rgba(0,0,0,.2),0 4px 14px 0 rgba(0,0,0,.19);-moz-box-shadow:0 5px 12px 0 rgba(0,0,0,.2),0 4px 14px 0 rgba(0,0,0,.19);box-shadow:0 5px 12px 0 rgba(0,0,0,.2),0 4px 14px 0 rgba(0,0,0,.19);margin:0 auto;width:calc(100% - 40px)}
.uisl_m .main_cart thead td,.uisl_m .main_cart tfoot td{font-size:16px;font-weight:700;padding:15px 5px}
.uisl_m .main_cart .uis_ar{text-align:center}
.uisl_m .main_cart tfoot td.uis_extra{padding:0 10px}
.uisl_m .main_cart .uis_c_thead{font-weight:700;padding:10px 15px}
.uisl_m .main_cart tbody tr td{-webkit-transition:background-color .25s ease;-moz-transition:background-color .25s ease;-o-transition:background-color .25s ease;transition:background-color .25s ease}
.uisl_m .main_cart .uis_cp_qte{text-align:center}
.uisl_m .main_cart .uis_cp_opts{clear:none}
.uis_bill .main_cart tbody td{padding:10px 15px;cursor:default}
.uisl_m .uis_list&gt;ul li.uis_cmd_l{box-sizing:border-box;height:380px}
.uisl_m .uis_list&gt;ul li.uis_cmd_l .uis_cmd_tt{font-size:18px}
.uisl_s .uis_list&gt;ul li.uis_cmd_l{height:176px;width:150px}
.uis_list ul.uisl_l&gt;li.uis_cmd_l{height:294px;width:242px}
.uisl_h .uis_list&gt;ul li.uis_cmd_l{display:table-caption;padding-top:25px}
.uisl_h .uis_list&gt;ul li.uis_cmd_l&gt;div{display:inline-block;height:57px}
.uis_tmpl_helper{display:block;position:absolute;top:-10000px}
.uis_prod{display:none}
.uis_td_imgs{width:350px;text-align:center}
.uis_td_imgs .uis_img{min-height:250px}
.uis_td_imgs .uis_imgs{cursor:pointer}
.uis_td_imgs div{position:relative}
.uis_name,.uis_name input{margin:0 0 10px}
.uis_name{font-size:34px}
.uis_name input{font-size:28px}
.uis_cat_list{display:inline;padding:0 5px}
.uis_cat_list li{float:left;cursor:pointer;list-style:none;border:1px solid #000;padding:0 5px;margin:1px 3px;font-size:11px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;height:auto!important}
.uis_cat_list li.uis_ed{background-image:url(/assets/icons/drop.png);background-position:right top;background-repeat:no-repeat;padding:0 13px 0 5px}
.uis_cat_select{z-index:10000;position:relative}
.uis_cat_select ul{right:0;margin:0;padding:0;position:absolute;top:13px;max-height:200px;overflow-x:visible;overflow-y:auto;padding-right:7px}
.uis_cat_select li.uis_ed{float:none;cursor:pointer;list-style:none;padding:0 5px;background-image:url(/assets/icons/plus.gif);background-position:2px center;background-repeat:no-repeat;padding:0 5px 0 12px;white-space:nowrap}
.uis_img_ed,.uis_desc_ed{cursor:pointer}
.uis_imgs{height:50px;width:180px;text-align:center;display:table-row}
.uis_imgs&gt;div{display:table-cell;vertical-align:middle}
.uis_td_attr{vertical-align:top;padding-left:5px}
.uis_visi,.uis_opt{margin:10px 0}
.uis_price,.uis_strike_price{font-size:20px}
.uis_seo_description textarea{height:40px;width:100%;margin-bottom:10px}
.uis_opt option.label,.uis_extra option.label{background:#000;color:#fff}
.uis_opti{clear:right}
.uis_opti input{width:70%}
.uis_opt_i{width:60px;float:right}
.uis_opt_m,.uis_opt_p,.uis_opt_e,.uis_opt_v{cursor:pointer;background:transparent url(/assets/icons/roundminus.gif) no-repeat 0 0;float:right;width:16px;height:16px}
.uis_opt_p{background-image:url(/assets/icons/roundplus.gif)}
.uis_opt_e{background-image:url(/assets/icons/edit_orig.gif)}
.uis_opt_v{background-image:url(/assets/icons/apply.gif)}
.uis_img_ed{left:calc(50% - 32px);opacity:.7;position:absolute;top:calc(50% - 32px)}
.uis_td_desc{margin-top:20px}
.uis_td_desc .uit_tbl .c{height:auto}
.uis_desc_ed_c{float:left;position:relative;width:100%;height:0;z-index:100}
.uis_desc_ed{position:absolute;left:40%;top:5px;filter:alpha(opacity=70);-moz-opacity:.7;opacity:.7}
.uis_desc{min-height:150px}
.uis_cart{background-color:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.1),2px 2px 2px 0 rgba(0,0,0,.15);float:right;margin:4px;min-width:200px;cursor:pointer;position:relative;z-index:20}
.uis_cart.active:hover,.uis_cart.hovered{box-shadow:0 0 2px rgba(0,0,0,.2),2px 2px 2px 0 rgba(0,0,0,.3)}
.uis_cart.active:hover .uis_cextend{display:block}
.uis_headf{padding:3px;text-align:center}
.uis_headf&gt;div{display:inline-block}
.uis_headf&gt;.fonticon{color:#6ce509;font-size:24px;cursor:pointer}
.uis_headf .uis_ttlcf{color:#333;font-size:18px;padding-left:5px;position:relative;top:-3px}
.uis_headf_no{color:#ff7518;padding:10px;display:none}
.uis_headf_no&gt;div{display:inline-block;padding:5px}
.uis_headf_no .fonticon{font-size:24px}
.uis_headf_no .uis_ttlcf{font-size:16px;position:relative;top:-4px}
.uis_cresume{color:#333;padding:3px;text-align:center}
.uis_cresume&gt;div{display:inline-block;padding:0 2px}
.uis_pr{font-weight:700}
@keyframes CartBlink{0%{filter:alpha(Opacity=0);opacity:0}
100%{filter:alpha(Opacity=100);opacity:1}
}
.uis_cextend{background-color:#fff;border-radius:3px;box-shadow:0 0 2px rgba(0,0,0,.2),2px 2px 2px 0 rgba(0,0,0,.3);min-width:300px;position:absolute;right:0;top:calc(100% - 1px);display:none}
.uis_cextend ul{list-style:outside none none;padding:10px;max-height:400px;overflow-y:auto}
.uis_cextend ul li{display:table;overflow:auto;width:100%;margin-bottom:10px}
.uis_cextend ul li&gt;div{display:table-cell;vertical-align:middle}
.uis_cextend ul li:hover .uis_prodInfos&gt;div:first-child{color:#6ce509}
.uis_cextend ul li.blinking{animation:CartBlink 1s ease-in-out infinite}
.uis_cextend ul .uis_itimg{width:60px}
.uis_cextend::after{position:absolute;content:&quot;&quot;;top:-5px;right:0;width:200px;height:6px;background-color:#fff}
.uis_ul_w{padding:5px 0}
.uis_exbtn .uis_btn{float:none;text-align:center;background-image:none}
.uis_exbtn .uis_btn .uis_bsa{float:none}
.uis_exbtn .uis_btn span{background-image:none!important}
.uis_bsa .fonticon{font-size:17px;margin-right:8px;position:relative;top:2px}
.uis_prodInfos&gt;div:first-child{color:#333}
.uis_prodInfos&gt;div:nth-child(2){opacity:.8}
.uis_prodInfos&gt;div:nth-child(3){color:#333;font-weight:700}
.uis_addcart_x{display:none;position:relative}
.uis_addcart div{float:left;line-height:33px;margin-right:5px}
.uis_addcart input{float:left;margin-top:6px}
.uis_bill{display:none}
.uis_bill .title{clear:both;margin:10px;text-align:center;font-size:26px}
.uis_bill table{width:calc(100% - 2px)}
.uis_bill thead{background:#fff;color:#000}
.uis_bill thead td,.uis_bill tfoot td{padding:8px;text-align:center;font-weight:700}
.uis_bill tbody td{vertical-align:middle;padding:5px 10px;line-height:25px}
.uis_bill tbody td span.uis_opts{line-height:14px;font-size:.85em;float:left}
.uis_bill tbody td span.uis_opts ul{padding:0}
.uis_bill tbody td span.uis_opts li{list-style-position:inside}
.uis_bill tfoot td.uis_extra{font-weight:400}
.uis_bill tfoot td.uis_extra table.uis_options_table{font-size:12px}
.uis_bill tfoot td.uis_extra table.uis_options_table td{text-align:left;padding:2px 10px;width:50%}
.uis_bill tfoot td.uis_extra table.uis_options_table td.uis_extra_name{text-align:right}
.uis_bill thead td.uis_cerr{padding:0;background-color:#fdf8c4;color:#B00}
.uis_bill .uis_coup a{font-style:italic}
.uis_bill .uis_coup_f{display:none;background:#EEE;border:2px #AAA dotted;margin:2px;padding:2px;width:240px;text-align:center}
.uis_options_error{border:1px solid #700;background-color:#FAA;font-weight:700;color:#000}
.uis_options_error_message{background-color:#e04e4e;color:#fff;padding:3px 5px;line-height:16px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}
.uis_bill_mn{margin:10px 0;padding:10px;border:2px solid #fff;clear:both}
.uis_bill_mn h2{margin:0 0 10px;text-align:center;border-bottom:1px solid #fff}
.uis_prodcart{display:none;font-style:italic;clear:both}
.uis_alert{position:relative}
.uis_alert div{display:none;position:absolute;right:0;bottom:-17px;padding:5px;line-height:10px;background-color:#ffffd9;color:#000;border:1px solid #A7A772;white-space:nowrap;z-index:5;font-size:75%}
.uis_bill .uis_alert div{top:0;left:0;right:auto;top:auto}
* html .uis_alert div,* html .uis_bill .uis_alert div{top:-5px}
.uis_addcart div.uis_alert{float:none;clear:both}
.uis_bill td.uis_ar{text-align:right}
.uis_bi,.uis_br{float:left;margin:0 5px}
.uis_br{float:right;font-size:20px;position:relative;top:2px;color:#e04e4e;padding:3px;cursor:pointer}
.uis_c_rem{float:right;visibility:hidden;color:#e04e4e}
.uis_br:hover,.uis_br:hover+.uis_c_rem{visibility:visible;color:#d62525}
.uis_pp{padding:0 2px}
.uis_pp img{margin-top:6px;height:18px;width:59px}
.uis_btn{float:left;background:url(/stylesheets/components/UI_Store/btn25_left.png) no-repeat;padding:0 0 0 6px;margin:5px;height:25px;overflow:hidden;cursor:pointer}
.uis_btn a,.uis_btn span.uis_bsa{float:left;height:25px;background:url(/stylesheets/components/UI_Store/btn25_stretch.png) repeat-x left top;line-height:25px;padding:0 4px;color:#fff;font-size:1em;text-decoration:none}
.uis_btn span.uis_bse{background:url(/stylesheets/components/UI_Store/btn25_right.png) no-repeat;float:left;width:6px;height:25px}
.uis_pf_err{border:2px solid #B00;background-color:#fdf8c4}
.uis_search{float:left;position:relative;border-left:3px solid transparent;border-top:3px solid transparent;margin-top:9px;width:40%;min-width:300px}
.uis_search&gt;div:first-child{display:table;position:relative;width:100%;overflow:hidden}
.uis_search&gt;div:first-child&gt;div{display:table-cell;vertical-align:middle;position:relative}
.uis_search.uis_search_result{border-top-color:#ededed;border-left-color:#ededed}
.uis_search .uis_btn{background:none repeat scroll 0 0 #ccc;float:none;height:30px;padding:0;width:30px}
.uis_search&gt;div&gt;div.uis_close_search{cursor:pointer;padding:0 5px;position:relative;background-color:#ededed;display:none}
.uis_search.uis_search_result&gt;div&gt;div.uis_close_search{display:table-cell}
.uis_search .uis_btn .fonticon{bottom:0;font-size:20px;left:0;position:absolute;right:0;text-align:center;padding-top:10px;top:0;cursor:pointer}
.uis_search input{border-color:#ccc transparent #ccc #ccc;border-image:none;border-style:solid none solid solid;border-width:2px 0 2px 2px;height:30px;padding:3px 30px 3px 10px;border-radius:0;width:100%}
.uis_close_search&gt;span{cursor:pointer;font-size:20px}
.close_tooltip{background-color:#405a67;border-radius:2px;left:42px;min-width:100px;opacity:0;padding:3px;pointer-events:none;position:absolute;text-align:center;top:8px;transform:translateX(10px);transition:opacity .2s ease,transform .2s ease}
.close_tooltip&gt;span{color:#fff}
.close_tooltip::after{border-bottom:5px outset rgba(0,0,0,0);border-right:5px solid #405a67;border-top:5px outset rgba(0,0,0,0);content:&quot;&quot;;left:-5px;position:absolute;top:6px}
.uis_close_search:hover .close_tooltip{opacity:1;pointer-events:auto;transform:translateX(0px)}
#uis_search_loading{background:url(/assets/loading/32x32.gif) no-repeat scroll center center/20px auto rgba(0,0,0,0);bottom:0;pointer-events:none;position:absolute;right:0;top:0;width:30px;visibility:hidden}
.uis_search_loading #uis_search_loading{visibility:visible}
.uis_search_suggest .highlight{font-weight:700}
.uis_search_suggest{border:2px solid #ccc;cursor:pointer;display:none;position:absolute;width:calc(100% - 4px);z-index:1}
.uis_search_suggest.uis_typing.uis_result_available{display:block}
.uis_search_suggest h3{background-color:#ccc;font-weight:400;padding:3px 5px;cursor:default}
.uis_search_header{display:none;background-color:#ededed;padding:5px}
.uis_suggest_product img{padding-right:5px;position:relative;top:7px;max-width:24px;max-height:24px}
.uis_suggest_category&gt;div{padding:5px}
.uis_suggest_product&gt;div{padding:0 5px 11px}
.uis_suggest_category&gt;div,.uis_suggest_word&gt;div,.uis_suggest_product&gt;div{background-color:#fff;transition:background-color .15s ease,color .15s ease}
.uis_suggest_category&gt;div:hover,.uis_suggest_word&gt;div:hover,.uis_suggest_product&gt;div:hover{background-color:transparent;color:inherit}
.UI_Store ._ui18_member_signin select,.UI_Store ._ui18_member_signup input,.UI_Store ._ui18_member_signup select,.UI_Store ._ui18_member_signin input{max-width:200px;width:calc(100% - 10px)}</style></uidget>