-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix(composables): add shipping costs #1580
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@shopware/api-client
@shopware-pwa/cms-base
@shopware-pwa/helpers-next
@shopware/api-gen
@shopware-pwa/nuxt3-module
@shopware-pwa/composables-next
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one thing to clarify deprecation
@@ -66,8 +66,14 @@ export type UseCartReturn = { | |||
totalPrice: ComputedRef<number>; | |||
/** | |||
* Shipping price | |||
* | |||
* @deprecated Use `shippingTotal` instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this is in the wrong line? You say to use the thing which becomes deprecated ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ups :D fixed
.changeset/calm-ligers-give.md
Outdated
"@shopware-pwa/composables-next": patch | ||
--- | ||
|
||
Added `shippingCosts` property in `useCart` composable that returns shipping costs of the cart, with the shipping discounts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no info about the deprecation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Description
This pull request fixes display shipping costs in the cart and checkout components. The changes include adding a
shippingCosts
property to theuseCart
composable, updating the cart and checkout components to display this information, and adding corresponding tests and translations.Feature Implementation:
packages/composables/src/useCart/useCart.ts
: AddedshippingCosts
property toUseCartReturn
type and implemented the logic to compute shipping costs. [1] [2] [3]packages/composables/src/useCart/useCart.test.ts
: Added tests to verify theshippingCosts
property returns correct values.Component Updates:
templates/vue-demo-store/pages/checkout/cart.vue
: Updated to useshippingCosts
and display each shipping cost in the cart view. [1] [2]templates/vue-demo-store/pages/checkout/index.vue
: Updated to useshippingCosts
and display each shipping cost in the checkout view. [1] [2] [3]Translations:
templates/vue-demo-store/i18n/de-DE/cart.json
: Added translation for "shipping costs."templates/vue-demo-store/i18n/en-GB/cart.json
: Added translation for "shipping costs."templates/vue-demo-store/i18n/pl-PL/cart.json
: Added translation for "shipping costs."closes #1576