<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Cart</name><description>Insert a cart</description><help><![CDATA[
      This block displays a cart button on your website. By clicking it, visitors are redirected to the closest Store block to see their cart content and choose a payment methods. Options allow you to display a custom icon and text, the number of items in the cart, the cart price and a content summary on mouse-over.
    ]]></help><api_version>1.0</api_version><size height='50' width='200' /><blog en='1149' /></metadata><view><content>&lt;div&gt;&lt;/div&gt;</content><properties><checkbox default='true' name='display_text' value='Display text' /><inputText class='prop_text' default='&apos;My cart&apos;' help='Button text' name='button_text' placeholder='My cart' /><checkbox default='true' name='display_icon' value='Display icon' /><icon_selector class='prop_icon' default='{id: 763, name: "local_grocery_store", service: "Google-material-icons", removable: false, tags: ""}' icon='folder' name='button_icon' value='Button icon' /><checkbox default='true' name='display_dropdown' value='Show cart content on mouse-over' /></properties><design_properties><tabs display='Block|Elements'><tab><checkbox default='true' name='display_price' value='Display price' /><checkbox default='true' name='display_amount' value='Display product number' /></tab><tab><trigger_preset class='gtbutton_prop_custom' gt_type='button' help='Select a predefined style for the cart button' icon='palette' mode='select' text='Main button style' trigger='manage_style' /><trigger_preset class='gtbutton_prop_custom' gt_type='button' help='Select a predefined style for the cart button inside the drop-down panel' icon='palette' mode='select' name='view_store_preset' text='Inner button style' /></tab></tabs></design_properties></view><script>UI_Cart={cpts:[],addCpt:function(t){this.cpts.push(t)},
remCpt:function(t){this.cpts.remove(t)},cptServer:function(){
return this.cpts[0]}};UI_List.UI_Cart={initialize:function(t){
this.cpt=t;UI_Cart.addCpt(t)
;t.setOptions([&quot;locked&quot;,&quot;fixed&quot;,&quot;footer&quot;,&quot;sticky&quot;])
;sigCtl.emit(&quot;UI_Cart.added&quot;)},onDisplay:function(t){var e=this
;e.n={node:t,cart:{}};e.n.node.css(&quot;overflow&quot;,&quot;visible&quot;)
;this.cpt.use_graphical_preset(&quot;button&quot;,[&quot;preset&quot;])
;e.initialize_ui_store();try_initialize=function(){
if(e.wait_for_store){e.wait_for_store=!1
;e.initialize_ui_store(!0)}}
;sigCtl.connect(&quot;UI_Store.saved&quot;,try_initialize)
;sigCtl.connect(&quot;Version.saved&quot;,try_initialize)
;sigCtl.connect(&quot;UI_Store.removed&quot;,function(t,i){
i.page!=e.cpt.page&amp;&amp;e.cpt.page!=v.page_bg||e.initialize_ui_store(!1,!0)
});e.n.node.hover(function(){e._setZ(!0)},function(){e._setZ()})
;e._setColors()},onShow:function(){sigCtl.emit(&quot;UI_Cart.added&quot;)
},onSelect:function(){this._showProp()},
onPropertyChanged:function(t){
(t.include(&quot;display_text&quot;)||t.include(&quot;display_icon&quot;))&amp;&amp;this._showProp()
;if(t.include(&quot;button_text&quot;)||t.include(&quot;button_icon&quot;)||t.include(&quot;display_icon&quot;)||t.include(&quot;display_text&quot;)||t.include(&quot;display_amount&quot;)||t.include(&quot;display_price&quot;)||t.include(&quot;display_dropdown&quot;)){
this._create_cart();this.createCartHeader();this.updateCart()}
(t.include(&quot;preset&quot;)||t.include(&quot;view_store_preset&quot;))&amp;&amp;this.applyPreset()
},_setZ:function(t){this.ori_z=this.cpt.Z_with_offset()
;this.cpt.node.css(&quot;z-index&quot;,t?99999:this.ori_z)},
_create_cart:function(){$.fn.is_smallerScreen()
;this.n.node.generateComponentCart({
display_text:this.cpt.data.display_text,
display_icon:this.cpt.data.display_icon,display_amount:!1,
display_price:this.cpt.data.display_price,
main_text:this.cpt.data.button_text,
main_icon:this.cpt.data.button_icon,cart_block:!0,
preset:this.cpt.getGTPreset(&quot;button&quot;,&quot;preset&quot;),
disable_dropdown:$.fn.smallerScreen||!this.cpt.data.display_dropdown
});$.fn.smallerScreen&amp;&amp;this.n.node.on(&quot;click&quot;,function(){
Page.gotoCart()})
;this.cpt.data.display_amount&amp;&amp;this.n.node.find(&quot;.button_content .icon_wrapper&quot;).append($(&apos;&lt;span class=&quot;button_bullet&quot;&gt;&lt;/span&gt;&apos;))
},_showProp:function(){if(&quot;viewer&quot;!=v.mode){
var t=$(this.cpt.propertyNode).add(this.cpt.propertyDesignNode)
;$(&quot;.prop_text&quot;,t).toggle(this.cpt.data.display_text)
;$(&quot;.prop_icon&quot;,t).toggle(this.cpt.data.display_icon)}},
onRemove:function(){sigCtl.emit(&quot;UI_Cart.removed&quot;)
;UI_Cart.remCpt(this.cpt)},_setColors:function(){
this.cpt.getGTPreset(&quot;button&quot;,&quot;preset&quot;)?this.n.node.css({
backgroundColor:&quot;&quot;,color:&quot;&quot;}):this.n.node.css({
backgroundColor:ThemeConfig.colors.color1,color:&quot;#fff&quot;})},
initialize_ui_store:function(t,e){var i=this
;UI_Store.findCptServer().then(function(){
UI_Store.cpt_server&amp;&amp;UI_Store.cpt_server.length?e?1==UI_Store.cpt_server[2]&amp;&amp;i.hide(t):UI_Store.getCategories(i.cpt).done(function(){
UI_Store.loadCookie();i.createCartHeader();i.applyPreset()
;sigCtl.emit(&quot;UI_Store.createCartHeader&quot;)
;sigCtl.connect(&quot;UI_Store.updateCart&quot;,function(){i.updateCart()
})}):i.hide(t)})},hide:function(t){this.n.node.desactivate()
;if(&quot;editor&quot;==v.mode){setTimeout(function(){
statusController.message(&quot;The Cart blocks will not be displayed on your website because you do not have any Store block yet.&quot;,&quot;warning&quot;)
},t?2e3:0)
;this.n.node.find(&quot;.uis_cresume .uis_pr&quot;).html(&quot;Please add one store block&quot;)
;this.n.cart.items&amp;&amp;this.n.cart.items.html(&quot;&quot;)
;this.wait_for_store=!0}else this.n.node.hide()},
createCartHeader:function(){var t=this
;if($.fn.hash_size(UI_Store.conf.methods)&gt;0){
this.n.cart.items=this.n.node.find(&quot;.uis_ttl&quot;)
;this.n.cart.price=this.n.node.find(&quot;.uis_pr&quot;)
;this.n.cart.articles=this.n.node.find(&quot;.uis_cextend&quot;)
;this.n.cart.bullet=this.n.node.find(&quot;.button_bullet&quot;)
;this.n.node.find(&quot;.uis_cresume, .uis_headf, .uis_exbtn&quot;).click(function(){
if(UI_Store.cart.num&gt;0)Page.gotoCart();else{
if(!v.selectedPageFg)return!1
;var t=v.getSelectedPage().getVisibleCpts().find(function(t){
return t.component_type&amp;&amp;&quot;UI_Store&quot;==t.component_type.class_name
});t?t.onDisplayed.done(function(){v.scroll_to_component(t)
}):Page.findCartPage().then(function(t){
t&amp;&amp;t.pageid&amp;&amp;v.selectPageFromUrl(t.pageid)})}})
;sigCtl.connect(&quot;UI_Store.updateCart&quot;,function(){t.updateCart()
});UI_Store.updateCartHtml()
}else&quot;viewer&quot;==v.mode&amp;&amp;this.n.node.find(&quot;.uis_pr&quot;).html(&quot;&quot;).hide()
},updateCart:function(){this.n.node.activate()
;var t=UI_Store.cart.num;if(this.n.cart.articles){
var e=this.n.cart.articles.find(&quot;.uis_exbtn .uis_btn .uis_bsa&quot;)
;if(t&gt;0){
this.n.cart.articles.find(&quot;.uis_ul_w&quot;).html(UI_Store.cartHtmlProd.clone(!0)).find(&quot;li&quot;).each(function(){
var t=$(this).data(&quot;p&quot;);$(this).on(&quot;click&quot;,function(){
v.selectProduct(t.pageid,t.id);return!1})});e.html(&quot;View cart&quot;)
}else{
this.n.cart.articles.find(&quot;.uis_ul_w&quot;).html(&quot;&quot;).append($(&quot;&lt;div class=&apos;uis_cart_no_products&apos;&gt;Your cart is empty...&lt;/div&gt;&quot;))
;this.n.cart.articles.find(&quot;.uis_shipping_infos_cart_summary&quot;).html(&quot;&quot;)
;e.html(&quot;Go to store&quot;)}}if(this.n.cart.items){
this.n.cart.items.text(sprintf(1==t?&quot; %1$s item&quot;:&quot; %1$s items&quot;,t))
;this.n.cart.price.html(&quot;&quot;+UI_Store.show_price(UI_Store.cart.price))
}this.n.cart.bullet&amp;&amp;this.n.cart.bullet.text(t)},
applyPreset:function(){this._setColors();this._showProp()
;if(GraphicalType.available){
var t=this.cpt.getGTPreset(&quot;button&quot;,&quot;preset&quot;),e=GraphicalType.graphical_types.button.preset_data.prefix
;this.cpt.node.removeClassMatch(new RegExp(e))
;t&amp;&amp;this.cpt.node.addClass(&quot;gtbutton_preset &quot;+e+&quot;_&quot;+t)
;this._create_cart();this.createCartHeader()
;if(this.n.cart.articles){
t=this.cpt.getGTPreset(&quot;button&quot;,&quot;view_store_preset&quot;)
;var i=this.n.cart.articles.find(&quot;.uis_exbtn&quot;)
;i.removeClassMatch(new RegExp(e))
;t&amp;&amp;i.addClass(&quot;gtbutton_preset &quot;+e+&quot;_&quot;+t)}}else{
this._create_cart();this.createCartHeader()}}};</script><style>.UI_Cart .uis_headf&gt;.fonticon .custom_icon{font-size:inherit}
.UI_Cart .icon_wrapper{position:relative}
.UI_Cart .fonticon{cursor:pointer}
.detected_device_mobile .UI_Cart .uis_cextend{right:inherit;width:100%;min-width:inherit}</style></uidget>