Derivación de 40mm x 25mm en te para moldura blanco schneider electric (2024)

"; source = ((CCRZ.getCookie("handlebars") != "") ? preSource : "") + data; } }); } } else { preSource = "

" + id + "

"; source = ((CCRZ.getCookie("handlebars") != "") ? preSource : "") + source; } return Handlebars.compile(source); } }); /* //////////////////////////////////////////////////////// //////////////// GLOBAL AUXILIAR FUNCTIONS //////////////// */ ///////////////////////////////////////////////////////// // CLONE ANY OBJECT function cloneObject(objectToClone) { return JSON.parse(JSON.stringify(objectToClone)); } //Asigna a un un texto de error //Parametros: //elem: $("#elemento") o $(".clase") etc //message: "mensaje de error" function setMessageErrorInElement(elem, message) { elem.html(message).css("color", "#ff0000"); } //Limpia el de error //Parametros: //elem: $("#elemento") o $(".clase") etc //millisecond: 3000 o la cantidad de milisegundos que desee function hideMessageErrorInElement(elem, millisecond) { setTimeout(() => { elem.html(''); }, millisecond); } //Deshabilita los input de un form //Parametros: //elem: $("#elemento") o $(".clase") etc //excludeInput: string de input que desea excluir separados por coma(,). Ejm: "#txtInput1,.txtClassBtn,#txtArea" function disabledForm(elem, excludeInput) { if (excludeInput != undefined) { elem.not(excludeInput).prop('disabled', true); } else { elem.prop('disabled', true); } } //Habilita los input de un form //Parametros: //elem: $("#elemento") o $(".clase") etc function enabledForm(elem) { elem.prop('disabled', false); } //Valida si es visita o no function IsGuest() { if (CCRZ.currentUser.UserType == 'Guest') { return true; } else { return false; } } //Retorna el nombre del día de la semana function getDayName(dayNumber) { let weekday = new Array(7); weekday[0] = "Global_DayName1"; weekday[1] = "Global_DayName2"; weekday[2] = "Global_DayName3"; weekday[3] = "Global_DayName4"; weekday[4] = "Global_DayName5"; weekday[5] = "Global_DayName6"; weekday[6] = "Global_DayName7"; return weekday[dayNumber]; } //Habilita los popovers de un form //Parametros: //elem: $("#elemento") o $(".clase") etc function showMessageTypePopover(elem, title, content, timeClose) { if(CCRZ.getPageConfig('pd.enablepopuppl')){ if($(elem).data('isavailableurl')){ elem.attr('data-html', true); let brandTitle=CCRZ.productDetailModel.attributes.product.prodBean.brandName; let labelBrand=CCRZ.pagevars.pageLabels.seeMoreProductsByBrand?CCRZ.pagevars.pageLabels.seeMoreProductsByBrand:''; let writter=''; let store=CCRZ.pagevars.storefrontName; writter+='

'+content+'

'; writter+=''+' '+labelBrand+' '+ brandTitle+''; content=writter; title='

'+title+'

'; } let timeToSet=(CCRZ.getPageConfig('pd.settimepopup')?CCRZ.getPageConfig('pd.settimepopup'):30000); timeClose=parseInt(timeToSet); } elem.attr('title', title); elem.attr('data-content', content); elem.attr('data-trigger', 'focus'); elem.attr('data-toggle', 'popover'); elem.attr('data-container', 'body'); elem.attr('data-placement', 'top'); elem.popover("show"); setTimeout(() => { elem.popover("hide"); elem.popover("destroy"); }, timeClose); } function getJsonToAddCart(idProd, qty, typeProduct) { let data = []; // ----- FIX FOR COMPARE PRODUCTS let viewState = $("#viewState").val() == undefined? "ListView":$("#viewState").val() if (viewState == "ListView") { data.push({ prodId: idProd, qty: qty }); } else if (viewState == "DetailView") { if (typeProduct == "Dynamic Kit") { let prods = CCRZ.dynamicKitView.selView.dataSet.selList.toJSON(); for (p of prods) { data.push({ prodId: p.id, qty: p.quantity }); } } else { data.push({ prodId: idProd, qty: qty }); } } return data; } function percentagesOfDiscount(price, basePrice){ let percent = 100, result = 0; result = ((percent - (percent * price) / basePrice)).toFixed(); return result + '%'; } //-------------------------------------------------------------------------------- // ------------------ FORMATO DE NUMERO SEPARADO POR COMAS ----------------------- //-------------------------------------------------------------------------------- var formatNumber = { separador: ",", // separador para los miles sepDecimal: '.', // separador para los decimales formatear:function (num){ num +=''; var splitStr = num.split('.'); var splitLeft = splitStr[0]; var splitRight = splitStr.length > 1 ? this.sepDecimal + splitStr[1] : ''; var regx = /(\d+)(\d{3})/; while (regx.test(splitLeft)) { splitLeft = splitLeft.replace(regx, '$1' + this.separador + '$2'); } return this.simbol + splitLeft + splitRight; }, new:function(num, simbol){ this.simbol = simbol ||''; return this.formatear(num); } } function cartItemsHasSelectSubscrip(){ if(CCRZ.cartCheckoutModel.attributes.cartItems){ let found = CCRZ.cartCheckoutModel.attributes.cartItems.find(x => x.hasOwnProperty("subProdterm")); if(found){ return true; }else{ return false; } }else{ return false; } } function getPrefixStore() { return CCRZ.pagevars.storefrontName.toLowerCase().indexOf("cochez") > 0 ? 'C' : 'N'; } function getPrefixStore2() { return CCRZ.pagevars.storefrontName.toLowerCase().indexOf("cochez") > 0 ? 'CO' : 'NO'; } function getPrefixStore3(){ return CCRZ.pagevars.storefrontName.toLowerCase().indexOf("cochez") > 0 ? 'Chz' : 'Nvy'; } function getCodeCompany() { return CCRZ.pagevars.storefrontName.toLowerCase().indexOf("cochez") > 0 ? '01' : '03'; } function getNameCompany(){ return CCRZ.pagevars.storefrontName.toLowerCase().indexOf("cochez") > 0 ? 'Cochez' : 'Novey'; } function getGeneralNameCategories() { return['Root: CochezB2C', 'Root: NoveyB2C', 'Root: NoveyB2C2','Root: CochezB2B']; } //-------------------------------------------------------------------------------- //-- REMOVE TEXT Provincia de FROM GOOGLE MAPS API RESULT //-------------------------------------------------------------------------------- function removeUnnecessaryText(text) { text = text.replace("Provincia de ", "").replace("Province", "").replace("Distrito de ", "").replace("District", ""); return text } //-------------------------------------------------------------------------------- //Funcion vieja updateMiniCartFields/* function updateMiniCartFields(){ // subtotal, tax, shipping let subtotal; if(CCRZ.pagevars.storefrontName.includes('B2B')){ subtotal = (CCRZ.LLIPaymentModel.attributes.cartData.subtotalAmount != undefined)? parseFloat(CCRZ.LLIPaymentModel.attributes.cartData.subtotalAmount) : 0, tax = (CCRZ.LLIPaymentModel.attributes.cartData.taxAmount != undefined)? parseFloat(CCRZ.LLIPaymentModel.attributes.cartData.taxAmount) : 0, shipping = (CCRZ.LLIPaymentModel.attributes.cartData.shipAmount != undefined)? parseFloat(CCRZ.LLIPaymentModel.attributes.cartData.shipAmount) : 0. itbmsString = parseFloat(tax).toFixed(2), itbms = parseFloat(itbmsString) }else{ subtotal = (CCRZ.cartCheckoutView.model.attributes.subtotalAmount != undefined)? parseFloat(CCRZ.cartCheckoutView.model.attributes.subtotalAmount) : 0, tax = (CCRZ.cartCheckoutView.model.attributes.tax != undefined)? parseFloat(CCRZ.cartCheckoutView.model.attributes.tax) : 0, shipping= (CCRZ.cartCheckoutView.model.attributes.shippingCharge != undefined)? parseFloat(CCRZ.cartCheckoutView.model.attributes.shippingCharge) : 0. itbmsString = parseFloat(tax).toFixed(2), itbms = parseFloat(itbmsString) } // totalAmount = (subtotal + itbms + shippingCharge).toFixed(2) console.log('subtotal',subtotal, 'tac',tax, 'shipping',shipping ) subtotal = parseFloat(subtotal) tax = parseFloat(tax) shipping = parseFloat(shipping) itbmsString=parseFloat(tax).toFixed(2); itbms=parseFloat(itbmsString); suma=subtotal + itbms + shipping; var total=suma.toFixed(2); // console.log("totsum",sumaTot); // total = parseFloat((subtotal + tax + shipping)).toFixed(2) // console.log('total',total); $("#writerTax").empty(); $("#writertotalAmount").empty(); $("#writerShip").empty(); $("#writerTax").append(formatNumber.new(itbms, "$")); $("#writertotalAmount").append(formatNumber.new( total, "$") ); $("#writerShip").append(formatNumber.new( shipping, "$") ); //writeExtData(); $(".plusInfo").attr("style","display:block"); $(".plusInfoTot").attr("style","display:block"); $(".plusInfoEnv").attr("style","display:block"); } */ //funcion nueva updateMiniCartFields function updateMiniCartFields() { let subtotal, tax, shipping, itbms; if (CCRZ.pagevars.storefrontName.includes('B2B')) { subtotal = (CCRZ.LLIPaymentModel.attributes.cartData.subtotalAmount != undefined) ? parseFloat(CCRZ.LLIPaymentModel.attributes.cartData.subtotalAmount) : 0; tax = (CCRZ.LLIPaymentModel.attributes.cartData.taxAmount != undefined) ? parseFloat(CCRZ.LLIPaymentModel.attributes.cartData.taxAmount) : 0; shipping = (CCRZ.LLIPaymentModel.attributes.cartData.shipAmount != undefined) ? parseFloat(CCRZ.LLIPaymentModel.attributes.cartData.shipAmount) : 0; itbms = parseFloat(tax).toFixed(2); } else { subtotal = (CCRZ.cartCheckoutView.model.attributes.subtotalAmount != undefined) ? parseFloat(CCRZ.cartCheckoutView.model.attributes.subtotalAmount) : 0; tax = (CCRZ.cartCheckoutView.model.attributes.tax != undefined) ? parseFloat(CCRZ.cartCheckoutView.model.attributes.tax) : 0; shipping = (CCRZ.cartCheckoutView.model.attributes.shippingCharge != undefined) ? parseFloat(CCRZ.cartCheckoutView.model.attributes.shippingCharge) : 0; if (CCRZ.pagevars.pageConfig['co.itbmsrecalcco'] == 'TRUE') { if(CCRZ.cartCheckoutModel.attributes.buyerPhone != 'Certificado') { if (CCRZ.cartCheckoutModel.attributes.accountR.taxExemptAccount === false) { //if (tax == 0) { tax = (subtotal + shipping) * 0.07; tax = tax.toFixed(2); CCRZ.cartCheckoutView.model.attributes.tax = tax; // } } } } itbms = parseFloat(tax).toFixed(2); } subtotal = parseFloat(subtotal); tax = parseFloat(tax); shipping = parseFloat(shipping); suma = subtotal + tax + shipping; var total = suma.toFixed(2); if (CCRZ.pagevars.pageConfig['co.itbmsrecalccoapex'] == 'TRUE'){ if(CCRZ.pagevars.storefrontName != 'B2BCochez') { var remoteCall = _.extend(CCRZ.RemoteInvocation, { className: 'AddToCartRemoteValidator' }); remoteCall.invokeContainerLoadingCtx($('.deskLayout'), 'resavetotal',CCRZ.cartView.cartmodel.attributes.encryptedId, subtotal,tax,total, function (res, err) { console.log("JMC =====>"+JSON.stringify(res)); if(res != null){ if(res.success){ console.log("JMC =====> recalculo actualizado"); CCRZ.cartCheckoutModel.attributes.totalAmount = total; CCRZ.cartCheckoutView.model.attributes.totalAmount = total; buildDataB2c(); }else{ console.log("JMC =====> error al actualizar recalculo"); } } }, { nmsp: false, escape: false, timeout: 10000, buffer: false }); } } $("#writerTax").empty(); $("#writertotalAmount").empty(); $("#writerShip").empty(); $("#writerTax").append(formatNumber.new(itbms, "$")); $("#writertotalAmount").append(formatNumber.new(total, "$")); $("#writerShip").append(formatNumber.new(shipping, "$")); $(".plusInfo").attr("style", "display:block"); $(".plusInfoTot").attr("style", "display:block"); $(".plusInfoEnv").attr("style", "display:block"); } //termina funcion nueva updateMiniCartFields function writeExtData(){ $("#writerExtDataComprador").empty(); var writer=""; console.log('check type',CCRZ.CheckoutPayload.DeliveryType); if(CCRZ.CheckoutPayload.DeliveryType=='DOM'){ writer+="

