fix(composables): add shipping costs #1580
Open
+96
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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