simpo-component-library 2.0.18 → 2.0.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -82,6 +82,65 @@ export class CartService {
82
82
  clearCartItems() {
83
83
  this.storageService.clearUserCart();
84
84
  }
85
+ addItemToLocalCart(product, type) {
86
+ // if (this.isItemOutOfStock(product)) {
87
+ // // this.messageService.add({ severity: 'warn', summary: 'Cart', detail: 'Item is not available as of now. We will notify you once available' });
88
+ // return;
89
+ // }
90
+ if (!product?.quantity)
91
+ product.quantity = 0;
92
+ if (type == 'ADD') {
93
+ product.quantity += 1;
94
+ }
95
+ else {
96
+ product.quantity -= 1;
97
+ }
98
+ this.storageService.getUserCart().then((cartResponse) => {
99
+ cartResponse.onsuccess = (cartData) => {
100
+ const userCart = cartData.target.result ?? [];
101
+ let orderedItem = new OrderedItems();
102
+ if (product?.itemVariant?.length) {
103
+ const itemVarient = this.getItemVarient(product, product.varientId);
104
+ if (itemVarient) {
105
+ itemVarient.quantity = product.quantity;
106
+ orderedItem = this.objectMapper(product, itemVarient.variantId);
107
+ }
108
+ }
109
+ else {
110
+ orderedItem = this.objectMapper(product);
111
+ }
112
+ let productFound = false;
113
+ for (let localProduct of userCart) {
114
+ if (localProduct.varientId === product.varientId) {
115
+ localProduct.quantity = type === 'ADD' ? localProduct.quantity + 1 : localProduct.quantity - 1;
116
+ if (localProduct.quantity == 0) {
117
+ this.removeItemFromCart(localProduct);
118
+ }
119
+ else {
120
+ this.storageService.addProductToCart(localProduct);
121
+ }
122
+ productFound = true;
123
+ break;
124
+ }
125
+ }
126
+ if (!productFound) {
127
+ orderedItem.quantity = type === 'ADD' ? 1 : -1;
128
+ this.storageService.addProductToCart(orderedItem);
129
+ }
130
+ };
131
+ });
132
+ }
133
+ isItemOutOfStock(product) {
134
+ return product.itemInventory?.openingStock == 0;
135
+ }
136
+ getItemVarient(product, varientId) {
137
+ let selectedVarient = null;
138
+ product?.itemVariant?.forEach((varient) => {
139
+ if (varient.variantId == varientId)
140
+ selectedVarient = varient;
141
+ });
142
+ return selectedVarient;
143
+ }
85
144
  storeDataToServer() {
86
145
  // const userCart = UserCart as never as Cart;
87
146
  // const userWishlist = UserFavourites as never as Cart;
@@ -103,4 +162,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImpor
103
162
  providedIn: 'root',
104
163
  }]
105
164
  }], ctorParameters: () => [{ type: i1.StorageServiceService }, { type: i2.RestService }] });
106
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FydC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc2ltcG8tdWkvc3JjL2xpYi9zZXJ2aWNlcy9jYXJ0LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFnQixVQUFVLEVBQVUsTUFBTSxlQUFlLENBQUM7QUFDakUsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLHdDQUF3QyxDQUFDOzs7O0FBU3RFLE1BQU0sT0FBTyxXQUFXO0lBQ3RCLFlBQ21CLGNBQXFDLEVBQ3JDLFdBQXdCO1FBRHhCLG1CQUFjLEdBQWQsY0FBYyxDQUF1QjtRQUNyQyxnQkFBVyxHQUFYLFdBQVcsQ0FBYTtJQUUzQyxDQUFDO0lBR00sbUJBQW1CLENBQUMsT0FBcUIsRUFBRSxRQUFhO1FBQzdELElBQUksT0FBTyxDQUFDLFFBQVEsRUFBRSxDQUFDO1lBQ3JCLCtCQUErQjtZQUMvQiw4REFBOEQ7WUFDOUQsdUNBQXVDO1lBQ3ZDLHdCQUF3QjtZQUN4QixNQUFNO1lBQ04sSUFBSSxDQUFDLGNBQWMsQ0FBQyxnQkFBZ0IsQ0FBQyxPQUF1QixDQUFDLENBQUM7WUFDOUQsT0FBTyxJQUFJLENBQUMsV0FBVyxDQUFDLFdBQVcsQ0FBQyxRQUFRLENBQUMs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0.0", version: "18.1.4", ngImpor
291
291
  providedIn: 'root'