"; if(CCRZ.pagevars.storefrontName=='B2CNovey'){ writer+="

Información de envío

"; } else if(CCRZ.pagevars.storefrontName=='B2CCochez'){ writer+="

Información de envío

"; } writer+="

"+CCRZ.processPageLabelMap('AddressInMap_Country') +': '+CCRZ.CheckoutPayload.Country+"

"; writer+="

"+CCRZ.processPageLabelMap('Checkout_ship_description') +': '+CCRZ.CheckoutPayload.addressDescription+"

"; // writer+="

"+CCRZ.processPageLabelMap('Checkout_ChooseDeliveryDate') +': '+CCRZ.CheckoutPayload.liMainDelivery+"

"; writer+="

"+CCRZ.processPageLabelMap('Checkout_ChooseDeliveryDate') +': '+CCRZ.CheckoutPayload.DeliveryDate+"

"; writer+="

"; }else if(CCRZ.CheckoutPayload.DeliveryType=='SUC'){ writer+="

"; if(CCRZ.pagevars.storefrontName=='B2CNovey'){ writer+="

Información de retiro

"; } else if(CCRZ.pagevars.storefrontName=='B2CCochez'){ writer+="

Información de retiro

"; } writer+="

"+CCRZ.processPageLabelMap('Checkout_suc_description') +': '+CCRZ.CheckoutPayload.DeliveryTypeDesc+"

"; writer+="

"+CCRZ.processPageLabelMap('Checkout_suc_select') +': '+CCRZ.CheckoutPayload.Store+"

"; writer+="

"; } $("#writerExtDataComprador").append(writer); } function writerData( name,ape,email){ $("#writerDataComprador").empty(); // var ape=CCRZ.cartCheckoutView.model.attributes.buyerLastName; // var email=CCRZ.cartCheckoutView.model.attributes.buyerEmail; var writer=""; writer+="

"; if(CCRZ.pagevars.storefrontName=='B2CNovey'){ writer+="

" + CCRZ.processPageLabelMap('Component_MiniCart_BuyerInformation') + "

"; } else if(CCRZ.pagevars.storefrontName=='B2CCochez'){ writer+="

" + CCRZ.processPageLabelMap('Component_MiniCart_BuyerInformation') + "

"; } writer+="

"; writer+="

"; if(CCRZ.pagevars.storefrontName=='B2CNovey'){ writer+="

" + CCRZ.processPageLabelMap('Name') + ":

"; writer+="

"+name+" "+ape+"

"; }else if(CCRZ.pagevars.storefrontName=='B2CCochez'){ writer+="

" + CCRZ.processPageLabelMap('Name') + ": "+name+" "+ape+"

"; // writer+="

"+name+" "+ape+"

"; } writer+="

"; writer+="

"; if(CCRZ.pagevars.storefrontName=='B2CNovey'){ writer+="

" + CCRZ.processPageLabelMap('EMail') + "

"; writer+="

"+email+"

"; }else if(CCRZ.pagevars.storefrontName=='B2CCochez'){ writer+="

" + CCRZ.processPageLabelMap('EMail') + ": "+email+"

"; } writer+="

