Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

MiniCart.php - 'wc-block-mini-cart__amount' not displaying correct amount when including tax on product prices on initial page load. #7830

Closed
lukeoregan88 opened this issue Dec 2, 2022 · 0 comments · Fixed by #7832
Labels
block: mini-cart Issues related to the Mini-Cart block. type: bug The issue/PR concerns a confirmed bug.
Milestone

Comments

@lukeoregan88
Copy link
Contributor

lukeoregan88 commented Dec 2, 2022

Describe the bug

On initial page load the mini-cart is not showing the correct total when you have items already in the cart and you have set tax to be inclusive with prices. Looks to be showing the total amount exclusive of tax. Does however update correctly when hovering over the mini-cart which I'm guessing is handled via a AJAX request.

To reproduce

Steps to reproduce the behaviour:

  1. Enable Have product prices inclusive of tax
  2. Add Mini cart block to widget which is places in the header of the template
  3. Add items to cart
  4. Reload the page.
  5. Shows cart total exclusive of tax until you interact with the mini-cart.

Expected behaviour

Expected to see Total amount inclusive of tax. Not exclusive on page load.

Line 305 around function 'get_cart_price_markup' should probably include the following after the '$cart_contents_total' variable

if ( $cart->display_prices_including_tax() ) { $cart_contents_total += $cart->get_subtotal_tax(); }

Screenshots

https://i.ibb.co/KNFYv6n/cart-error.gif

Environment

WordPress (please complete the following information):

  • WordPress version: 6.1.1
  • WooCommerce version: 7.1.0
  • Theme: Storefront: 4.2.0

Desktop (please complete the following information):

  • Browser: Chrome - Latest
@lukeoregan88 lukeoregan88 added the type: bug The issue/PR concerns a confirmed bug. label Dec 2, 2022
@Aljullu Aljullu added the block: mini-cart Issues related to the Mini-Cart block. label Dec 5, 2022
@Aljullu Aljullu added this to the 9.1.1 milestone Dec 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: mini-cart Issues related to the Mini-Cart block. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
2 participants