292
292
  }]
293
293
  }], ctorParameters: () => [{ type: i1.EventsService }, { type: i2.CookieService }, { type: i3.RestService }, { type: i4.Router }] });
294
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc2ltcG8tdWkvc3JjL2xpYi9zZXJ2aWNlcy9zdG9yYWdlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBVSxNQUFNLGVBQWUsQ0FBQztBQUtuRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBRWhDLE9BQU8sRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0NBQWtDLENBQUM7Ozs7OztBQU1sRSxNQUFNLE9BQU8scUJBQXFCO0lBRWhDLFlBQ21CLFlBQTJCLEVBQzNCLGFBQTRCLEVBQzVCLFdBQXdCLEVBQ2pDLE1BQWU7UUFITixpQkFBWSxHQUFaLFlBQVksQ0FBZTtRQUMzQixrQkFBYSxHQUFiLGFBQWEsQ0FBZTtRQUM1QixnQkFBVyxHQUFYLFdBQVcsQ0FBYTtRQUNqQyxXQUFNLEdBQU4sTUFBTSxDQUFTO1FBV2pCLG1CQUFjLEdBQVcsQ0FBQyxDQUFDO1FBUW5DLGlCQUFZLEdBQVcsTUFBTSxDQUFDO1FBQzlCLG9CQUFlLEdBQVcsQ0FBQyxDQUFDO1FBQzVCLHVCQUFrQixHQUFXLFdBQVcsQ0FBQztRQUN6Qyw0QkFBdUIsR0FBVyxnQkFBZ0IsQ0FBQztRQUNuRCx1QkFBa0IsR0FBVyxNQUFNLENBQUM7UUFHcEMsc0JBQWlCLEdBQTBCLElBQUksQ0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5xdWFudGl0eSArPSBsb2NhbFByb2R1Y3QucXVhbnRpdHk7XHJcbiAgICAgICAgICAgICAgICAgICAgcHJvZHVjdEZvdW5kID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCFwcm9kdWN0Rm91bmQpIHtcclxuICAgICAgICAgICAgICAgICAgc2VydmVyREJQcm9kdWN0LnB1c2gobG9jYWxQcm9kdWN0KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgIHJlc29sdmUoc2VydmVyREJQcm9kdWN0KTtcclxuICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKFwiRXJyb3IgaW4gQVBJIGNhbGw6XCIsIGVycm9yKTtcclxuICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICByZXNvbHZlKGluZGV4REJQcm9kdWN0KTtcclxuICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICB9KTtcclxuICAgIH0gY2F0Y2ggKGVycm9yKSB7XHJcbiAgICAgIGNvbnNvbGUuZXJyb3IoXCJFcnJvciByZXRyaWV2aW5nIGNhcnQ6XCIsIGVycm9yKTtcclxuICAgICAgdGhyb3cgZXJyb3I7XHJcbiAgICB9XHJcbiAgfVxyXG5cclxuXHJcbiAgYWRkUHJvZHVjdFRvQ2FydChwcm9kdWN0OiBPcmRlcmVkSXRlbXMpIHtcclxuXHJcbiAgICBjb25zdCB0cmFuc2FjdGlvbiA9IHRoaXMuZGF0YWJhc2UudHJhbnNhY3Rpb24odGhpcy5jYXJ0Q29sbGVjdGlvbk5hbWUsIFwicmVhZHdyaXRlXCIpO1xyXG4gICAgY29uc3QgcmVzcG9uc2UgPSB0c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YXJ0SWQnLCByZXNwb25zZS5kYXRhPy5bMF0/LmNhcnRJZCk7XHJcblxyXG4gICAgICAgICAgICAgIGNvbnN0IHNlcnZlckRCUHJvZHVjdCA9IHJlc3BvbnNlPy5kYXRhPy5bMF0/Lm9yZGVyZWRJdGVtcyA/PyBbXTtcclxuXHJcbiAgICAgICAgICAgICAgZm9yIChsZXQgbG9jYWxQcm9kdWN0IG9mIGluZGV4REJQcm9kdWN0KSB7XHJcbiAgICAgICAgICAgICAgICBsZXQgcHJvZHVjdEZvdW5kID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBzZXJ2ZXJQcm9kdWN0IG9mIHNlcnZlckRCUHJvZHVjdCkge1xyXG4gICAgICAgICAgICAgICAgICBpZiAoc2VydmVyUHJvZHVjdC52YXJpZW50SWQgPT09IGxvY2FsUHJvZHVjdC52YXJpZW50SWQpIHtcclxuICAgICAgICAgICAgICAgICAgICBzZXJ2ZXJQcm9kdWN0LnF1YW50aXR5ICs9IGxvY2FsUHJvZHVjdC5xdWFudGl0eTtcclxuICAgICAgICAgICAgICAgICAgICBwcm9kdWN0Rm91bmQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoIXByb2R1Y3RGb3VuZCkge1xyXG4gICAgICAgICAgICAgICAgICBzZXJ2ZXJEQlByb2R1Y3QucHVzaChsb2NhbFByb2R1Y3QpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgcmVzb2x2ZShzZXJ2ZXJEQlByb2R1Y3QpO1xyXG4gICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xyXG4gICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoXCJFcnJvciBpbiBBUEkgY2FsbDpcIiwgZXJyb3IpO1xyXG4gICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XHJc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b3JcIiwgcGF5bWVudEZvciwgNyk7XHJcbiAgfVxyXG5cclxuXHJcbiAgLy8gY2xlYXJBbGxJdGVtc0Zyb21DYXJ0KCkge1xyXG4gIC8vICAgcmV0dXJuIG5ldyBQcm9taXNlKGFzeW5jIChyZXNvbHZlLCByZWplY3QpID0+IHtcclxuICAvLyAgICAgaWYgKHRoaXMuZGF0YWJhc2UgIT0gdW5kZWZpbmVkKSB7XHJcbiAgLy8gICAgICAgY29uc3QgcmVxdWVzdCA9IGF3YWl0IHRoaXMuZGF0YWJhc2VcclxuICAvLyAgICAgICAgIC50cmFuc2FjdGlvbih0aGlzLm9iamVjdFN0b3JhZ2VOYW1lLCAncmVhZHdyaXRlJylcclxuICAvLyAgICAgICAgIC5vYmplY3RTdG9yZSh0aGlzLm9iamVjdFN0b3JhZ2VOYW1lKVxyXG4gIC8vICAgICAgICAgLmNsZWFyKCk7XHJcblxyXG4gIC8vICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gYXdhaXQgZnVuY3Rpb24gKGV2ZW50OiBhbnkpIHtcclxuXHJcbiAgLy8gICAgICAgICBpZiAoZXZlbnQudGFyZ2V0LnJlc3VsdCkge1xyXG4gIC8vICAgICAgICAgICByZXNvbHZlKGV2ZW50LnJlc3VsdCk7XHJcbiAgLy8gICAgICAgICB9IGVsc2Uge1xyXG4gIC8vICAgICAgICAgICByZXNvbHZlKCdTVUNDRVNTJyk7XHJcbiAgLy8gICAgICAgICB9XHJcbiAgLy8gICAgICAgfTtcclxuICAvLyAgICAgICByZXF1ZXN0Lm9uZXJyb3IgPSBhd2FpdCBmdW5jdGlvbiAoX2V2ZW50KSB7XHJcbiAgLy8gICAgICAgICByZWplY3QoXCJObyBkYXRhXCIpO1xyXG4gIC8vICAgICAgIH1cclxuICAvLyAgICAgfVxyXG4gIC8vICAgfSk7XHJcbiAgLy8gfVxyXG59XHJcbiJdfQ==
@@ -4666,6 +4666,65 @@ class CartService {
4666
4666
  clearCartItems() {
4667
4667
  this.storageService.clearUserCart();
4668
4668
  }
4669
+ addItemToLocalCart(product, type) {
4670
+ // if (this.isItemOutOfStock(product)) {
4671
+ // // this.messageService.add({ severity: 'warn', summary: 'Cart', detail: 'Item is not available as of now. We will notify you once available' });
4672
+ // return;
4673
+ // }
4674
+ if (!product?.quantity)
4675
+ product.quantity = 0;
4676
+ if (type == 'ADD') {
4677
+ product.quantity += 1;
4678
+ }
4679
+ else {
4680
+ product.quantity -= 1;
4681
+ }
4682
+ this.storageService.getUserCart().then((cartResponse) => {
4683
+ cartResponse.onsuccess = (cartData) => {
4684
+ const userCart = cartData.target.result ?? [];
4685
+ let orderedItem = new OrderedItems();
4686
+ if (product?.itemVariant?.length) {
4687
+ const itemVarient = this.getItemVarient(product, product.varientId);
4688
+ if (itemVarient) {
4689
+ itemVarient.quantity = product.quantity;
4690
+ orderedItem = this.objectMapper(product, itemVarient.variantId);
4691
+ }
4692
+ }
4693
+ else {
4694
+ orderedItem = this.objectMapper(product);
4695
+ }
4696
+ let productFound = false;
4697
+ for (let localProduct of userCart) {
4698
+ if (localProduct.varientId === product.varientId) {
4699
+ localProduct.quantity = type === 'ADD' ? localProduct.quantity + 1 : localProduct.quantity - 1;
4700
+ if (localProduct.quantity == 0) {
4701
+ this.removeItemFromCart(localProduct);
4702
+ }
4703
+ else {
4704
+ this.storageService.addProductToCart(localProduct);
4705
+ }
4706
+ productFound = true;
4707
+ break;
4708
+ }
4709
+ }
4710
+ if (!productFound) {
4711
+ orderedItem.quantity = type === 'ADD' ? 1 : -1;
4712
+ this.storageService.addProductToCart(orderedItem);
4713
+ }
4714
+ };
4715
+ });
4716
+ }
4717
+ isItemOutOfStock(product) {
4718
+ return product.itemInventory?.openingStock == 0;
4719
+ }
4720
+ getItemVarient(product, varientId) {
4721
+ let selectedVarient = null;
4722
+ product?.itemVariant?.forEach((varient) => {
4723
+ if (varient.variantId == varientId)
4724
+ selectedVarient = varient;
4725
+ });
4726
+ return selectedVarient;
4727
+ }
4669
4728
  storeDataToServer() {
4670
4729
  // const userCart = UserCart as never as Cart;
4671
4730
  // const userWishlist = UserFavourites as never as Cart;
@@ -4839,7 +4898,7 @@ class CartComponent extends BaseSection {
4839
4898
  });
4840
4899
  }
