ng-easycommerce 0.0.478 → 0.0.479

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ # version 0.0.479 (para prueba)
2
+ - Se cambia una función de analytics para probar GTM.
1
3
  # version 0.0.478
2
4
  - Se agrega y configura el filtro por fecha de creación, para que se agregue en los filtros_top.
3
5
  # version 0.0.477
@@ -2486,6 +2486,7 @@
2486
2486
  case 'add_to_cart': return 'add_to_cart_gtm';
2487
2487
  case 'remove_from_cart': return 'remove_from_cart_gtm';
2488
2488
  case 'sign_up': return 'sign_up_gtm';
2489
+ case 'view_promotion': return 'view_promotion_gtm';
2489
2490
  default: return null;
2490
2491
  }
2491
2492
  };
@@ -2500,6 +2501,7 @@
2500
2501
  case 'add_to_cart_gtm': return _this.toAddToCart(data);
2501
2502
  case 'remove_from_cart_gtm': return _this.toRemoveToCart(data);
2502
2503
  case 'sign_up_gtm': return _this.toSignUp(data);
2504
+ case 'view_promotion_gtm': return _this.toViewPromotion(data);
2503
2505
  default: return data;
2504
2506
  }
2505
2507
  };
@@ -2566,6 +2568,11 @@
2566
2568
  item_list_name: data.item_list_name || 'Collection',
2567
2569
  item_list_id: data.item_list_id || 'collection'
2568
2570
  };
2571
+ console.log('toViewItemList ', {
2572
+ items: data.products.map(function (product) { return _this.toItem(product); }),
2573
+ item_list_name: data.item_list_name || 'Collection',
2574
+ item_list_id: data.item_list_id || 'collection'
2575
+ });
2569
2576
  };
2570
2577
  this.toRemoveToCart = function (product) {
2571
2578
  var _a, _b;
@@ -2577,13 +2584,13 @@
2577
2584
  };
2578
2585
  };
2579
2586
  this.toItem = function (product) {
2580
- var _a, _b, _c;
2587
+ var _a, _b;
2581
2588
  return ({
2582
2589
  item_name: product.name,
2583
2590
  item_id: product.id,
2584
- item_brand: ((_a = product.attributes) === null || _a === void 0 ? void 0 : _a.length) ? product.attributes[0].name : '',
2591
+ // item_brand: product.attributes?.length ? product.attributes[0].name : '',
2585
2592
  item_category: product.category,
2586
- price: ((_b = product.variants[0]) === null || _b === void 0 ? void 0 : _b.saleprice) || ((_c = product.variants[0]) === null || _c === void 0 ? void 0 : _c.price),
2593
+ price: ((_a = product.variants[0]) === null || _a === void 0 ? void 0 : _a.saleprice) || ((_b = product.variants[0]) === null || _b === void 0 ? void 0 : _b.price),
2587
2594
  quantity: product.quantity || 1,
2588
2595
  });
2589
2596
  };
@@ -2622,6 +2629,11 @@
2622
2629
  this.toSignUp = function (data) {
2623
2630
  return __assign$5({}, data);
2624
2631
  };
2632
+ this.toViewPromotion = function (data) {
2633
+ return {
2634
+ data: data
2635
+ };
2636
+ };
2625
2637
  }
2626
2638
  GTMService.prototype.getDataLayer = function () {
2627
2639
  var window = this.browserGlobals.windowRef();