"; $("#writerDataComprador").append(writer); } function paintCustomerData(){ if(CCRZ.pagevars.isGuest){ var nameP=CCRZ.cartCheckoutView.model.attributes.buyerFirstName; var apeP=CCRZ.cartCheckoutView.model.attributes.buyerLastName; var emailP=CCRZ.cartCheckoutView.model.attributes.buyerEmail; writerData(nameP, apeP,emailP); }else{ var nameP=CCRZ.currentUser.FirstName; var apeP=CCRZ.currentUser.LastName; var emailP=CCRZ.currentUser.Email; writerData(nameP, apeP,emailP); } } function clearAmuntAndDelivaryData(){ $("#writerTax").empty(); $("#writertotalAmount").empty(); $("#writerShip").empty(); $("#writerExtDataComprador").empty(); $(".plusInfo").attr("style","display:none"); $(".plusInfoTot").attr("style","display:none"); $(".plusInfoEnv").attr("style","display:none"); } function updateInfo(){ CCRZ.LoadTaxMiniCart=null; if(CCRZ.pagevars.currentPageName == "ccrz__CheckoutNew"){ if(CCRZ.pagevars.isGuest){ CCRZ.LoadTaxMiniCart =setInterval(function() { if(!(typeof CCRZ.cartCheckoutView.model.attributes.buyerFirstName == "undefined")){ // var nameP=CCRZ.cartCheckoutView.model.attributes.buyerFirstName; // var apeP=CCRZ.cartCheckoutView.model.attributes.buyerLastName; // var emailP=CCRZ.cartCheckoutView.model.attributes.buyerEmail; // writerData(nameP, apeP,emailP); paintCustomerData() if(CCRZ.CheckoutPayload!=undefined){ writeExtData(); } updateMiniCartFields(); clearInterval(CCRZ.LoadTaxMiniCart); } }, 1000); }else{ CCRZ.LoadTaxMiniCart =setInterval(function() { console.log('pregunta') if(!(typeof CCRZ.currentUser === "undefined")){ console.log( 'curr:-',CCRZ.currentUser); // var nameP=CCRZ.currentUser.FirstName; // var apeP=CCRZ.currentUser.LastName; // var emailP=CCRZ.currentUser.Email; // writerData(nameP, apeP,emailP); paintCustomerData() if(CCRZ.CheckoutPayload!=undefined){ writeExtData(); } updateMiniCartFields(); clearInterval(CCRZ.LoadTaxMiniCart); } }, 1000); } } } function is_MC_Pixel_Active() { let isActive = false if(typeof _etmc !== "undefined" && CCRZ.getPageConfig('sfmc.mcp_enable',false)){ isActive = true } return isActive } function linkHawkSend(e){ let hawkKey = ''; //CCRZ.pagevars.storefrontName == 'B2CCochez' ? '3f3063fb0b584d43b6c91421aede6c03' : '49842e22915f43fcbcc5c5bcd8280800'; switch (CCRZ.pagevars.storefrontName) { case "B2CCochez": hawkKey = '3f3063fb0b584d43b6c91421aede6c03'; break; case "B2CNovey": hawkKey = '49842e22915f43fcbcc5c5bcd8280800'; break; case "B2BCochez": hawkKey = '3f3063fb0b584d43b6c914XXXXXXXXXX'; break; } HawkSearch.link(e,hawkKey,1, e.target.dataset.productsfid,0) ; //e.stopImmediatePropagation(); } // --------------------- PROTOTYPE ------------------------ String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() + this.slice(1); } // ---------------- REMOTE INVOKE ACTION ----------------- // Utilizar para cuando el método del controlador recive un JSON como parámetro //----- // Parámetros // remoteCallObj: el objeto con contexto del controlador que se va utilizar. // remoteActionName: nombre del metodo o action a ejecutar en el controlador // data: parametros(objeto) en formato string function callCtrlRemoteAction(remoteCallObj, remoteActionName, data) { // console.log(arguments); return new Promise(function(resolve, reject) { remoteCallObj.invokeContainerLoadingCtx($('.deskLayout'), remoteActionName, data, function(res, err) { if (res != null) { resolve(res); } else if (err.message != "") { resolve(err); } }, { nmsp: false }); }); } //---------- Format data MC PIXEL function set_MC_Pixel_PurchaseSuccess(dataPurchase) { let data = { 'cart': [], 'order_number': dataPurchase.sfdcName, // Transaction ID. Required for purchases and refunds <----- ORDER NUMBER ON SALESFORCE. 'discount': '', 'shipping': dataPurchase.shippingCharge, // Shipping value) 'details': { 'originatedCart' : dataPurchase.originatedCart, 'buyerEmail': dataPurchase.buyerEmail, 'buyerFirstName': dataPurchase.buyerFirstName, 'buyerLastName': dataPurchase.buyerLastName, 'buyerMobilePhone': dataPurchase.buyerMobilePhone, 'contactId': dataPurchase.contact, 'shippingCharge': dataPurchase.shippingCharge, 'subTotal': dataPurchase.subTotal, 'tax': dataPurchase.tax, 'taxSubTotalAmount': dataPurchase.taxSubTotalAmount, 'totalAmount': dataPurchase.totalAmount } } let productList = dataPurchase.orderItems for(product of productList){ data.cart.push({ item: product.mockProduct.name, quantity: product.quantity, price: product.price, unique_id: product.mockProduct.sku }); } if(CCRZ.getPageConfig('env.isprod',false)){ _etmc.push(["trackConversion", data]) }else{ console.log("data compra MC Pixel => ",data) } } //-------------------------------------------------------------------------------- // --------------- FUNCTION DRAG SCROLL FOR PAINT PALETTE ---------------- //-------------------------------------------------------------------------------- function setDragScroll( elemName ) { const ele = document.getElementById( elemName ); ele.style.cursor = 'grab'; let pos = { top: 0, left: 0, x: 0, y: 0 }; const mouseDownHandler = function(e) { ele.style.cursor = 'grabbing'; ele.style.userSelect = 'none'; pos = { left: ele.scrollLeft, top: ele.scrollTop, // Get the current mouse position x: e.clientX, y: e.clientY, }; document.addEventListener('mousemove', mouseMoveHandler); document.addEventListener('mouseup', mouseUpHandler); }; const mouseMoveHandler = function(e) { // How far the mouse has been moved const dx = e.clientX - pos.x; const dy = e.clientY - pos.y; // Scroll the element ele.scrollTop = pos.top - dy; ele.scrollLeft = pos.left - dx; }; const mouseUpHandler = function() { ele.style.cursor = 'grab'; ele.style.removeProperty('user-select'); document.removeEventListener('mousemove', mouseMoveHandler); document.removeEventListener('mouseup', mouseUpHandler); }; // Attach the handler ele.addEventListener('mousedown', mouseDownHandler); } function ifApplyExpressDelivery(){ if(CCRZ.getPageConfig('exdev.stl')){ let availableExpressList = CCRZ.getPageConfig('exdev.stl').split(','); let sucursalFilter; if(localStorage.getItem('locStor'+getPrefixStore3())){ sucursalFilter = getCodeCompany()+(JSON.parse(localStorage.getItem('locStor'+getPrefixStore3())).codigo); if( availableExpressList.find(x=>((x.trim())==sucursalFilter)) ){ // validamos si el horario de la sucursal está habilitado para el horario de Delivery Express /*( ifApplyExpressDeliveryByTime() == true ) ? $('.expressDeliveryStyle').show() : $('.expressDeliveryStyle').hide();*/ const productId = (CCRZ.pagevars.currentPageName == 'ccrz__ProductDetails') ? CCRZ.productDetailModel.attributes.product.prodBean.id : ''; getStatusExpressDeliveryByStore(productId).then(function(res) { if( res == true ){ /*let productBorderTypeDelivery = $(".delivery-type").has('div.box-border-quad'); productBorderTypeDelivery.addClass('box-border-quad-express'); productBorderTypeDelivery.removeClass('box-border-quad'); let productIconTypeDelivery = productBorderTypeDelivery.children('img')[0]; productIconTypeDelivery.src = 'https://storage.googleapis.com/chz-marketing-repositorio-fotos/cochez/Iconos/truck-express.svg '; let productTextTypeDelivery = $('.msg-quad-inv-delivery'); productTextTypeDelivery.empty(); productTextTypeDelivery.append('

Disponible para
entrega a domicilio
express en 45 minutos

'); productTextTypeDelivery.removeAttr('style'); productTextTypeDelivery.css('color', 'green');*/ //$('.expressDeliveryStyle').show(); // Si se obtiene una respuesta igualmente apagamos lógica para express delivery // Apagamos lógica para express delivery $('.expressDeliveryStyle').hide() }else{ // validamos si el horario de la sucursal está habilitado para el horario de Delivery Express // Apagamos lógica para express delivery /*( ifApplyExpressDeliveryByTime() == true ) ? $('.expressDeliveryStyle').show() : $('.expressDeliveryStyle').hide();*/ $('.expressDeliveryStyle').hide() } }) .catch(function(error) { console.log("Error when validating if it is a holiday : " + error); }); // Validación para horarios especiales / feriados para sucursales // ***Se comenta bloque de validación a espera de ajuste en ambiente de desarrollo*** /*let dateToday = moment().format('YYYY-MM-DD'); const ciaCodeStore = (JSON.parse(localStorage.getItem('locStor'+getPrefixStore3())).codigo); const ciaCodeCompany = getCodeCompany(); ifApplyStoreBySpecialHour(dateToday, ciaCodeCompany, ciaCodeStore).then(function(res) { if( res == true ){ let productBorderTypeDelivery = $('.box-border-quad-express'); productBorderTypeDelivery.addClass('box-border-quad'); productBorderTypeDelivery.removeClass('box-border-quad-express'); let productIconTypeDelivery = productBorderTypeDelivery.children('img')[0]; productIconTypeDelivery.src = 'https://storage.googleapis.com/chz-marketing-repositorio-fotos/novey/iconos_storefront/deliveryNoveyV2.svg'; let productTextTypeDelivery = $('.msg-quad-inv-delivery'); productTextTypeDelivery.empty(); productTextTypeDelivery.append('

Disponible para
entrega a domicilio

'); productTextTypeDelivery.removeAttr('style'); productTextTypeDelivery.css('color', '#0055b8'); //$('.expressDeliveryStyle').hide(); }else{ // validamos si el horario de la sucursal está habilitado para el horario de Delivery Express ( ifApplyExpressDeliveryByTime() == true ) ? $('.expressDeliveryStyle').show() : $('.expressDeliveryStyle').hide(); } }) .catch(function(error) { console.log("Error when validating if it is a holiday : " + error); });*/ }else{ $('.expressDeliveryStyle').hide() } } } } function ifApplyExpressDeliveryByTime(){ let date = new Date(); // Creamos y asignamos una fecha / hora para validar horarios // fuera del delivery express //let date2 = new Date().toISOString().split('T')[0]; //date2 = date2 + ' 03:30:00 PM'; // Get current hour with timezone. Require moment-timezone library const currentHour = moment(date, 'YYYY-MM-DD H:mm:ss a').tz('America/Panama').format('HH:mm:ss'); const openHour = date.toISOString().split('T')[0] + ' ' + CCRZ.getPageConfig('exdev.enableexpressdelivery'); const openHourDeliveryExpress = moment(openHour, 'YYYY-MM-DD H:mm:ss a').format('HH:mm:ss'); const closeHour = date.toISOString().split('T')[0] + ' ' + CCRZ.getPageConfig('exdev.disableexpressdelivery'); const closeHourDeliveryExpress = moment(closeHour, 'YYYY-MM-DD H:mm:ss a').format('HH:mm:ss'); return ( ( currentHour >= openHourDeliveryExpress) == true && (currentHour <= closeHourDeliveryExpress) == true ) ? true : false; } // Obtenemos los datos para validación si existe sucursal con horario especial o feriado /*function ifApplyStoreBySpecialHour(specialDate, ciaCode, ciaStore){ let remoteCall = _.extend(CCRZ.RemoteInvocation,{ className: 'AddToCartRemoteValidator'}); remoteCall.invokeCtx('getStoreBySpecialHour', specialDate, ciaCode, ciaStore, function(response, event) { //console.log("AJX RESPONSE :: ==> " + response); let applyResponseSH; if(!response.data.length == 0){ const HoraInicioStore = response.data[0].Hora_Inicio__c; const HoraFinStore = response.data[0].Hora_Fin__c; if( HoraInicioStore == "cerrado" && HoraFinStore == "cerrado"){ applyResponseSH = true; }else{ applyResponseSH = false; } }else{ applyResponseSH = false; } return applyResponseSH; }, { nmsp: false, escape: false, timeout: 10000, buffer: false }); }*/ /* @return promise Validamos si existe una sucursal con horario especial o feriado */ /*function ifApplyStoreBySpecialHour( specialDate, ciaCode, ciaStore ) { return new Promise((resolve, reject) => { let remoteCall = _.extend(CCRZ.RemoteInvocation,{ className: 'AddToCartRemoteValidator'}); remoteCall.invokeCtx('getStoreBySpecialHour', specialDate, ciaCode, ciaStore, function(response, event) { let applyResponseSH; if(!response.data.length == 0){ const HoraInicioStore = response.data[0].Hora_Inicio__c; const HoraFinStore = response.data[0].Hora_Fin__c; if( HoraInicioStore == "cerrado" && HoraFinStore == "cerrado"){ applyResponseSH = true; resolve(applyResponseSH); }else{ applyResponseSH = false; reject(applyResponseSH); } }else{ applyResponseSH = false; reject(applyResponseSH); } return applyResponseSH; }, { nmsp: false, escape: false, timeout: 10000, buffer: false }); }); }*/ /* @return promise VALIDAMOS SI EL PRODUCTO TIENE DELIVERY EXPRESS Y SI ESTÁ EN EL CENTRO DE ENTREGA EXPRESS */ function getStatusExpressDeliveryByStore( productId ) { return new Promise((resolve, reject) => { let remoteCall = _.extend(CCRZ.RemoteInvocation,{ className: 'AddToCartRemoteValidator'}); remoteCall.invokeCtx('getStatusExpressDeliveryByStore', productId, function(response, event) { let applyResponseSH; if(!response.data.length == 0){ console.log('EXPRESS DELIVERY RESPONSE ==> ' + JSON.stringify(response.data)); const expressDeliveryStatus = response.data[0].ccrz__ProductItem__r.express_delivery__c; const inventoryLocationCode = response.data[0].ccrz__InventoryLocationCode__c; console.log("EXPRESS DELIVERY STATUS ==> "+expressDeliveryStatus); console.log("INVENTORY LOCATION CODE ==> "+inventoryLocationCode); if(expressDeliveryStatus == true && inventoryLocationCode == '0303'){ applyResponseSH = true; resolve(applyResponseSH); }else{ applyResponseSH = false; reject(applyResponseSH); } }else{ applyResponseSH = false; reject(applyResponseSH); } return applyResponseSH; }, { nmsp: false, escape: false, timeout: 10000, buffer: false }); }); } function enabledBrandForInk(){ let brandName = CCRZ.prodDetailView.model.attributes.product.prodBean.brandName if(brandName != null){ let brandEnables = CCRZ.getPageConfig('paint.brands_enable').split(',') return brandEnables.includes(brandName.toLowerCase().capitalize()) } else { return false } } // id: a1F5C000000kRcWUAU // qty: 1 function addToCartSFAsync( id, qty ) { console.log("JMC ================> entro"); return new Promise((resolve, reject) => { //Valida el inventario let data=[{ prodId: id, qty: qty.toString() }]; let remoteCall = _.extend(CCRZ.RemoteInvocation, { className: 'AddToCartRemoteValidator' }); remoteCall.invokeContainerLoadingCtx($('.deskLayout'), 'itemQuantityValidationRemoteAction', JSON.stringify(data), function (res, err) { if (res != null) { if (res.success) { //Agrega al carrito el producto let remoteCall2 = _.extend(CCRZ.RemoteInvocation, { className: 'ccrz.cc_RemoteActionController' }); remoteCall2.invokeContainerLoadingCtx($('.deskLayout'), 'addItem', id, qty, null, null, "", null, function (res, err) { if (res.success) { resolve(res); CCRZ.pubSub.trigger('cartChange', res.data); } }, { nmsp: false }); } else { reject(res); } } else if (err.message != "") { reject(res); } }, { nmsp: false }); }); } CCRZ.pubSub.on("chargeFooter", function() { // function hawkLoadEvent(){ if(CCRZ.getPageConfig('hsm.enable_hs')){ if(CCRZ.pagevars.currentPageName=="ccrz__HomePage"){ HawkSearch.Tracking.track('pageload',{pageType: "landing"}); } if(CCRZ.pagevars.currentPageName=="ccrz__Cart"){ HawkSearch.Tracking.track('pageload',{pageType: "cart"}); } if(CCRZ.pagevars.currentPageName=="ccrz__MyAccount"){ HawkSearch.Tracking.track('pageload',{pageType: "custom"}); } if(CCRZ.pagevars.currentPageName=="ccrz__CheckoutNew"){ HawkSearch.Tracking.track('pageload',{pageType: "custom"}); } if(CCRZ.pagevars.currentPageName=="ccrz__ProductList"){ HawkSearch.Tracking.track('pageload',{pageType: "custom"}); } if(CCRZ.pagevars.currentPageName=="ccrz__ProductList"){ } if(CCRZ.pagevars.currentPageName=="ccrz__ProductDetails"){ // setTimeout(() => { HawkSearch.Context.add("uniqueid", CCRZ.productDetailModel.attributes.product.prodBean.id) // }, 1000); HawkSearch.Tracking.track('pageload',{pageType: "item"}); } } }); function hawkDataTrackCynx(qty, typeProduct, dataProduct){ console.log('datos '+ dataProduct.sfidProd); console.log('datos2 '+ dataProduct.id); sfidHawk=dataProduct.sfidProd?dataProduct.sfidProd:dataProduct.id; sendEventHawkTrackAdd2Cart(sfidHawk,dataProduct.price,qty) } function sendEventHawkTrackAdd2Cart(sfidHawk,price,qty){ console.log('hawkEventSend => '+ sfidHawk); HawkSearch.Tracking.track('add2cart',{ uniqueId: sfidHawk, price: parseFloat(price), quantity: parseInt(qty), currency: 'USD' }); } function hawkDataTrackOrderConfirmation(dataPurchase){ let oItems=[]; if(dataPurchase.orderItems){ for(item of dataPurchase.orderItems ){ if(item.product && item.price && item.quantity){ oItems.push({ uniqueid: item.product, itemPrice: item.price, quantity: item.quantity }) } } HawkSearch.Tracking.track('sale', { orderNo: dataPurchase.orderName, itemList: oItems, total: dataPurchase.totalAmount, subTotal: dataPurchase.subTotal, tax: dataPurchase.tax, currency: 'USD' }); } // HawkSearch.Tracking.track('sale', { // orderNo: dataPurchase.orderName, // itemList: dataPurchase.orderItems, // total: dataPurchase.totalAmount, // subTotal: dataPurchase.subTotal, // tax: dataPurchase.tax, // currency: 'USD' // }); } CCRZ.pubSub.on("view:PaymentProcessorView:refresh", function() { updateInfo(); setTimeout(() => { $("#overlay").remove() }, 2000); }) function momentFormatLLLL(date){ let dateLLLL = '' if(date != ''){ let arrDates = moment(date).format('LLLL').split(' ') arrDates[0] = arrDates[0].toLowerCase().capitalize() arrDates.splice(arrDates.length-1) dateLLLL = arrDates.join(' ') } else { dateLLLL = 'Fecha invalida' } return dateLLLL } function obtenerValorParametroBase(sParametroNombre,url) { var sPaginaURL = url; var sURLVariables = sPaginaURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParametro = sURLVariables[i].split('='); if (sParametro[0] == sParametroNombre) { return sParametro[1]; } } return null; } //Funcion que retorna la distancia en kilometros entre dos conjuntos de coordenadas function getDistanceByTwoCoordinates(lat1, lon1, lat2, lon2){ rad = function(x){ return x * Math.PI/180; } //Radio de la tierra en km let R = 6371; let dLat = rad( lat2 - lat1 ); let dLong = rad( lon2 - lon1 ); let a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(rad(lat1)) * Math.cos(rad(lat2)) * Math.sin(dLong/2) * Math.sin(dLong/2); let c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); let d = R * c; return d.toFixed(2); } //Funcion que ordena por alguna propiedad del JSON function jsonSortOrder(prop) { return function(a, b) { if (a[prop] > b[prop]) { return 1; } else if (a[prop] < b[prop]) { return -1; } return 0; } } //Funcion que seteara la tienda y la actualiza en el widget componente del header selector de tiendas function setLocStore(storeCode, isChangingStore){ let cia = getCodeCompany() let stores = JSON.parse(localStorage.getItem('stores'+getPrefixStore3())) let storeSelected = stores.find( x => (cia+x.centro == storeCode) ) let jsonStore = JSON.stringify({ codigo:storeSelected.centro, tienda:storeSelected.nombre, direccion:storeSelected.direccion, horarioLV:storeSelected.horarioLunesViernes, horarioS:storeSelected.horarioSabado, horarioD:storeSelected.horarioDomingo, coordenadas: storeSelected.coordenadas }) if (isChangingStore) { CCRZ.pubSub.trigger('pickStore_Event', storeSelected.nombre); } localStorage.setItem('locStor'+getPrefixStore3(), jsonStore) //Actualiza el componente widget de tiendas en el header locationSelected() } function loaderPayment(text1, text2){ let customLoader = `

${text1}

${text2}

${text1}

${text2}

` return customLoader } /* GIFT CARD */ //variable global var processCount = 0; var addItemSuccessCount = 0; // CCRZ.pubSub.on('view:cartView:refresh', function(){ // if((JSON.parse(sessionStorage.getItem('giftcard')) != null) && (CCRZ.pagevars.queryParams.pagekey != 'GiftCard') && (CCRZ.pagevars.remoteContext.currentPageName != 'ccrz__CheckoutNew') && CCRZ.pagevars.remoteContext.currentPageName != 'ccrz__OrderConfirmation'){ // if(JSON.parse(sessionStorage.getItem('savedCartItems')) != null){ // checkCartToRemoveGiftCard(false); // sessionStorage.removeItem('giftcard'); // let savedItems = JSON.parse(sessionStorage.getItem('savedCartItems')); // let parseItem; // let itemsQty = savedItems.length; // //let response = false; // savedItems.forEach(element => { // parseItem = JSON.parse(element); // addSavedCartItems(parseItem.idProduct, parseItem.quantity, itemsQty); // }); // //CCRZ.pubSub.trigger('cartChange', CCRZ.cartView.cartmodel.attributes.sfid); // }else{ // checkCartToRemoveGiftCard(true); // sessionStorage.removeItem('giftcard'); // } // } // }); //NEW DEV LOCAL STORAGE ANDRES GARCIA CCRZ.pubSub.on('view:cartView:refresh', function(){ if((JSON.parse(localStorage.getItem('giftcard')) != null) && (CCRZ.pagevars.queryParams.pagekey != 'GiftCard') && (CCRZ.pagevars.remoteContext.currentPageName != 'ccrz__CheckoutNew') && CCRZ.pagevars.remoteContext.currentPageName != 'ccrz__OrderConfirmation'){ if(JSON.parse(localStorage.getItem('savedCartItems')) != null){ checkCartToRemoveGiftCard(false); localStorage.removeItem('giftcard'); let savedItems = JSON.parse(localStorage.getItem('savedCartItems')); let parseItem; let itemsQty = savedItems.length; //let response = false; savedItems.forEach(element => { parseItem = JSON.parse(element); addSavedCartItems(parseItem.idProduct, parseItem.quantity, itemsQty); }); //CCRZ.pubSub.trigger('cartChange', CCRZ.cartView.cartmodel.attributes.sfid); }else{ checkCartToRemoveGiftCard(true); localStorage.removeItem('giftcard'); } } // valida el contexto de PG Promocionales //validatePgPromoContext(); }); // CCRZ.pubSub.on('view:CartDetailView:refresh',function(){ // validatePgPromoContext(); // }); function checkCartToRemoveGiftCard(cartChangeFlag){ const ccFlag = cartChangeFlag; if(processCount == 0){ let gcSKU = CCRZ.getPageConfig('GC.gcsku', 'GCSKU'); //let gcSessionStorage = JSON.parse(sessionStorage.getItem('giftcard')); if(CCRZ.cartView.cartmodel.attributes.cartItems != undefined){ if(CCRZ.cartView.cartmodel.attributes.cartItems[0].mockProduct.sku.includes(gcSKU)){ removeGCFromCart(CCRZ.cartView.cartmodel.attributes.sfid, ccFlag); } } processCount++; } } function removeGCFromCart(cartSfid,cartChangeFlag) { const ccFlag = cartChangeFlag; let processCount = 0; let remoteCall = _.extend(CCRZ.RemoteInvocation,{ className: 'AddToCartRemoteValidator'}); remoteCall.invokeCtx('removeItemsFromCart',cartSfid,(res,err)=>{ if(res.success && ccFlag){ CCRZ.pubSub.trigger('cartChange', CCRZ.cartView.cartmodel.attributes.encryptedId); } },{nmsp: false, escape: false, buffer: false} ); } //NEW DEV SAVE CART ITEMS GIFTCARD // function getCartItems(cartSfid) { // //let processCount = 0; // let items; // let remoteCall = _.extend(CCRZ.RemoteInvocation,{ className: 'AddToCartRemoteValidator'}); // remoteCall.invokeCtx('getCartItems',cartSfid,(res,err)=>{ // if(res.success){ // items = JSON.stringify(res.data.cartItems); // sessionStorage.setItem('savedCartItems',items); // } // },{nmsp: false, escape: false, buffer: false} // ); // } //NEW DEV SAVE CART ITEMS GIFTCARD // function addSavedCartItems(idProd, qty, itemsQty){ // let remoteCall = _.extend(CCRZ.RemoteInvocation, { className: 'ccrz.cc_RemoteActionController' }); // remoteCall.invokeContainerLoadingCtx($('.deskLayout'), 'addItem', idProd, qty, null, null, "", null, function (res, err) { // if (res.success) { // console.log('Se logro introducir items al carrito desde el session storage'); // addItemSuccessCount++; // if(addItemSuccessCount == itemsQty){ // CCRZ.pubSub.trigger('cartChange', res.data); // } // } // }, // { nmsp: false }); // } // PUNTOS GRODOS PROMOCIONALES ---------------- // isPromo: true or false function setLocalIsCartPgPromoContext(isPromo){ isPromo ? localStorage.setItem('isPgPromoContext', 'true') : localStorage.removeItem('isPgPromo'); } // function validatePgPromoContext(){ // if((localStorage.getItem('isPgPromoContext') == 'true') && (CCRZ.pagevars.remoteContext.currentPageName != 'ccrz__CheckoutNew') && CCRZ.pagevars.remoteContext.currentPageName != 'ccrz__OrderConfirmation'){ // const cartID = CCRZ.cartView != undefined ? CCRZ.cartView.cartmodel.attributes.sfid : CCRZ.cartDetailView.model.attributes.sfid; // const cartEncId = CCRZ.pagevars.currentCartID; // let remoteCall = _.extend(CCRZ.RemoteInvocation,{ className: 'AddToCartRemoteValidator'}); // remoteCall.invokeCtx('removePGCartItems',cartID, true, function(response, event) { // if(response.success){ // localStorage.removeItem('isPgPromoContext'); // remoteCall.invokeCtx('removeFlagIsPgPromo',cartEncID, function(response, event) { // if(response.success){ // console.log('AJX :: removeFlagIsPgPromo ==> ', response); // //Refresco la pagina si estoy en el cart Detail // if(CCRZ.pagevars.remoteContext.currentPageName == 'ccrz__Cart'){ // location.reload(); // } // } // }, { nmsp: false, escape: false, timeout: 10000, buffer: false }); // CCRZ.pubSub.trigger('cartChange', CCRZ.cartView.cartmodel.attributes.encryptedId); // } // }, { nmsp: false, escape: false, timeout: 10000, buffer: false }); // } // } // function checkCartToRemoveGiftCard(cartChangeFlag){ // const ccFlag = cartChangeFlag; // if(processCount == 0){ // let gcSKU = CCRZ.getPageConfig('GC.gcsku', 'GCSKU'); // //let gcSessionStorage = JSON.parse(sessionStorage.getItem('giftcard')); // if(CCRZ.cartView.cartmodel.attributes.cartItems != undefined){ // if(CCRZ.cartView.cartmodel.attributes.cartItems[0].mockProduct.sku.includes(gcSKU)){ // removeGCFromCart(CCRZ.cartView.cartmodel.attributes.sfid, ccFlag); // } // } // processCount++; // } // } function getAccountGroupInfo(){ return new Promise((resolve, reject) => { const remoteCall = _.extend(CCRZ.RemoteInvocation, { className: 'AddToCartRemoteValidator' }); remoteCall.invokeContainerLoadingCtx($('.deskLayout'), 'getAccountGroupInfo', CCRZ.currentUser.Contact.AccountId, function (res, err) { if(res.success){ resolve(res.data.ccrz__E_AccountGroup__r); }else{ reject(res); } },{ nmsp: false, escape: false, timeout: 10000, buffer: false } ); }); } //Ejemplo de llamado a función con promesa // async function callAccountGroupInfo(){ // let response = await getAccountGroupInfo(); // return response; // } // AJX. Parche para HS. Solo mobile, detecta cuando ya ha cargado HS sus productos y ajusta su div de filtros function isMobile() { const mobileQuery = window.matchMedia("(max-width: 767px)"); return mobileQuery.matches; } CCRZ.pubSub.on('chargeFooter', function(param){ setTimeout(() => { if ($("#viewState").val() == "ListView") { if (isMobile()) { try{ if(CCRZ.pagevars.storefrontName == 'B2CCochez'){ $('.hawk-railNavHeading').addClass('ml-4 mt-5').insertBefore($('.cc_tmpl_TwoColRightRD')); } else if(CCRZ.pagevars.storefrontName == 'B2CNovey'){ $('.hawk-railNavHeading').insertBefore($('.cc_tmpl_TwoColRightRD')); $('.hawk-railNavHeading').addClass('ml-4 mt-5 mb-5'); } }catch(ex){console.log(ex);} } } }, 2000); });

'; } } return wrapper; }); // INSERTA ROW SEGUN PARAMETROS ESTABLECIDOS EN LA FUNCION Handlebars.registerHelper('gridWrapCustom', function(index, isLast, isOpenning, customCol, clases) { var wrapper = "", perRow = customCol, clases = (clases == undefined) ? '' : clases; if (isOpenning) { if (index == 0 || index % perRow == 0) { wrapper += '

'; } } else { if ((index + 1) % perRow == 0 || isLast) { wrapper += '

'; } } return wrapper; }); Handlebars.registerHelper('hlpPercentagesOfDiscount', function(price, basePrice, options) { return percentagesOfDiscount(price, basePrice); }); Handlebars.registerHelper("hlpGetStorefrontname", function(options) { return CCRZ.pagevars.storefrontName; }); Handlebars.registerHelper("hlpGetCurrSiteURL", function(options) { return CCRZ.pagevars.currSiteURL; }); Handlebars.registerHelper("hlpGetCartId", function(options) { return CCRZ.pagevars.currentCartID; }); Handlebars.registerHelper("hlpGetCurrUserLocale", function(options) { return CCRZ.pagevars.userLocale; }); // DISPLAY FONT AWESOME ICON BY SIZE OPTIONS => '' (ORIGINAL) | 'fa-lg' (33% increase) | 'fa-2x' | 'fa-3x' | 'fa-4x' | 'fa-5x' Handlebars.registerHelper('displayIconBySize', function(iconName, size, options) { return new Handlebars.SafeString(""); }); // DISPLAY CATEGORY BAR IMAGES Handlebars.registerHelper('categoriesBarLink', function(category, styleClass, options) { var tmpCategory = _.clone(category); if (tmpCategory && tmpCategory.shortDesc) { delete tmpCategory.shortDesc; } if (tmpCategory && tmpCategory.longDesc) { delete tmpCategory.longDesc; } var categoryJSON = _.escape(JSON.stringify(tmpCategory)); var content, image = ''; if (tmpCategory && tmpCategory.name) { content = _.escape(tmpCategory.name); } else if (tmpCategory && tmpCategory.category && tmpCategory.category.name) { content = _.escape(tmpCategory.category.name); } if (options && options.hash['icon']){ image = options.hash['icon']; } if (options && options.hash['image']){ image = options.hash['image']; } var href = CCRZ.goToPLP(null, category); if(styleClass.indexOf('categoryBar') == -1){ if (category.openInNewWindow || category.isNewWindow) { return new Handlebars.SafeString("

" + image + "" + content + "

"); } else { return new Handlebars.SafeString("

" + image + "" + content + "

"); } }else{ if (category.openInNewWindow || category.isNewWindow) { return new Handlebars.SafeString("

" + image + "" + content + "

"); } else { return new Handlebars.SafeString("

" + image + "" + content + "

"); } } }); //DISPLAY SVG IMAGES WITH URL Handlebars.registerHelper('displaySVG_IMG', function(obj, styleClass, options) { let imgSrc = CCRZ.processImageURL(obj, styleClass, options), width = '', height = '', classes = ''; if (options && options.hash['width']) width = "width='" + options.hash['width'] + "'"; if (options && options.hash['height']) height = "height='" + options.hash['height'] + "'"; if (options && options.hash['classes']) classes = "class='" + options.hash['classes'] + "'"; if (options && options.hash.hasOwnProperty('noUrl') ) imgSrc = CCRZ.pagevars.themeBaseURL + "images/" + obj if (imgSrc.length > 0) return new Handlebars.SafeString("Derivación de 40mm x 25mm en te para moldura blanco schneider electric (1)"); else return new Handlebars.SafeString(""); }); Handlebars.registerHelper("hlpGetUrlCatalogo", function(pageName, options) { if(CCRZ.getPageConfig('env.isprod', true)){ return CCRZ.pagevars.storeSettings.Site_Secure_Domain__c + '/ccrz__CCPage?pagekey=' + pageName +'&cartId=' + CCRZ.pagevars.currentCartID + getCSRQueryString(); }else{ return CCRZ.pagevars.storeSettings.Site_Secure_Domain__c + '/' + CCRZ.pagevars.storefrontName.toLocaleLowerCase() + '/ccrz__CCPage?pagekey=' + pageName +'&cartId=' + CCRZ.pagevars.currentCartID + getCSRQueryString(); } }); Handlebars.registerHelper("getPageConfig", function(configName, options) { if(CCRZ.getPageConfig(configName) !== undefined){ return CCRZ.getPageConfig(configName) } }); Handlebars.registerHelper("activeDefaultPaymentType", function(configName, keyName, activeClass, options) { if(CCRZ.getPageConfig(configName) !== undefined){ if(CCRZ.getPageConfig(configName, 'cc') == keyName){ return new Handlebars.SafeString(activeClass) } } }); //Para extraer en porcentaje de ahorro Handlebars.registerHelper('hlpPercentagesOfDiscount', function(price, basePrice, options) { return percentagesOfDiscount(price, basePrice); }); //Para verificar URL HomePage Handlebars.registerHelper('hlphomePageLink', function() { const href = CCRZ.pagevars.currSiteURL; return new Handlebars.SafeString(``) }); // DISPLAY PRODUCT NAME AND PREPARE DATA TO USE IN GOOGLE TAG MANAGER DATALAYER Handlebars.registerHelper('productLinkPDP', function(product, productType, styleClass, options) { let SKU = ''; let price = 0 // basePrice // price // savings // // SKUCochez // // SKUNovey // SKU if (!_.isUndefined(product)) { if (CCRZ.pagevars.storefrontName == 'B2CCochez' & product.SKUCochez) { SKU = product.SKUCochez; }else if (CCRZ.pagevars.storefrontName == 'B2CNovey' & product.SKUNovey) { SKU = product.SKUNovey; }else{ if (product.linkURL) { SKU = product.linkURL; } else if (product.sku) { SKU = product.sku; } else if (product.SKU) { SKU = product.SKU; } else if (product.productSKU) { SKU = product.productSKU; } } let filterData = CCRZ.productDetailModel == undefined ? "" : CCRZ.productDetailModel.attributes.product.prodBean.filterData; var linkObj = { 'name' : product.alternateName !== undefined? product.alternateName : product.sfdcName, 'SKU' : SKU, 'price' : product.price == undefined? "":product.price, 'brand' : product.brandName, 'category' : getCategoryNameFromFilterDataProp(filterData), 'basePrice' : product.basePrice, 'price' : product.price, 'savings' : product.savings, 'variant' : '', 'list' : '', 'position' : '', 'productUrl' : '', 'typeProduct' : productType, 'openInNewWindow' : product.openInNewWindow, 'friendlyUrl' : product.friendlyUrl }; var productJSON = _.escape(JSON.stringify(linkObj)); } var content = ''; if (product & product.name) { content = _.escape(product.name); } if (options & options.hash['image']) content = options.hash['image']; if (options & options.hash['text']) { content = _.escape(_.unescape(options.hash['text'])); } var href = CCRZ.goToPDP(null,product); //var href = GoToPDP_test(null, product); // console.log('texto carrouseell'+ content) if(CCRZ.getPageConfig('hsm.enable_hs')){// si tengo activado el HawkSearchTracking if (product.openInNewWindow || product.isNewWindow) { // return new Handlebars.SafeString("" + content + "") return new Handlebars.SafeString("" + content + "") } else { return new Handlebars.SafeString("" + content + ""); // return new Handlebars.SafeString("" + content + ""); } }else{ if (product.openInNewWindow || product.isNewWindow) { return new Handlebars.SafeString("" + content + "") } else { return new Handlebars.SafeString("" + content + ""); // return new Handlebars.SafeString("" + content + ""); } } }); /*GoToPDP_test = function(objLink) { var product = null; if (objLink !== null) { product = $(objLink).data("product"); } if (product === null) { product = arguments[1]; } var productSku; if (product.linkURL) { productSku = product.linkURL; } else if (product.sku) { productSku = product.sku; } else if (product.SKU) { productSku = product.SKU; } else if (product.productSKU) { productSku = product.productSKU; } var productUrl = CCRZ.pageUrls.productDetails + buildQueryString_test("?sku=" + encodeURIComponent(productSku)); if (CCRZ.pagevars.useFriendlyUrls && !_.isUndefined(product.friendlyUrl)) { if (product.friendlyUrl.startsWith('/') && CCRZ.pagevars.currSiteURL.endsWith('/')) { product.friendlyUrl = product.friendlyUrl.substring(1); } productUrl = CCRZ.pagevars.currSiteURL + product.friendlyUrl + buildQueryString_test(''); } return productUrl; }; buildQueryString_test = function(inputQueryString) { var queryString = inputQueryString; if (inputQueryString.toLowerCase().indexOf("portaluser") === -1 && CCRZ.pagevars.portalUserId) { queryString ? queryString += '&' : queryString += '?'; queryString += 'portalUser=' + CCRZ.pagevars.portalUserId; } if (inputQueryString.toLowerCase().indexOf("store") === -1 && CCRZ.pagevars.storeName) { queryString ? queryString += '&' : queryString += '?'; queryString += 'store=' + CCRZ.pagevars.storeName; } if (inputQueryString.toLowerCase().indexOf("effectiveaccount") === -1 && CCRZ.pagevars.effAccountId) { queryString ? queryString += '&' : queryString += '?'; queryString += 'effectiveAccount=' + CCRZ.pagevars.effAccountId; } if (inputQueryString.toLowerCase().indexOf("grid") === -1 && CCRZ.pagevars.priceGroupId) { queryString ? queryString += '&' : queryString += '?'; queryString += 'grid=' + CCRZ.pagevars.priceGroupId; } if (inputQueryString.toLowerCase().indexOf("cclcl") === -1 && CCRZ.pagevars.userLocale) { queryString ? queryString += '&' : queryString += '?'; queryString += 'cclcl=' + CCRZ.pagevars.userLocale; } return queryString; }; openPDP_test = function(e) { if (!e) e = window.event; var target = e.target || e.srcElement; if (CCRZ.ga) { CCRZ.ga.handleProductDetails(e); } var link = GoToPDP_test(e); if (target === "_blank") { if (windowObjectReference == null || windowObjectReference.closed) { windowObjectReference = window.open(link); } else { windowObjectReference.focus(); } } else { window.location = link; } return false; };*/ Handlebars.registerHelper('displayImageCustom', function(obj, styleClass, options) { if (options && options.hash['src']) { var imgSrc = _.escape(options.hash['src']); } else { var imgSrc = CCRZ.processImageURL(obj, styleClass, options); } //TODAS LAS PROPIEDADES QUE DESEES COLOCAR PARA EL TAG Derivación de 40mm x 25mm en te para moldura blanco schneider electric (2) AQUI let alt = ""; if (options && options.hash['alt']) alt = _.escape(options.hash['alt']); /*var dataId = ""; if (options && options.hash['dataId']) dataId = _.escape(options.hash['dataId']);*/ let loading = '' if(options && options.hash['loading']) loading = _.escape(options.hash['loading']); if (imgSrc.length > 0) return new Handlebars.SafeString("Derivación de 40mm x 25mm en te para moldura blanco schneider electric (3)"); else return new Handlebars.SafeString("Derivación de 40mm x 25mm en te para moldura blanco schneider electric (4)"); }); Handlebars.registerHelper('CategoryLinkCustom', function(category, styleClass, options) { var tmpCategory = _.clone(category); if (tmpCategory && tmpCategory.shortDesc) { delete tmpCategory.shortDesc; } if (tmpCategory && tmpCategory.longDesc) { delete tmpCategory.longDesc; } var categoryJSON = _.escape(JSON.stringify(tmpCategory)); var content = ''; var promo = ''; if (tmpCategory && tmpCategory.name) { content = _.escape(tmpCategory.name); } else if (tmpCategory && tmpCategory.category && tmpCategory.category.name) { content = _.escape(tmpCategory.category.name); } if (options && options.hash['image']) content = options.hash['image']; if (options && options.hash['text']) { content = _.escape(options.hash['text']); } if (options && options.hash['promo']) promo = options.hash['promo']; var href = CCRZ.goToPLP(null, category); console.log('CategoryLinkCustom --> ', tmpCategory) if (category.openInNewWindow || category.isNewWindow) { //callCategoryLinkClick_DataLayer(event); return new Handlebars.SafeString("" + content + ""); } else { return new Handlebars.SafeString("" + content + ""); } }); //RETURNS THE REAL INDEX NUMBER OF LIST Handlebars.registerHelper('printIndex', function(value, options) { return parseInt(value) + 1; }); //RETURNS THE URI OF CREDIT CARD LOGO Handlebars.registerHelper('getCCLogo', function(paymentType, options) { return CCRZ.pagevars.storeSettings.Site_Secure_Domain__c + CCRZ.pagevars.themeBaseURL + 'images/'+ paymentType + '.svg' }); //RETURNS THE CREDIT CARD NUMBER FORMAT Handlebars.registerHelper('formatCCNumber', function(cardNumber, paymentType, options) { let number = "", num = [] for (var i = 0, len = cardNumber.length; i < len; i += 1) { num.push(cardNumber[i]); } if(paymentType == "Amex"){ // number = cardNumber.replace(/\b(\d{4})(\d{6})(\d{5})\b/, '$1 $2 $3'); for(var i=0; i < 4; i++) { number = number.concat(num[i]) } number = number + " " for(i; i < 10; i++) { number = number.concat(num[i]) } number = number + " " for(i; i < 16; i++) { number = number.concat(num[i]) } }else{ // number = cardNumber.replace(/(\{A-Z 0-9}(?!\s))/g, "$1 ") for(var i=0; i < num.length; i++) { if(i%4 == 0 && i > 0) number = number.concat(' ') number = number.concat(num[i]) } } return number }); //RETURNS THE URI OF CREDIT CARD LOGO Handlebars.registerHelper('setDateFormat', function(month, year, options) { let dateFormat = month + "/"+ year if(month <= 9){ dateFormat = "0" + month + "/"+ year } return dateFormat }); //SHOW DEBUG LOGS IF THE CONFIGURATION PARAM IS TRUE Handlebars.registerHelper('showDebugComments',function(logName, logContent) { if(CCRZ.getPageConfig('debug.show_dcl', false)){ console.log(logName, logContent) } }); // RETURN COUNT DOWN FOR SPLASH PROMOTIONS Handlebars.registerHelper('printCountDown', function(id, dateValue, size, fontsize, positionX, PositionY, options) { // *** UPDATE COUNT EVERY 1 SECOND *** var x = setInterval(function() { // *** APPLY STYLES BY PARAMETERS *** let cdParameters = "splash-cd-size-" + size + " splash-cd-fontsize-" + fontsize + " splash-cd-position-x-" + positionX + " splash-cd-position-y-" + PositionY; $("." + id).addClass(cdParameters); $("." + id + "-mobile").addClass(cdParameters); // *** GET TODAY VALUE *** var now = new Date().getTime(); // *** CALCULATE DIFFERENCE BETWEEN NOW AND COUNTDOWN DATE *** var distance = dateValue - now; if(distance > 0){ // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // *** DISPLAY RESULT IN THE CONTAINER BY ID *** for (let index = 0; index < $("." + id + "-Days").length; index++) { $("." + id + "-Days")[index].innerHTML = days + "d"; $("." + id + "-Hours")[index].innerHTML = hours + "h"; $("." + id + "-Minutes")[index].innerHTML = minutes + "m"; $("." + id + "-Seconds")[index].innerHTML = seconds + "s"; } }else{ // *** STOP THE INTERVAL & SET TO 0 AL CONTAINERS BY ID *** clearInterval(x); for (let index = 0; index < $("." + id + "-Days").length; index++) { $("." + id + "-Days")[0].innerHTML = "0d"; $("." + id + "-Hours")[0].innerHTML = "0h"; $("." + id + "-Minutes")[0].innerHTML = "0m"; $("." + id + "-Seconds")[0].innerHTML = "0s"; } } }, 1000); }); // RETURN COUNT DOWN FOR SPLASH PROMOTIONS Handlebars.registerHelper('printCountDown-Header', function(id, options) { // *** UPDATE COUNT EVERY 1 SECOND *** var x = setInterval(function() { // *** GET TODAY VALUE *** var now = new Date().getTime(); // *** CALCULATE DIFFERENCE BETWEEN NOW AND COUNTDOWN DATE *** let dateValue = new Date().getTime(); if(CCRZ.getPageConfig('pm_u.cd_enddate', false) !== false){ dateValue = new Date(CCRZ.getPageConfig('pm_u.cd_enddate', false)).getTime(); } var distance = dateValue - now; if(distance > 0){ // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // *** DISPLAY RESULT IN THE CONTAINER BY ID *** $("." + id)[0].innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s"; }else{ // *** STOP THE INTERVAL & SET TO 0 AL CONTAINERS BY ID *** clearInterval(x); $("." + id)[0].innerHTML.innerHTML = "0d 0h 0m 0s"; } }, 1000); }); //-------------------------------------------------------------------------------- //------------------- HANDLEBAR QUE UTILIZAMOS PARA EXPRESS DELIVERY EN PDP ------ //-------------------------------------------------------------------------------- /*Handlebars.registerHelper('ifApplyExpressDelivery', function(expressDelivery, options) { if(CCRZ.pagevars.currentPageName=="ccrz__ProductList") expressDelivery=true; if(expressDelivery){ if(CCRZ.getPageConfig('exdev.stl')){ let availableExpressList = CCRZ.getPageConfig('exdev.stl').split(','); let sucursalFilter = ''; let dateToday = moment().format('YYYY-MM-DD'); const applyStoreBySpecialHour = ifApplyStoreBySpecialHour(dateToday, getCodeCompany(), (JSON.parse(localStorage.getItem('locStor'+getPrefixStore3())).codigo)); if(localStorage.getItem('locStor'+getPrefixStore3())){ sucursalFilter = getCodeCompany()+(JSON.parse(localStorage.getItem('locStor'+getPrefixStore3())).codigo); } else { return options.inverse(this); } if(availableExpressList.find(x=>((x.trim())==sucursalFilter))){ console.log("HANDLEBARS: " + applyStoreBySpecialHour); // validamos si para la cia y sucursal existe horario especial por día feriado if( ifApplyStoreBySpecialHour(dateToday, getCodeCompany(), (JSON.parse(localStorage.getItem('locStor'+getPrefixStore3())).codigo)) == true){ return options.inverse(this); }else{ if( ifApplyExpressDeliveryByTime() == true ){ return options.fn(this) }else{ return options.inverse(this); } } } else { return options.inverse(this); } } else { return options.inverse(this); } } else { return options.inverse(this); } });*/ Handlebars.registerHelper('ifApplyExpressDelivery', function(expressDelivery, options) { if(CCRZ.pagevars.currentPageName=="ccrz__ProductList"){ expressDelivery=true; } else if(CCRZ.pagevars.currentPageName=="ccrz__ProductDetails"){ //ajuste para ocultar entrega express de PDP expressDelivery=false; } if(expressDelivery){ if(CCRZ.getPageConfig('exdev.stl')){ let availableExpressList = CCRZ.getPageConfig('exdev.stl').split(','); let sucursalFilter = ''; if(localStorage.getItem('locStor'+getPrefixStore3())){ sucursalFilter = getCodeCompany()+(JSON.parse(localStorage.getItem('locStor'+getPrefixStore3())).codigo); } else { return options.inverse(this); } if(availableExpressList.find(x=>((x.trim())==sucursalFilter))){ const productId = (CCRZ.pagevars.currentPageName == 'ccrz__ProductDetails') ? CCRZ.productDetailModel.attributes.product.prodBean.id : ''; // validamos si aplica para horario dentro de express delivery if( ifApplyExpressDeliveryByTime() == true && getStatusExpressDeliveryByStore(productId) == true ){ return options.fn(this); }else{ return options.inverse(this); } } else { return options.inverse(this); } } else { return options.inverse(this); } } else { return options.inverse(this); } }); //-------------------------------------------------------------------------------- //------------------- HANDLEBAR QUE UTILIZAMOS PARA GARANTIAS EXTENDIDA ---------- //-------------------------------------------------------------------------------- Handlebars.registerHelper('splitExtSKUWarranty', function(extSku, options) { return extSku.split(" -- ")[2]; }); Handlebars.registerHelper('isWarranty', function(extSku, options) { if(extSku != undefined){ let skuLabel = 'GARANTIA-EXT' return extSku.includes(skuLabel) ? options.inverse(this) : options.fn(this); } else { return options.fn(this); } }); Handlebars.registerHelper('haveWarranty', function(/*cartItemId*/sku, isPGPromoItem, options) { console.log("Este es el sku que se le envia a have warranty en helper: "+sku); //console.log("Este es el warrantyparentid que se le envia a have warranty en helper: "+cartItemId); let prodWhitExtSku = CCRZ.currentCart.attributes.ECartItemsS.models.filter(x => (x.attributes.hasOwnProperty("extSKU") && x.attributes.hasOwnProperty("extName"))); //console.log("esto es prodwhitextsku: "+JSON.stringify(prodWhitExtSku)); let haveWarranty; console.log(isPGPromoItem); if(!isPGPromoItem){ haveWarranty = prodWhitExtSku.find(x => ((x.attributes.extSKU.includes(sku) || x.attributes.extName.includes(sku))&& x.attributes.isPGPromoItem != true)); } // let haveWarranty = false; // if(cartItemId != undefined){ // haveWarranty = (prodWhitExtSku.find(x => (x.attributes.warrantyProductParent == cartItemId.toString())) != undefined) ? true : false ; // } //console.log("esto es havewarranty result: "+JSON.stringify(haveWarranty)); // return haveWarranty ? 'style="pointer-events: none;background: #eaeaea;"' : ""; return haveWarranty ? "disableCounter" : ""; //return haveWarranty ? 'data-warranty="true"' : 'data-warranty="false"'; }); //-------------------------------------------------------------------------------- //--------------------- HANDLEBARS QUE UTILIZAMOS EN EL CARRITO ------------------ //-------------------------------------------------------------------------------- Handlebars.registerHelper('haveProductMaxQty', function(max_qty,qty,sfid, options) { if(max_qty){ if(qty>max_qty){ CCRZ.cartDetailView.updateItemQty(event,sfid,max_qty); CCRZ.indicadorMaxQty=1; return options.fn(this); }else{ return options.inverse(this); } }else{ return options.inverse(this); } }); Handlebars.registerHelper('configurationEval', function(config,options) { if(CCRZ.getPageConfig('C.mq')){ return options.fn(this); }else{ return options.inverse(this); } }); //-------------------------------------------------------------------------------- //--------------------- HANDLEBARS LINK URL CATEGORIAS UPPER MENU ---------------- //-------------------------------------------------------------------------------- Handlebars.registerHelper('hlpSetCartId', function(url,options) { let parametro=obtenerValorParametroBase('cartId',url) if(CCRZ.pagevars.currentCartID!=''&& parametro==''){ partesUrl=url.split('cartId=') return partesUrl[0]+'cartId='+CCRZ.pagevars.currentCartID+partesUrl[1] }else{ return url } }); //-------------------------------------------------------------------------------- //--------------------- HANDLEBARS QUE UTILIZAMOS EN EL CHECKOUT ----------------- //-------------------------------------------------------------------------------- Handlebars.registerHelper('hlpBtnSaveAddress', function(options) { let btn = ''; return btn; }); Handlebars.registerHelper('hlpProvinceList', function(options) { let html = "", ubigeos = getUbigeos(); for(item of ubigeos.pais.provincia){ html += '

'; } return html; }) //Handlebars.registerHelper('getCardAddressAccount', function(options) { // CCRZ.CheckoutCustomDataAddressSelect = undefined; // getAddressByAccountId(); //}); //-------------------------------------------------------------------------------- //--------------------- HANDLEBARS QUE UTILIZAMOS EN EL MINI CART ---------------- //-------------------------------------------------------------------------------- //Handlebars.registerHelper('updateData', function( options) { // if(CCRZ.cartCheckoutView.currStep!=0){ // updateInfo() // console.log('paso1') // clearAmuntAndDelivaryData() // } //}); Handlebars.registerHelper('momentFormatLLLL', function(date, options) { let dateLLLL = '' // if(CCRZ.pagevars.currentPageName == 'ccrz__OrderConfirmation' || (!CCRZ.getPageConfig('env.isProd'))){ // date = date.split("/").reverse().join("/") // } date=moment(date).add(12, 'hours').format("YYYY-MM-DD"); if(date != ''){ let arrDates = moment(date).format('LLLL').split(' ') arrDates[0] = arrDates[0].toLowerCase().capitalize() arrDates.splice(arrDates.length-1) dateLLLL = arrDates.join(' ') } else { dateLLLL = 'Fecha invalida' } return dateLLLL }) //-------------------------------------------------------------------------------- //--------------------- GET PAYMENT TYPE SVG ICON URL BY KEY -------------------- //-------------------------------------------------------------------------------- Handlebars.registerHelper("getPaymentTypeSVG", function(key, options) { let URL = CCRZ.processPageLabelMap('svg_payment_method_' + key); return URL }); Handlebars.registerHelper("getLastCardNumber", function(number, options) { let cardNumber = number.substring(number.length - 4) return cardNumber }); Handlebars.registerHelper("maskAsteriskNumber", function(number, card, options) { let cardNumber = card === 'Amex' ? number.replace('XXXXXXXXXXX','**** ****** *') : number.replace('XXXXXXXXXXXX','**** **** **** ') return cardNumber }); Handlebars.registerHelper("loadQuoteOnce", function(options){ /*if(CCRZ.cartDetailView.model.attributes.quoteId){ return options.inverse(this); } else { return options.fn(this); }*/ if(CCRZ.cartDetailModel.attributes.quoteId){ let acum = 0, haveItems = CCRZ.cartDetailModel.attributes.ECartItemsS ? true : false if(haveItems){ let cartItems = CCRZ.cartDetailModel.attributes.ECartItemsS.models for(let a = 0; a < cartItems.length; a++){ if(cartItems[a].attributes.comesfromquote){ acum = acum + 1 } } if(acum > 0){ return options.inverse(this); } else { return options.fn(this); } } else { return options.fn(this); } } else { return options.fn(this); } }); Handlebars.registerHelper("getLayoutMenuName", function(id, options) { let name = JSON.parse(CCRZ.pagevars.pageConfig['menu.menulayoutid']); return name[id]; }); Handlebars.registerHelper("getFunctionNameLayoutMenu", function(id, options) { let name = JSON.parse(CCRZ.pagevars.pageConfig['menu.menulayoutid']); return name[id + 'f']; }); /*Helper para crear link que te lleva al PDP del articulo seleccionado en carrousel*/ Handlebars.registerHelper('pdpLink', function(product) { var href = CCRZ.goToPDP(null, product); return new Handlebars.SafeString("window.location.href='"+href+"';") });

Derivación de 40mm x 25mm en te para moldura blanco schneider electric (2024)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Prof. Nancy Dach

Last Updated:

Views: 5910

Rating: 4.7 / 5 (77 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Prof. Nancy Dach

Birthday: 1993-08-23

Address: 569 Waelchi Ports, South Blainebury, LA 11589

Phone: +9958996486049

Job: Sales Manager

Hobby: Web surfing, Scuba diving, Mountaineering, Writing, Sailing, Dance, Blacksmithing

Introduction: My name is Prof. Nancy Dach, I am a lively, joyous, courageous, lovely, tender, charming, open person who loves writing and wants to share my knowledge and understanding with you.