Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UST-1217): UDM enhancements 3 #1492

Merged
merged 4 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .changeset/dull-llamas-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
"@vue-storefront/magento-api": patch
"@vue-storefront/magento-types": patch
---

**[CHANGED]** Enhanced default GQL queries with new fields

- [`CartQuery`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/CartQuery)
- [`CustomerCartQuery`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/CustomerCartQuery)
- [`ApplyCouponToCartMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/ApplyCouponToCartMutation)
- [`RemoveCouponFromCartMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/RemoveCouponFromCartMutation)
- [`AddProductsToCartMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/AddProductsToCartMutation)
- [`RemoveItemFromCartMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/RemoveItemFromCartMutation)
- [`SetShippingMethodsOnCartMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/SetShippingMethodsOnCartMutation)
- [`MergeCartsMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/MergeCartsMutation)

with new fields:

- `prices`
- `subtotal_with_discount_excluding_tax`
- `configured_variant`
- `sku`
- `name`
- `only_x_left_in_stock`
- `price_range`
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,35 @@ export default gql`
code
}
prices {
subtotal_with_discount_excluding_tax {
value
currency
}
subtotal_excluding_tax {
value
currency
}
subtotal_including_tax {
value
currency
}
applied_taxes {
amount {
value
currency
}
label
}
discounts {
amount {
value
currency
}
label
}
grand_total {
value
currency
}
}
items {
Expand Down Expand Up @@ -80,6 +89,8 @@ export default gql`
name
url_suffix
url_path
url_key
include_in_menu
breadcrumbs {
category_name
category_url_path
Expand All @@ -99,12 +110,15 @@ export default gql`
prices {
row_total {
value
currency
}
row_total_including_tax {
value
currency
}
total_item_discount {
value
currency
}
}
quantity
Expand All @@ -117,6 +131,20 @@ export default gql`
}
configured_variant {
sku
name
only_x_left_in_stock
price_range {
minimum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
thumbnail {
url
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,35 @@ export default gql`
code
}
prices {
subtotal_with_discount_excluding_tax {
value
currency
}
subtotal_excluding_tax {
value
currency
}
subtotal_including_tax {
value
currency
}
applied_taxes {
amount {
value
currency
}
label
}
discounts {
amount {
value
currency
}
label
}
grand_total {
value
currency
}
}
items {
Expand Down Expand Up @@ -81,6 +90,8 @@ export default gql`
name
url_suffix
url_path
url_key
include_in_menu
breadcrumbs {
category_name
category_url_path
Expand All @@ -100,12 +111,15 @@ export default gql`
prices {
row_total {
value
currency
}
row_total_including_tax {
value
currency
}
total_item_discount {
value
currency
}
}
quantity
Expand All @@ -118,6 +132,20 @@ export default gql`
}
configured_variant {
sku
name
only_x_left_in_stock
price_range {
minimum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
thumbnail {
url
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,35 @@ export default gql`
code
}
prices {
subtotal_with_discount_excluding_tax {
value
currency
}
subtotal_excluding_tax {
value
currency
}
subtotal_including_tax {
value
currency
}
applied_taxes {
amount {
value
currency
}
label
}
discounts {
amount {
value
currency
}
label
}
grand_total {
value
currency
}
}
items {
Expand Down Expand Up @@ -81,6 +90,8 @@ export default gql`
name
url_suffix
url_path
url_key
include_in_menu
breadcrumbs {
category_name
category_url_path
Expand All @@ -100,12 +111,15 @@ export default gql`
prices {
row_total {
value
currency
}
row_total_including_tax {
value
currency
}
total_item_discount {
value
currency
}
}
quantity
Expand All @@ -118,6 +132,20 @@ export default gql`
}
configured_variant {
sku
name
only_x_left_in_stock
price_range {
minimum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
thumbnail {
url
}
Expand Down
38 changes: 33 additions & 5 deletions packages/api-client/src/api/addProductsToCart/addProductsToCart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,35 @@ export default `
code
}
prices {
subtotal_with_discount_excluding_tax {
value
currency
}
subtotal_excluding_tax {
value
},
currency
}
subtotal_including_tax {
value
},
currency
}
applied_taxes {
amount {
value
},
currency
}
label
}
discounts {
amount {
value
},
currency
}
label
}
grand_total {
value
currency
}
}
items {
Expand Down Expand Up @@ -79,8 +88,10 @@ export default `
name
url_suffix
url_path
url_key
include_in_menu
breadcrumbs {
category_name,
category_name
category_url_path
}
}
Expand All @@ -98,12 +109,15 @@ export default `
prices {
row_total {
value
currency
}
row_total_including_tax {
value
currency
}
total_item_discount {
value
currency
}
}
quantity
Expand All @@ -116,6 +130,20 @@ export default `
}
configured_variant {
sku
name
only_x_left_in_stock
price_range {
minimum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
thumbnail {
url
}
Expand Down
Loading
Loading