window.dataLayer = window.dataLayer || []; // getting item categories and item brand // "Brand|Cat1|Cat2|Cat3" function getItemBrandAndCategories(productType){ let obj = {} // let productType = "Brand|Cat1|Cat2|Cat3"; if(!productType){ return { item_category:"", item_brand:"" } }else{ productType = productType.split("|"); let [itemBrand,...categories] = productType; categories.forEach((category,index)=>{ let categoryKey = `item_category${index+1}` obj[categoryKey] = category }); return { item_brand: itemBrand, ...obj } } }
Get AED 50 off on your first order. Use Code: F50
Ships Within 24 hours
Easy Returns And Exchanges
SWIFT CUSTOMER SUPPORT
QUICK BUY