@graphcommerce/magento-cart 8.1.0-canary.33 → 8.1.0-canary.34

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,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.1.0-canary.34
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2303](https://github.com/graphcommerce-org/graphcommerce/pull/2303) [`f407e96`](https://github.com/graphcommerce-org/graphcommerce/commit/f407e961868683a257c8f7fe8ceb588fb825db9b) - Get shippingMethodPrices from selected shipping method if supported on the magento version
8
+ ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
9
+
3
10
  ## 8.1.0-canary.33
4
11
 
5
12
  ## 8.1.0-canary.32
@@ -8,8 +8,14 @@ fragment CartTotals on Cart @inject(into: ["CartItemCountChanged", "PaymentMetho
8
8
  amount {
9
9
  ...Money
10
10
  }
11
+ price_excl_tax {
12
+ ...Money
13
+ }
14
+ price_incl_tax {
15
+ ...Money
16
+ }
11
17
  }
12
- # todo: https://github.com/magento/magento2/pull/31322
18
+ # todo: When 245 is not supported anymore, remove available_shipping_methods from fragment.
13
19
  available_shipping_methods {
14
20
  carrier_code
15
21
  method_code
@@ -42,12 +42,15 @@ export function CartTotals(props: CartTotalsProps) {
42
42
  const { shipping_addresses, prices } = data.cart
43
43
  const shippingMethod = shipping_addresses?.[0]?.selected_shipping_method
44
44
 
45
- const shippingMethodPrices = shipping_addresses?.[0]?.available_shipping_methods?.find(
46
- (avail) =>
47
- (shippingMethod?.amount?.value ?? 0) > 0 &&
48
- avail?.carrier_code === shippingMethod?.carrier_code &&
49
- avail?.method_code === shippingMethod?.method_code,
50
- )
45
+ const shippingMethodPrices =
46
+ import.meta.graphCommerce.magentoVersion >= 246
47
+ ? shippingMethod
48
+ : shipping_addresses?.[0]?.available_shipping_methods?.find(
49
+ (avail) =>
50
+ (shippingMethod?.amount?.value ?? 0) > 0 &&
51
+ avail?.carrier_code === shippingMethod?.carrier_code &&
52
+ avail?.method_code === shippingMethod?.method_code,
53
+ )
51
54
 
52
55
  return (
53
56
  <Box
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.1.0-canary.33",
5
+ "version": "8.1.0-canary.34",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,20 +12,20 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^8.1.0-canary.33",
16
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.33",
17
- "@graphcommerce/framer-next-pages": "^8.1.0-canary.33",
18
- "@graphcommerce/framer-scroller": "^8.1.0-canary.33",
19
- "@graphcommerce/framer-utils": "^8.1.0-canary.33",
20
- "@graphcommerce/graphql": "^8.1.0-canary.33",
21
- "@graphcommerce/image": "^8.1.0-canary.33",
22
- "@graphcommerce/magento-customer": "^8.1.0-canary.33",
23
- "@graphcommerce/magento-graphql": "^8.1.0-canary.33",
24
- "@graphcommerce/magento-store": "^8.1.0-canary.33",
25
- "@graphcommerce/next-ui": "^8.1.0-canary.33",
26
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.33",
27
- "@graphcommerce/react-hook-form": "^8.1.0-canary.33",
28
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.33",
15
+ "@graphcommerce/ecommerce-ui": "^8.1.0-canary.34",
16
+ "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.34",
17
+ "@graphcommerce/framer-next-pages": "^8.1.0-canary.34",
18
+ "@graphcommerce/framer-scroller": "^8.1.0-canary.34",
19
+ "@graphcommerce/framer-utils": "^8.1.0-canary.34",
20
+ "@graphcommerce/graphql": "^8.1.0-canary.34",
21
+ "@graphcommerce/image": "^8.1.0-canary.34",
22
+ "@graphcommerce/magento-customer": "^8.1.0-canary.34",
23
+ "@graphcommerce/magento-graphql": "^8.1.0-canary.34",
24
+ "@graphcommerce/magento-store": "^8.1.0-canary.34",
25
+ "@graphcommerce/next-ui": "^8.1.0-canary.34",
26
+ "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.34",
27
+ "@graphcommerce/react-hook-form": "^8.1.0-canary.34",
28
+ "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.34",
29
29
  "@lingui/core": "^4.2.1",
30
30
  "@lingui/macro": "^4.2.1",
31
31
  "@lingui/react": "^4.2.1",