Modificare il file:
\res\card-ecommerce.js
/*minified*/ async function ecommerceAllInOne(t,e){let a="./../Templates/";e&&(a=e);var i=await fetch(a+"card-style.hbs"),o=await fetch(a+"image-style.hbs"),l=await fetch(a+"title-style.hbs"),r=await fetch(a+"contents-style.hbs"),n=await fetch(a+"cockades-style.hbs"),i=await i.text(),o=await o.text(),l=await l.text(),r=await r.text(),n=await n.text(),c=await fetch(a+"card.hbs"),s=await fetch(a+"image.hbs"),d=await fetch(a+"title.hbs"),u=await fetch(a+"contents.hbs"),g=await fetch(a+"cockades.hbs"),c=await c.text(),s=await s.text(),d=await d.text(),u=await u.text(),g=await g.text();Handlebars.registerPartial("cardEcommerceImageStylePartial",o),Handlebars.registerPartial("cardEcommerceTitleStylePartial",l),Handlebars.registerPartial("cardEcommerceContentsStylePartial",r),Handlebars.registerPartial("cardEcommerceCockadesStylePartial",n),Handlebars.registerPartial("cardEcommerceImagePartial",s),Handlebars.registerPartial("cardEcommerceTitlePartial",d),Handlebars.registerPartial("cardEcommerceContentsPartial",u),Handlebars.registerPartial("cardEcommerceCockadesPartial",g);let y=i,m=c,h=!1;(h=t.products?!0:h)&&(o=await(await fetch(a+"cardlayout-style.hbs")).text(),l=await(await fetch(a+"cardlayout.hbs")).text(),Handlebars.registerPartial("cardEcommerceCardStylePartial",i),Handlebars.registerPartial("cardEcommerceCardPartial",c),y=o,m=l);r=Handlebars.compile(y)(t),n=Handlebars.compile(m)(t),s=document.getElementsByTagName("style");return!s||s.length<=0?((d=document.createElement("style")).innerHTML=r,document.head.appendChild(d)):(u=s[0]).innerHTML=r+u.innerHTML,n}function floatColorComponentAlpha(t){t.backgroundColor.a/=255,t.border.colors.top.a/=255,t.border.colors.bottom.a/=255,t.border.colors.left.a/=255,t.border.colors.right.a/=255,t.shadow.color.a/=255,t.txtBlock.name.style.backgroundColor.a/=255,t.txtBlock.name.style.textColor.a/=255,t.txtBlock.description.style.backgroundColor.a/=255,t.txtBlock.description.style.textColor.a/=255,t.txtBlock.details.style.backgroundColor.a/=255,t.txtBlock.details.style.textColor.a/=255,t.txtBlock.button.style.backgroundColor.a/=255,t.txtBlock.button.style.textColor.a/=255,t.txtBlock.button.border.colors.top.a/=255,t.txtBlock.button.border.colors.bottom.a/=255,t.txtBlock.button.border.colors.left.a/=255,t.txtBlock.button.border.colors.right.a/=255,t.wishlist.color.a/=255}function fontStyleWeightComponents(t){t.txtBlock.name.style.font.weight||(t.txtBlock.name.style.font.weight="normal"),t.txtBlock.description.style.font.weight||(t.txtBlock.description.style.font.weight="normal"),t.txtBlock.details.style.font.weight||(t.txtBlock.details.style.font.weight="normal"),t.txtBlock.details.priceStyle.font.weight||(t.txtBlock.details.priceStyle.font.weight="normal"),t.txtBlock.button.style.font.weight||(t.txtBlock.button.style.font.weight="normal"),"regular"==t.txtBlock.name.style.font.style&&(t.txtBlock.name.style.font.style="normal"),"regular"==t.txtBlock.description.style.font.style&&(t.txtBlock.description.style.font.style="normal"),"regular"==t.txtBlock.details.style.font.style&&(t.txtBlock.details.style.font.style="normal"),"regular"==t.txtBlock.details.priceStyle.font.style&&(t.txtBlock.details.priceStyle.font.style="normal"),"regular"==t.txtBlock.button.style.font.style&&(t.txtBlock.button.style.font.style="normal"),"bold"==t.txtBlock.name.style.font.style&&(t.txtBlock.name.style.font.weight="bold",t.txtBlock.name.style.font.style="normal"),"bold"==t.txtBlock.description.style.font.style&&(t.txtBlock.description.style.font.weight="bold",t.txtBlock.description.style.font.style="normal"),"bold"==t.txtBlock.details.style.font.style&&(t.txtBlock.details.style.font.weight="bold",t.txtBlock.details.style.font.style="normal"),"bold"==t.txtBlock.details.priceStyle.font.style&&(t.txtBlock.details.priceStyle.font.weight="bold",t.txtBlock.details.priceStyle.font.style="normal"),"bold"==t.txtBlock.button.style.font.style&&(t.txtBlock.button.style.font.weight="bold",t.txtBlock.button.style.font.style="normal"),"bold, italic"==t.txtBlock.name.style.font.style&&(t.txtBlock.name.style.font.weight="bold",t.txtBlock.name.style.font.style="italic"),"bold, italic"==t.txtBlock.description.style.font.style&&(t.txtBlock.description.style.font.weight="bold",t.txtBlock.description.style.font.style="italic"),"bold, italic"==t.txtBlock.details.style.font.style&&(t.txtBlock.details.style.font.weight="bold",t.txtBlock.details.style.font.style="italic"),"bold, italic"==t.txtBlock.details.priceStyle.font.style&&(t.txtBlock.details.priceStyle.font.weight="bold",t.txtBlock.details.priceStyle.font.style="italic"),"bold, italic"==t.txtBlock.button.style.font.style&&(t.txtBlock.button.style.font.weight="bold",t.txtBlock.button.style.font.style="italic")}function getCalculatedGlobalData(t,e){var a={},a=(t.image.mouseovereffect&&("grow"==t.image.mouseovereffect?a.imageOverRule="transform: scale(1.1); ":"shrink"==t.image.mouseovereffect?a.imageOverRule="transform: scale(0.9); ":"rotate"==t.image.mouseovereffect&&(a.imageOverRule="transform: rotate(4deg); ")),a.descFadeHeightPx=(""+Math.round(1.33*t.txtBlock.description.style.font.size*1.5)).replace(",","."),a.productOptionsSelectHeight=Math.ceil(2.67*t.txtBlock.details.style.font.size),a.productQtyShow=t.txtBlock.button.show&&t.txtBlock.details.showQuantity,a.isAddToCartButtonTypeImage=t.txtBlock.button.useImage,a.isAddToCartButtonTypeText=!a.isAddToCartButtonTypeImage,a.cockadeNewCss=cssPositioning(t.cockades.new.align),a.cockadeDiscountCss=cssPositioning(t.cockades.discount.align),a.cardContentLayout="horizontal-cover-left","leftcoverrightcontents"==t.type?a.cardContentLayout="horizontal-cover-left":"leftcontentsrightcover"==t.type?a.cardContentLayout="horizontal-cover-right":"topcoverbottomcontents"==t.type?a.cardContentLayout="vertical-cover-top":"topcontentsbottomcover"==t.type&&(a.cardContentLayout="vertical-title-top"),!e.cardContentLayout||"horizontal-cover-left"!=e.cardContentLayout&&"horizontal-cover-right"!=e.cardContentLayout&&"vertical-cover-top"!=e.cardContentLayout&&"vertical-title-top"!=e.cardContentLayout&&"cover-as-background"!=e.cardContentLayout||(a.cardContentLayout=e.cardContentLayout),a.cardFixedHeight=!1,!e.cardLayoutCardArrangement||"same-height"!=e.cardLayoutCardArrangement&&"slideshow"!=e.cardLayoutCardArrangement||(a.cardFixedHeight=!0),a.isArrangeSameHeight=e.cardLayoutCardArrangement&&"same-height"==e.cardLayoutCardArrangement,a.isArrangeChangingHeight=e.cardLayoutCardArrangement&&"changing-height"==e.cardLayoutCardArrangement,a.isArrangeSlideshow=e.cardLayoutCardArrangement&&"slideshow"==e.cardLayoutCardArrangement,a.isArrangeMasonry=e.cardLayoutCardArrangement&&"masonry"==e.cardLayoutCardArrangement,a.isArrangeSameHeightOrChangingHeight=a.isArrangeSameHeight||a.isArrangeChangingHeight,a.isArrangeChangingHeightOrMasonry=a.isArrangeChangingHeight||a.isArrangeMasonry,a.isLayoutHorizontalCoverLeft="horizontal-cover-left"==a.cardContentLayout,a.isLayoutHorizontalCoverRight="horizontal-cover-right"==a.cardContentLayout,e.layoutVertMediaQuery&&(a.isLayoutHorizontalCoverLeft||a.isLayoutHorizontalCoverRight)&&(a.layoutHorizontalMediaQueryStart="@media not ("+e.layoutVertMediaQuery+") {"),a.isLayoutVerticalCoverTop="vertical-cover-top"==a.cardContentLayout||a.isLayoutHorizontalCoverLeft||a.isLayoutHorizontalCoverRight,a.isLayoutVerticalTitleTop="vertical-title-top"==a.cardContentLayout,"vertical-cover-top"!=a.cardContentLayout&&(a.layoutVerticalMediaQueryStart="@media "+(e.layoutVertMediaQuery||"(max-width: 1px)")+" {"),a.isLayoutCoverAsBackground="cover-as-background"==a.cardContentLayout,a.isLayoutVertical=a.isLayoutVerticalCoverTop||a.isLayoutVerticalTitleTop,a.isLayoutHorizontal=a.isLayoutHorizontalCoverLeft||a.isLayoutHorizontalCoverRight,a.verticalImageHeight=t.height*t.image.percentSize/100,!e.cardLayoutCardArrangement||"same-height"!=e.cardLayoutCardArrangement&&"slideshow"!=e.cardLayoutCardArrangement||"vertical-cover-top"!=a.cardContentLayout&&"vertical-title-top"!=a.cardContentLayout||(a.verticalImageHeight=t.height-t.txtBlock.height-t.txtBlock.margins.top-t.txtBlock.margins.bottom,a.verticalImageHeight<0&&(a.verticalImageHeight=0)),a.verticalTitleHeight=.2*t.height*(100-t.image.percentSize)/100,t.txtBlock.name.show&&!t.txtBlock.details.showCategory?a.verticalTitleHeight=.16*t.height*(100-t.image.percentSize)/100:!t.txtBlock.name.show&&t.txtBlock.details.showCategory?a.verticalTitleHeight=.1*t.height*(100-t.image.percentSize)/100:t.txtBlock.name.show||t.txtBlock.details.showCategory||(a.verticalTitleHeight=0),a.verticalContentsHeight=.8*t.height*(100-t.image.percentSize)/100,t.txtBlock.name.show&&!t.txtBlock.details.showCategory?a.verticalContentsHeight=.84*t.height*(100-t.image.percentSize)/100:!t.txtBlock.name.show&&t.txtBlock.details.showCategory?a.verticalContentsHeight=.9*t.height*(100-t.image.percentSize)/100:t.txtBlock.name.show||t.txtBlock.details.showCategory||(a.verticalContentsHeight=t.height*(100-t.image.percentSize)/100),{...e,...a});return a}function getCalculatedDataMulti(t,e,a,i,o,l,r){var n=[];for(prId in e){var c=e[prId];n.push(getCalculatedData(t,c,a,i,o,l,r))}return n}function getCalculatedData(t,a,e,i,o,l,r){var n,c={},s=(c.productId=a.id,c.productName=a.name,a.link&&(c.link=a.link),c.productMinQty=a.minQty,c.pathImage=r.noPreviewImage,c.isPlaceholderImage=!0,c.altImage=void 0,c.titleImage=void 0,null!=a.media&&0<a.media.length&&null!=a.media[0]&&(c.pathImage="video"===a.media[0].type?"res/video_thumb.svg":a.media[0].url,c.isPlaceholderImage="video"===a.media[0].type,"image"===a.media[0].type)&&(a.media[0].alt&&(c.altImage=a.media[0].alt),a.media[0].title)&&(c.titleImage=a.media[0].title),getSearchPageCardLinks(a,l));if(x5engine.responsive.isAnyMobileDevice()&&l.image.isLink&&a.showboxLink&&a.link||(c.linkJsImage=x5engine.utils.linkJs(s.image,{baseUrl:"../"})),c.linkHtmlTitle=x5engine.utils.linkHtml(s.title,{content:a.name,baseUrl:"../"}).trim(),c.linkJsProduct=x5engine.utils.linkJs(s.title,{baseUrl:"../"}),c.linkOnlyShowbox=void 0,l.image.isLink&&a.showboxLink&&(c.linkOnlyShowbox=x5engine.utils.linkJs(a.showboxLink,{baseUrl:"../"})),c.linkOnlyDetails=void 0,a.link&&(c.linkOnlyDetails=x5engine.utils.linkJs(a.link,{baseUrl:"../"})),c.categoryName=getProductCategoryName(a.category,o),c.desc=a.description.replace("\n","<br />").replace("\r","").replace("\\","\\\\").replace("'","'"),c.productAvailabilityShow=l.txtBlock.details.showAvailability&&"unset"!=a.availabilityType,c.isAvailabilityTypeFixed="fixed"==a.availabilityType,c.isStaticAvailValueSet=!x5engine.utils.isNullOrEmpty(r.availabilityImage)&&"unknown"!=a.staticAvailValue,c.isDynamicAvailValueSet=!1,e&&e[a.id]&&(c.isDynamicAvailValueSet=null!=e[a.id]),c.availabilityImage=void 0,c.availabilityLabel=void 0,c.isAvailabilityTypeFixed?c.isStaticAvailValueSet&&(c.availabilityImage=getAvailabilityImage(a.staticAvailValue,r),c.availabilityLabel=getAvailabilityLabel(a.staticAvailValue,t)):r.uploadVersion?c.isDynamicAvailValueSet&&(c.availabilityImage=getAvailabilityImage(e[a.id].availability,r),c.availabilityLabel=getDynamicAvailabilityLabel(e[a.id].availability,e[a.id].quantity,t)):(c.availabilityImage=getAvailabilityImage(a.staticAvailValue,r),c.availabilityLabel=getDynamicAvailabilityLabel(a.staticAvailValue,a.offlineAvailableItems,t)),c.productOptionsShow=l.txtBlock.details.showOptions&&null!=a.options,c.productNoSuboptions=!0,c.options=[],a.options)for(option in a.options){a.options[option].suboptions&&0<a.options[option].suboptions.length&&(c.productNoSuboptions=!1);let t=void 0,e=void 0;if(a.options[option].suboptions){t=a.options[option].suboptions,e=[];for(var d=0;d<t.length;d++)e.push(x5engine.utils.replaceAll(t[d],"'","\\'"))}c.options.push({id:option,name:a.options[option].name,nameJSEscaped:x5engine.utils.replaceAll(a.options[option].name,"'","\\'"),weightvar:a.options[option].weightvar,pricevar:a.options[option].pricevar,suboptions:t,suboptionsJSEscaped:e})}for(n in c.hasQuantityDiscounts=a.quantityDiscounts&&l.txtBlock.details.showQuantity,c.quantityDiscountTextCartDiscountPerQty=[],a.quantityDiscounts){var u=n,g=(100*a.quantityDiscounts[n]).toFixed(2),g=g%1==0?parseInt(g):g,u=t.cart_discount_per_qty.replace("[QUANTITY]",u).replace("[DISCOUNT]",g);c.quantityDiscountTextCartDiscountPerQty.push(u)}s=l.txtBlock.details.showVat&&"none"!=x5CartData.settings.vattype;let y="included"===r.vattype;return a.vattype&&(y="included"===a.vattype),c.isVatIncluded=y,c.vat=r.vat,a.vat&&(c.vat=a.vat),c.vatName=r.vatName,a.vatName&&(c.vatName=a.vatName),c.productVatInfoText="",s&&(y?c.productVatInfoText=t.cart_showvat_included:c.productVatInfoText=t.cart_showvat_excluded,c.productVatInfoText=c.productVatInfoText.replace("[FIELD]",c.vat).replace("[NAME]",c.vatName)),c.productSingleFullPriceCurrency=getProductSinglePriceCurrency(a,y,!1),c.productSinglePriceIsFullPrice=getProductSinglePriceIsFullPrice(a,y),c.productSinglePriceCurrency=productSinglePriceCurrency(a,y),c.productDiscountedRegardlessOfCouponAndQuantity=a.discount&&a.discount.type&&("absolute"==a.discount.type||"relative"==a.discount.type),c.productNotDiscountedRegardlessOfCouponAndQuantity=!c.productDiscountedRegardlessOfCouponAndQuantity||getProductSinglePriceIsFullPrice(a,y),c.productSingleLowestPriceCurrency=0<=a.lowestPrice?getProductSinglePriceCurrency(a,y,!0):"",c.productLowestPriceText=t.cart_lowest_price,c.cartMinQtyText=t.cart_min_qty.replace(/\[MINQUANTITY\]/g,a.minQty||1),c.isWishlisted=!1,i&&(c.isWishlisted=i.includes(a.id)),c.cockadeNewShow=a.isNew&&l.cockades.new&&!!l.cockades.new.image,c.cockadeDiscountShow=(a.discount||a.quantityDiscounts)&&l.cockades.discount&&!!l.cockades.discount.image,c}function getSearchPageCardLinks(t,e){var a=e.image.isLink&&t.showboxLink;return{image:a||t.link,title:t.link||a}}function getProductCategoryName(e,a){if(null!=a)for(let t=0;t<a.length;t++)if("category"==a[t].type){if(a[t].id==e)return a[t].text;if(null!=a[t].items&&0<a[t].items.length){var i=getProductCategoryName(e,a[t].items);if(i)return i}}return""}function getAvailabilityLabel(t,e){switch(t){case"available":return e.cart_fixedproduct_available;case"lacking":return e.cart_fixedproduct_lack;case"notavailable":return e.cart_fixedproduct_unavailable}return""}function getDynamicAvailabilityLabel(t,e,a){switch(t){case"available":return a.cart_dynamicproduct_available.replace("[QUANTITY]",e);case"lacking":return a.cart_dynamicproduct_lack.replace("[QUANTITY]",e);case"notavailable":return a.cart_dynamicproduct_unavailable.replace("[QUANTITY]",e)}return""}function getAvailabilityImage(t,e){var a="",i=e.currentPath+e.availabilityImage;if(null!=e.availabilityImage)switch(t){case"available":a+="\t\t\t\t<span style=\"vertical-align: middle; display: inline-block; width: 22px; height: 22px; background-image: url('"+i+"'); background-position: 0 0;\"></span>\n";break;case"lacking":a+="\t\t\t\t<span style=\"vertical-align: middle; display: inline-block; width: 22px; height: 22px; background-image: url('"+i+"'); background-position: -22px 0;\"></span>\n";break;case"notavailable":a+="\t\t\t\t<span style=\"vertical-align: middle; display: inline-block; width: 22px; height: 22px; background-image: url('"+i+"'); background-position: -44px 0;\"></span>\n"}return a}function getProductSinglePriceCurrency(t,e,a){var i=x5engine.cart.htmlProducts.getProdClass(t).singleFullPrice(void 0,e,a);return x5engine.cart.manager.formatCurrency(i)}function productSinglePriceCurrency(t,e){var a=x5engine.cart.htmlProducts.getProdClass(t).singlePrice(void 0,e);return x5engine.cart.manager.formatCurrency(a)}function getProductSinglePriceIsFullPrice(t,e){var a=x5engine.cart.htmlProducts.getProdClass(t),i=a.singleFullPrice(void 0,e);return a.singlePrice(void 0,e)==i}function cssPositioning(t){switch(t){case"topleft":return"top: 0; left: 0;";case"topright":return"top: 0; right: 0;";case"bottomright":return"bottom: 0; right: 0;";case"bottomleft":return"bottom: 0; left: 0;"}return""}
[
Íàçàä
]