graphcommerce icon indicating copy to clipboard operation
graphcommerce copied to clipboard

Fix issue where the discount value displayed in the cart gets the tax subtracted twice when displaying prices excluding tax.

Open SimonPrins opened this issue 2 years ago • 8 comments

… subtracted twice when displaying prices excluding tax.

SimonPrins avatar Mar 01 '23 07:03 SimonPrins

🦋 Changeset detected

Latest commit: 13ba96a673ced9f798626926baa92a31c1c9d437

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 66 packages
Name Type
@graphcommerce/magento-cart Patch
@graphcommerce/googleanalytics Patch
@graphcommerce/magento-cart-billing-address Patch
@graphcommerce/magento-cart-checkout Patch
@graphcommerce/magento-cart-coupon Patch
@graphcommerce/magento-cart-email Patch
@graphcommerce/magento-cart-items Patch
@graphcommerce/magento-cart-payment-method Patch
@graphcommerce/magento-cart-shipping-address Patch
@graphcommerce/magento-cart-shipping-method Patch
@graphcommerce/magento-newsletter Patch
@graphcommerce/magento-payment-adyen Patch
@graphcommerce/magento-payment-braintree Patch
@graphcommerce/magento-payment-included Patch
@graphcommerce/magento-payment-klarna Patch
@graphcommerce/magento-payment-multisafepay Patch
@graphcommerce/magento-payment-paypal Patch
@graphcommerce/magento-product-bundle Patch
@graphcommerce/magento-product-configurable Patch
@graphcommerce/magento-product-downloadable Patch
@graphcommerce/magento-product-grouped Patch
@graphcommerce/magento-product-simple Patch
@graphcommerce/magento-product-virtual Patch
@graphcommerce/magento-product Patch
@graphcommerce/magento-wishlist Patch
@graphcommerce/mollie-magento-payment Patch
@graphcommerce/magento-graphcms Patch
@graphcommerce/magento-cart-pickup Patch
@graphcommerce/demo-magento-graphcommerce Patch
@graphcommerce/googletagmanager Patch
@graphcommerce/magento-category Patch
@graphcommerce/magento-pagebuilder Patch
@graphcommerce/magento-review Patch
@graphcommerce/docs Patch
@graphcommerce/browserslist-config-pwa Patch
@graphcommerce/changeset-changelog Patch
@graphcommerce/eslint-config-pwa Patch
@graphcommerce/graphql-codegen-near-operation-file Patch
@graphcommerce/graphql-codegen-relay-optimizer-plugin Patch
@graphcommerce/next-config Patch
@graphcommerce/prettier-config-pwa Patch
@graphcommerce/typescript-config-pwa Patch
@graphcommerce/cli Patch
@graphcommerce/ecommerce-ui Patch
@graphcommerce/framer-next-pages Patch
@graphcommerce/framer-scroller Patch
@graphcommerce/framer-utils Patch
@graphcommerce/googlerecaptcha Patch
@graphcommerce/graphcms-ui Patch
@graphcommerce/graphql-mesh Patch
@graphcommerce/graphql Patch
@graphcommerce/image Patch
@graphcommerce/lighthouse Patch
@graphcommerce/lingui-next Patch
@graphcommerce/magento-cms Patch
@graphcommerce/magento-customer-account Patch
@graphcommerce/magento-customer-order Patch
@graphcommerce/magento-customer Patch
@graphcommerce/magento-graphql Patch
@graphcommerce/magento-search Patch
@graphcommerce/magento-store Patch
@graphcommerce/next-ui Patch
@graphcommerce/react-hook-form Patch
@graphcommerce/framer-next-pages-example Patch
@graphcommerce/framer-scroller-example Patch
@graphcommerce/image-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Mar 01 '23 07:03 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
graphcommerce ❌ Failed (Inspect) Jul 26, 2024 1:29pm
graphcommerce-hygraph-dynamic-rows-ui ❌ Failed (Inspect) Jul 26, 2024 1:29pm
magento-2.4.7 ❌ Failed (Inspect) Jul 26, 2024 1:29pm

vercel[bot] avatar Mar 01 '23 07:03 vercel[bot]

Mmm https://github.com/graphcommerce-org/graphcommerce/commit/0d411350e4621928411c2800be6ea02c6125049a#diff-672ad1e5d7eb4b752dd8a266635a1b092a3b7a3de5f3644df8aab7ec0257c64fR110

paales avatar Mar 01 '23 15:03 paales

This issue happens when you have both Magento and GC configured to display prices excluding taxes. Magento will provide the discount excluding VAT, but then GC also tries to subtract the VAT and the result is an incorrect value.

I am not entirely certain whether the prices incl/excl tax setting for GC is expected to always match the Magento setting, or whether you are supposed to be able to use a different setting for GC than you have for Magento. I suppose it makes sense to be able to vary this, for instance if you have a single Magento install with multiple GC frontends for B2B and B2C.

If the Magento and GC settings are not required to match then this PR will not actually fix the issue, it will only move the problem to installs where Magento is configured for prices including tax and GC is configured to display prices excluding tax.

To fix the issue in both situations I think you would need to have additional information from Magento, for instance if you had both the discount including tax and the discount excluding tax then you can choose which you need. If you could find out which setting Magento is using that would also be helpful in determining whether or not GC needs to subtract VAT.

SimonPrins avatar Mar 03 '23 09:03 SimonPrins

Not sure what to do with this?

paales avatar Nov 08 '23 15:11 paales

Page Size old Size new Size diff First load old First load new First load diff
/checkout/payment 12.2kB 12.1kB -0.1kB 299kB 299.0kB

github-actions[bot] avatar Jul 26 '24 10:07 github-actions[bot]

Page Size old Size new Size diff First load old First load new First load diff
/checkout/payment 12.2kB 12.1kB -0.1kB 299kB 299.0kB

github-actions[bot] avatar Jul 26 '24 10:07 github-actions[bot]

Page Size old Size new Size diff First load old First load new First load diff
/checkout/payment 12.2kB 12.1kB -0.1kB 299kB 299.0kB

github-actions[bot] avatar Jul 26 '24 13:07 github-actions[bot]