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

fix(default-theme): added shipping cost to order summary #1357

Merged
merged 3 commits into from
Feb 9, 2021

Conversation

elkmod
Copy link
Collaborator

@elkmod elkmod commented Feb 9, 2021

Changes

Shipping costs weren't correctly displayed in order summary.

@elkmod elkmod changed the title Added shipping cost to order summary fix(default-theme): added shipping cost to order summary Feb 9, 2021
@@ -153,6 +154,11 @@ export const useCart = (rootContext: ApplicationVueContext): IUseCart => {
return cartPrice || 0;
});

const shippingTotal = computed(() => {
const shippingTotal = cart?.value?.deliveries[0]?.shippingCosts?.totalPrice;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is optional chaining allowed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely you can, in composables the optional chaining is supported. in this case you can even use ....deliveries?.[0]? for arrays 👍

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining#array_item_access_with_optional_chaining

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, cool!

Copy link
Collaborator

@mkucmus mkucmus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great 🥇

@elkmod elkmod removed the request for review from niklaswolf February 9, 2021 20:48
@github-actions
Copy link

github-actions bot commented Feb 9, 2021

💙 shopware-pwa-canary successfully deployed at https://b7e3d9d21f705c2f9dee5e14ae051febc44c80f5.shopware-pwa-canary.preview.storefrontcloud.io

@mkucmus mkucmus merged commit 927a3b2 into master Feb 9, 2021
@mkucmus mkucmus deleted the fix/show-shipping-cost-checkout-summary branch February 9, 2021 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants