ng-easycommerce 0.0.516 → 0.0.518

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.
@@ -4424,6 +4424,7 @@
4424
4424
  this.deleteItemApi = function (item_id) { return _this.cart_baseUrl + '/' + _this.cart_token + '/items/' + item_id + '?locale=' + _this.consts.getLocale(); };
4425
4425
  this.couponApi = function () { return _this.cart_baseUrl + '/' + _this.cart_token + '/coupon'; };
4426
4426
  this.addressBookApi = function () { return 'shop-api/' + _this.consts.getChannel() + '/address-book'; };
4427
+ this.taxesApi = function () { return 'shop-api/' + _this.consts.getChannel() + '/carts/tax'; };
4427
4428
  this.cartItems = this.cartItemsSubject.asObservable().pipe(operators.map(function (items) { return _this.switchPriceInCartItem(items); }));
4428
4429
  this.coupon = this.couponSubject.asObservable();
4429
4430
  this.loading = this.requestInProcess.asObservable();
@@ -4432,6 +4433,9 @@
4432
4433
  this.getAddressBook = function () { return __awaiter$5(_this, void 0, void 0, function () { return __generator$5(this, function (_a) {
4433
4434
  return [2 /*return*/, this.connection.get(this.addressBookApi()).pipe(operators.map(function (res) { var _a; return ((_a = res) === null || _a === void 0 ? void 0 : _a.length) && res.map(function (addres) { return addres && __assign$9(__assign$9({}, addres), { selected: addres.default }); }) || null; })).toPromise()];
4434
4435
  }); }); };
4436
+ this.getTaxes = function () { return __awaiter$5(_this, void 0, void 0, function () { return __generator$5(this, function (_a) {
4437
+ return [2 /*return*/, this.connection.post(this.taxesApi(), { token: this.cart_token }).subscribe(function (res) { return res; })];
4438
+ }); }); };
4435
4439
  this.getCart = function () { return __awaiter$5(_this, void 0, void 0, function () {
4436
4440
  var _this = this;
4437
4441
  return __generator$5(this, function (_a) {
@@ -5232,7 +5236,7 @@
5232
5236
  });
5233
5237
  this.costsSubject.next(response);
5234
5238
  }
5235
- if (method == 'pickup_store') {
5239
+ if (method.includes('pickup_store')) {
5236
5240
  final_method_data_1 = response;
5237
5241
  this.subscription = this.storesService.stores.subscribe(function (stores) {
5238
5242
  if (stores.length) {
@@ -5559,7 +5563,7 @@
5559
5563
  return (result_ordered.length ? result_ordered : null);
5560
5564
  };
5561
5565
  this.getBlockByCode = function (code) {
5562
- return _this.blocksSubject.value && _this.blocksSubject.value.find(function (block) { return block.code == code; });
5566
+ return _this.blocksSubject.value && _this.blocksSubject.value.find(function (block) { return block.code.includes(code); });
5563
5567
  };
5564
5568
  // getBannerImage = (banner) => (this.consts.mobile() && banner.mobileImageName && banner.mobileImageName != '') ? banner.mobileImageName : banner.imageName;
5565
5569
  this.getBannerImage = function (banner) {
@@ -7036,6 +7040,7 @@
7036
7040
  var _this = this;
7037
7041
  window.scroll(0, 0);
7038
7042
  this.cartService.promotions.subscribe(function (promotions) { return _this.promotions = promotions; });
7043
+ // console.log(this.cartService.getTaxes());
7039
7044
  this.ecOnInit();
7040
7045
  };
7041
7046
  CartEcComponent.prototype.openModal = function (template) {
@@ -7155,6 +7160,7 @@
7155
7160
  }
7156
7161
  if (item.quantity >= cantidadLotes) {
7157
7162
  // console.log(cantidadLotes);
7163
+ var y = 0;
7158
7164
  for (var index = 1; index < id; index++) {
7159
7165
  var lotID = '';
7160
7166
  if (document.getElementById("id" + index)) {
@@ -7173,18 +7179,19 @@
7173
7179
  }
7174
7180
  if (lotID == 'Pendt.') {
7175
7181
  // console.log('nuevo');
7176
- this_.cartService.addToLot(item.product, 0, item.variant_id, 0, item.item_id, quantity, item.product.price, item.quantity, item.discount, item.product.price * quantity, 'new', deliveryDate, notes, parseInt(shippingAddress), shippingAddressName, 'newlot');
7182
+ setTimeout(function () { this_.cartService.addToLot(item.product, 0, item.variant_id, 0, item.item_id, quantity, item.product.price, item.quantity, item.discount, item.product.price * quantity, 'new', deliveryDate, notes, parseInt(shippingAddress), shippingAddressName, 'newlot'); }, 300 * index);
7177
7183
  }
7178
7184
  else if (lotID != '') {
7179
7185
  // console.log('editar');
7180
- this_.cartService.addToLot(item.product, 0, item.variant_id, parseInt(lotID), item.item_id, quantity, item.product.price, item.quantity, item.discount, item.product.price * quantity, 'edited', deliveryDate, notes, parseInt(shippingAddress), shippingAddressName, 'editlot');
7186
+ setTimeout(function () { this_.cartService.addToLot(item.product, 0, item.variant_id, parseInt(lotID), item.item_id, quantity, item.product.price, item.quantity, item.discount, item.product.price * quantity, 'edited', deliveryDate, notes, parseInt(shippingAddress), shippingAddressName, 'editlot'); }, 300 * index);
7181
7187
  }
7188
+ y = index;
7182
7189
  }
7183
7190
  allID.forEach(function (element) {
7184
7191
  // console.log('borrar');
7185
7192
  this_.cartService.addToLot(item.product, 0, item.variant_id, element, 0, 0, 0, 0, 0, 0, 'delete', 0, '', 0, 'delete', 'deletelot');
7186
7193
  });
7187
- setTimeout(function () { this_.cartService.loadCartByToken(this_.cartService.getCartToken()); }, 1000);
7194
+ setTimeout(function () { this_.cartService.loadCartByToken(this_.cartService.getCartToken()); }, 500 * y);
7188
7195
  this_.toastrService.show('lot-saved');
7189
7196
  }
7190
7197
  else {
@@ -8249,7 +8256,7 @@
8249
8256
  ShipmentEcComponent = __decorate$S([
8250
8257
  core.Component({
8251
8258
  selector: 'app-shipment-ec',
8252
- template: "<!-- <div class=\"checkout-title\">\n <h3>{{'shipment-methods'|translate}}</h3>\n</div> -->\n\n<div class=\"container-fluid\">\n <div class=\"col-12\">\n <div class=\"card text-center\">\n <div class=\"card-header text-dark\">\n <h4>{{ 'select-method' | translate }}</h4>\n <div class=\"btn-toolbar justify-content-center\" role=\"toolbar\" aria-label=\"Envios toolbar\"\n *ngIf=\"(shipmentService.methods | async) as methods; else noMethods\">\n <div class=\"\" role=\"group\" aria-label=\"Grupo botones envio\">\n <div class=\"d-flex align-content-start justify-content-center flex-wrap\">\n <button type=\"button\" class=\"btn btn-outline-secondary mx-1 mb-1\"\n *ngFor=\"let method of deleteUPS(methods); let x = index\"\n (click)=\"setMethod(method, post_code); setActive($event)\">\n {{ method.name | translate }}\n </button>\n </div>\n\n\n </div>\n </div>\n </div>\n <div class=\"card-body\">\n <div class=\"row justify-content-center mb-2\" *ngIf=\"moreInfoInMethod && methodSelect && methodSelect.description\">\n <div class=\"col-12 col-md-6 col-lg-4 d-flex flex-column mb-2\" [id]=\"methodSelect.code\">\n <ng-container *ngFor=\"let line of methodSelect.description.split('\\r\\n'); let i=index\">\n <span [id]=\"methodSelect.code+'-'+i\" [class]=\"'line-'+i\">{{line}}</span>\n </ng-container>\n </div>\n <!--<span> <b>{{ 'information' | translate }}:</b> {{methodSelect.description}} </span>-->\n </div>\n <div class=\"row justify-content-center\" *ngIf=\"this.costs\">\n <ng-container *ngIf=\"!loading_internal ; else loading\">\n <div class=\"col-auto text-dark\" *ngFor=\"let cost of costs\">\n <ng-container *ngIf=\"cost.contracts.length > 0\">\n <span><b>{{ toTraducible(cost.name) | translate }}</b></span>\n <hr />\n <div class=\"option\" *ngFor=\"let contract of cost.contracts; let i = index\">\n <div class=\"form-check current-contract\">\n <input class=\"form-check-input\" [checked]=\"(cost.name == 'home_delivery') ? 'shipment-contractname home_delivery' : contract.selected \" type=\"radio\" name=\"card\" [id]=\"cost.name + i\"\n value=\"dark\" (click)=\"verifyValidate(cost.name, contract)\">\n <label class=\"form-check-label\" [for]=\"cost.name + i\" aria-label=\"Dark grey\">\n <span\n [class]=\"(cost.name == 'home_delivery') ? 'shipment-contractname home_delivery' : 'shipment-contractname' \"\n *ngIf=\"validName(contract.name)\">{{ contract.name | translate }}</span>\n <span *ngIf=\"contract.computed\"><br class=\"shipment-contractname\">{{ contract.computed | translate }}<br\n class=\"shipment-contractname\"></span>\n <div *ngIf=\"contract.detail\" class=\"contract-detail\">\n <div *ngFor=\"let line of contract.detail.split(' - '); let i = index\" [class]=\"'contrat-item-'+i\">\n <span *ngIf=\"i == 0\"><b>{{ line }}</b></span>\n <span class=\"inside-detail\" *ngIf=\"i > 0\">{{ line }}</span>\n </div>\n </div>\n <span *ngIf=\"contract.price > 0\" [class]=\"'inside-detail ' + ( costos?.amount == 0 ? ' free ' : '') \">\n <br class=\"shipment-contractname\" *ngIf=\"!contract.computed\">\n {{ ('price'|translate) + ': ' + (contract.price | ecCurrencySymbol) }}</span>\n <!-- <span *ngIf=\"contract.price == 0\" [class]=\"'inside-detail ' + ( costos?.amount == 0 ? ' free ' : '') \">\n <br class=\"shipment-contractname\" *ngIf=\"!contract.computed\"> {{ ('free'|translate) }}</span> -->\n <br>\n </label>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<ng-template #noMethods>\n <div class=\"d-flex flex-row w-100 justify-content-center mt-2\">\n <h5 class=\"text-secondary\">{{'no-shipment-methods'|translate}}</h5>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <app-loading-full-ec></app-loading-full-ec>\n</ng-template>\n",
8259
+ template: "<!-- <div class=\"checkout-title\">\n <h3>{{'shipment-methods'|translate}}</h3>\n</div> -->\n\n<div class=\"container-fluid\">\n <div class=\"col-12\">\n <div class=\"card text-center\">\n <div class=\"card-header text-dark\">\n <h4>{{ 'select-method' | translate }}</h4>\n <div class=\"btn-toolbar justify-content-center\" role=\"toolbar\" aria-label=\"Envios toolbar\"\n *ngIf=\"(shipmentService.methods | async) as methods; else noMethods\">\n <div class=\"\" role=\"group\" aria-label=\"Grupo botones envio\">\n <div class=\"d-flex align-content-start justify-content-center flex-wrap\">\n <button type=\"button\" class=\"btn btn-outline-secondary mx-1 mb-1\"\n *ngFor=\"let method of deleteUPS(methods); let x = index\"\n (click)=\"setMethod(method, post_code); setActive($event)\">\n {{ method.name | translate }}\n </button>\n </div>\n\n\n </div>\n </div>\n </div>\n <div class=\"card-body\">\n <div class=\"row justify-content-center mb-2\" *ngIf=\"moreInfoInMethod && methodSelect && methodSelect.description\">\n <div class=\"col-12 col-md-6 col-lg-4 d-flex flex-column mb-2\" [id]=\"methodSelect.code\">\n <ng-container *ngFor=\"let line of methodSelect.description.split('\\r\\n'); let i=index\">\n <span [id]=\"methodSelect.code+'-'+i\" [class]=\"'line-'+i\">{{line}}</span>\n </ng-container>\n </div>\n <!--<span> <b>{{ 'information' | translate }}:</b> {{methodSelect.description}} </span>-->\n </div>\n <div class=\"row justify-content-center\" *ngIf=\"this.costs\">\n <ng-container *ngIf=\"!loading_internal ; else loading\">\n <div class=\"col-auto text-dark\" *ngFor=\"let cost of costs\">\n <ng-container *ngIf=\"cost.contracts.length > 0\">\n <span><b>{{ methodSelect.name | translate}}</b></span>\n <hr />\n <div class=\"option\" *ngFor=\"let contract of cost.contracts; let i = index\">\n <div class=\"form-check current-contract\">\n <input class=\"form-check-input\" [checked]=\"(cost.name == 'home_delivery') ? 'shipment-contractname home_delivery' : contract.selected \" type=\"radio\" name=\"card\" [id]=\"cost.name + i\"\n value=\"dark\" (click)=\"verifyValidate(cost.name, contract)\">\n <label class=\"form-check-label\" [for]=\"cost.name + i\" aria-label=\"Dark grey\">\n <span\n [class]=\"(cost.name == 'home_delivery') ? 'shipment-contractname home_delivery' : 'shipment-contractname' \"\n *ngIf=\"validName(contract.name)\">{{ contract.name | translate }}</span>\n <span *ngIf=\"contract.computed\"><br class=\"shipment-contractname\">{{ contract.computed | translate }}<br\n class=\"shipment-contractname\"></span>\n <div *ngIf=\"contract.detail\" class=\"contract-detail\">\n <div *ngFor=\"let line of contract.detail.split(' - '); let i = index\" [class]=\"'contrat-item-'+i\">\n <span *ngIf=\"i == 0\"><b>{{ line }}</b></span>\n <span class=\"inside-detail\" *ngIf=\"i > 0\">{{ line }}</span>\n </div>\n </div>\n <span *ngIf=\"contract.price > 0\" [class]=\"'inside-detail ' + ( costos?.amount == 0 ? ' free ' : '') \">\n <br class=\"shipment-contractname\" *ngIf=\"!contract.computed\">\n {{ ('price'|translate) + ': ' + (contract.price | ecCurrencySymbol) }}</span>\n <!-- <span *ngIf=\"contract.price == 0\" [class]=\"'inside-detail ' + ( costos?.amount == 0 ? ' free ' : '') \">\n <br class=\"shipment-contractname\" *ngIf=\"!contract.computed\"> {{ ('free'|translate) }}</span> -->\n <br>\n </label>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<ng-template #noMethods>\n <div class=\"d-flex flex-row w-100 justify-content-center mt-2\">\n <h5 class=\"text-secondary\">{{'no-shipment-methods'|translate}}</h5>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <app-loading-full-ec></app-loading-full-ec>\n</ng-template>\n",
8253
8260
  providers: [ShipmentService],
8254
8261
  styles: [".shipment-container{width:100%;max-height:500px!important}.points-container{margin-top:10px;max-height:300px;overflow:scroll}agm-map{height:300px}.ancho-100{width:200px}.ancho-50{width:100px}.group-shipping{margin:10px 0}.option-container>div{margin-bottom:15px}@media only screen and (min-width:600px){.option-container{display:flex;justify-content:space-between;margin-top:20px}}hr{margin-top:0!important}.option{display:flex;align-items:flex-start;margin-bottom:20px}.option label{margin:0 0 0 10px}.inside-detail{color:gray!important;font-weight:400}.inside-detail.free{text-decoration:line-through}.active{color:#fff!important}"]
8255
8262
  })