@nuskin/product-components 3.0.4 → 3.0.5

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.0.5](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.0.4...v3.0.5) (2022-04-21)
2
+
3
+
4
+ ### Fix
5
+
6
+ * Stop qualifications getting messed up and allow variants(#CX15-4531) ([a94c742](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/a94c742c37f77afa3ae397926a3f5ab5661e3af2)), closes [#CX15-4531](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX15-4531)
7
+
1
8
  ## [3.0.4](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.0.3...v3.0.4) (2022-04-20)
2
9
 
3
10
 
@@ -578,10 +578,25 @@ const NsProductMixin = {
578
578
  const productQualification = await QualificationService.getQualification(
579
579
  this.activeSku
580
580
  );
581
- const cartItem = await CartService.getFirstItemBySku(this.activeSku, {
582
- cartOrderItems: true
583
- });
584
- const cartQuantity = (cartItem || {}).qty || 0;
581
+
582
+ let cartQuantity;
583
+ if (!this.baseSku) {
584
+ const cartItem = await CartService.getFirstItemBySku(
585
+ this.activeSku,
586
+ {
587
+ cartOrderItems: true
588
+ }
589
+ );
590
+ cartQuantity = (cartItem || {}).qty || 0;
591
+ } else {
592
+ const cartData =
593
+ (await QualificationService.convertCartDataToBaseSkus(
594
+ CartService.getItemData(),
595
+ true
596
+ )) || {};
597
+ const cartItem = cartData[this.baseSku] || {};
598
+ cartQuantity = cartItem.qty || 0;
599
+ }
585
600
 
586
601
  if (!productQualification) {
587
602
  // the event has never been set up or is in the past (post-event/qualification not configured)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/product-components",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "Nu Skin Product Components",
5
5
  "main": "index.js",
6
6
  "scripts": {