4841
4900
  updateUserCartV2() {
4842
- this.storageService.getUserCart().then((products) => {
4901
+ this.storageService.getCartProduct().then((products) => {
4843
4902
  const deliveryOption = JSON.parse(localStorage.getItem("deliveryOptions") ?? "{}");
4844
4903
  this.cartInfo.orderedItems = products;
4845
4904
  if (!this.cartInfo?.cartId && !(localStorage.getItem("cartId") == "undefined" || localStorage.getItem("cartId") == "null")) {
@@ -4861,6 +4920,7 @@ class CartComponent extends BaseSection {
4861
4920
  const restResponse = this.restService.addItemToDB(this.cartInfo).toPromise();
4862
4921
  restResponse.then((cartResponse) => {
4863
4922
  this.cartInfo = cartResponse.data;
4923
+ this.storageService.clearUserCart();
4864
4924
  });
4865
4925
  }
4866
4926
  else {
@@ -5391,7 +5451,7 @@ class NavbarSectionComponent {
5391
5451
  this.showEditors = false;
5392
5452
  this.showSearchBar = false;
5393
5453
  this.getScreenSize();
5394
- this.storageService.updateAllData();
5454
+ // this.storageService.updateAllData();
5395
5455
  }
5396
5456
  searchProducts() {
5397
5457
  this.router.navigate(['/list'], { queryParams: { searchTxt: this.searchText } });
@@ -7717,29 +7777,50 @@ class FeaturedProductsComponent extends BaseSection {
7717
7777
  this.apiLoading = true;
7718
7778
  this.restService.getFeaturedProduct(this.content?.collectionId).subscribe((response) => {
7719
7779
  this.responseData = response;
7720
- this.storageService.getUserCart().then((cartResponse) => {
7721
- cartResponse.onsuccess = (cartData) => {
7722
- this.apiLoading = false;
7723
- this.USER_CART = cartData.target.result;
7724
- this.responseData?.forEach((product) => {
7725
- this.USER_CART?.forEach((item) => {
7726
- if (item.itemId == product.itemId) {
7727
- if (product?.itemVariant?.length > 0) {
7728
- const itemVarient = product?.itemVariant?.[0];
7729
- if (itemVarient.variantId == item.varientId) {
7730
- product.itemImages = itemVarient.variantImages ?? [];
7731
- product.price = itemVarient.itemVariantPrice;
7732
- product.quantity = item.quantity;
7733
- }
7734
- }
7735
- else {
7780
+ // this.storageService.getUserCart().then((cartResponse) => {
7781
+ // cartResponse.onsuccess = (cartData: any) => {
7782
+ // this.apiLoading = false;
7783
+ // this.USER_CART = cartData.target.result as unknown as OrderedItems[];
7784
+ // this.responseData?.forEach((product: Product) => {
7785
+ // this.USER_CART?.forEach((item: OrderedItems) => {
7786
+ // if (item.itemId == product.itemId) {
7787
+ // if (product?.itemVariant?.length > 0) {
7788
+ // const itemVarient: ItemVariant = product?.itemVariant?.[0];
7789
+ // if (itemVarient.variantId == item.varientId) {
7790
+ // product.itemImages = itemVarient.variantImages ?? [];
7791
+ // product.price = itemVarient.itemVariantPrice;
7792
+ // product.quantity = item.quantity;
7793
+ // }
7794
+ // } else {
7795
+ // product.quantity = item.quantity;
7796
+ // }
7797
+ // }
7798
+ // })
7799
+ // })
7800
+ // }
7801
+ // },(err) => {
7802
+ // this.apiLoading = false;
7803
+ // })
7804
+ this.storageService.getCartProduct().then((products) => {
7805
+ this.apiLoading = false;
7806
+ this.responseData?.forEach((product) => {
7807
+ products?.forEach((item) => {
7808
+ if (item.itemId == product.itemId) {
7809
+ if (product?.itemVariant?.length > 0) {
7810
+ const itemVarient = product?.itemVariant?.[0];
7811
+ if (itemVarient.variantId == item.varientId) {
7812
+ product.itemImages = itemVarient.variantImages ?? [];
7813
+ product.price = itemVarient.itemVariantPrice;
7736
7814
  product.quantity = item.quantity;
7737
7815
  }
7738
7816
  }
7739
- });
7817
+ else {
7818
+ product.quantity = item.quantity;
7819
+ }
7820
+ }
7740
7821
  });
7741
- };
7742
- }, (err) => {
7822
+ });
7823
+ }).catch(err => {
7743
7824
  this.apiLoading = false;
7744
7825
  });
7745
7826
  this.storageService.getUserWhishlist().then((wishlistResponse) => {
@@ -7771,39 +7852,44 @@ class FeaturedProductsComponent extends BaseSection {
7771
7852
  this.messageService.add({ severity: 'warn', summary: 'Cart', detail: 'Item is not available as of now. We will notify you once available' });
7772
7853
  return;
7773
7854
  }
7774
- if (!product?.quantity)
7775
- product.quantity = 0;
7776
- if (type == 'ADD') {
7777
- product.quantity += 1;
7778
- }
7779
- else {
7780
- product.quantity -= 1;
7781
- }
7782
- if (product?.itemVariant?.length) {
7783
- const itemVarient = this.getItemVarient(product, product.varientId);
7784
- if (itemVarient) {
7785
- itemVarient.quantity = product.quantity;
7786
- this.cartService.addItemToCart(product, itemVarient.variantId);
7787
- }
7788
- }
7789
- else {
7790
- this.cartService.addItemToCart(product);
7791
- }
7792
- if (product.quantity) {
7793
- let isPresent = false;
7794
- this.USER_CART?.forEach((item) => {
7795
- if (item.varientId == product.varientId) {
7796
- item.quantity = product.quantity;
7797
- isPresent = true;
7798
- }
7799
- });
7800
- if (!isPresent)
7801
- this.USER_CART?.push(new OrderedItems(product, product.varientId));
7802
- }
7803
- else {
7804
- this.USER_CART = this.USER_CART?.filter((item) => item.varientId != product.varientId) ?? [];
7805
- }
7855
+ this.cartService.addItemToLocalCart(product, type);
7806
7856
  }
7857
+ // addItemToCart(product: Product, type: 'ADD' | 'SUBSTRACT') {
7858
+ // if (this.isItemOutOfStock(product)) {
7859
+ // this.messageService.add({ severity: 'warn', summary: 'Cart', detail: 'Item is not available as of now. We will notify you once available' });
7860
+ // return;
7861
+ // }
7862
+ // if (!product?.quantity)
7863
+ // product.quantity = 0;
7864
+ // if (type == 'ADD') {
7865
+ // product.quantity += 1;
7866
+ // }
7867
+ // else {
7868
+ // product.quantity -= 1;
7869
+ // }
7870
+ // if (product?.itemVariant?.length) {
7871
+ // const itemVarient: ItemVariant | null = this.getItemVarient(product, product.varientId);
7872
+ // if (itemVarient) {
7873
+ // itemVarient.quantity = product.quantity;
7874
+ // this.cartService.addItemToCart(product, itemVarient.variantId);
7875
+ // }
7876
+ // } else {
7877
+ // this.cartService.addItemToCart(product);
7878
+ // }
7879
+ // if (product.quantity) {
7880
+ // let isPresent: boolean = false;
7881
+ // this.USER_CART?.forEach((item: OrderedItems) => {
7882
+ // if (item.varientId == product.varientId) {
7883
+ // item.quantity = product.quantity;
7884
+ // isPresent = true;
7885
+ // }
7886
+ // })
7887
+ // if (!isPresent)
7888
+ // this.USER_CART?.push(new OrderedItems(product, product.varientId));
7889
+ // } else {
7890
+ // this.USER_CART = this.USER_CART?.filter((item: OrderedItems) => item.varientId != product.varientId) ?? [];
7891
+ // }
7892
+ // }
7807
7893
  toggleItemToFav(event, product, type) {
7808
7894
  if (type == 'ADD') {
7809
7895
  product.whislist = true;