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

Fees not shown in Cart & Checkout blocks for orders that don't need shipping #3517

Closed
Aljullu opened this issue Dec 7, 2020 · 0 comments · Fixed by #3521
Closed

Fees not shown in Cart & Checkout blocks for orders that don't need shipping #3517

Aljullu opened this issue Dec 7, 2020 · 0 comments · Fixed by #3521
Assignees
Labels
block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. type: bug The issue/PR concerns a confirmed bug.
Milestone

Comments

@Aljullu
Copy link
Contributor

Aljullu commented Dec 7, 2020

Describe the bug

Fees amount is not displayed in Cart & Checkout blocks sidebar if the order doesn't need shipping.

Discovered while working on #2712.

To reproduce

Add this code snippet to any PHP file, for example, woocommerce-gutenberg-products-block.php:

add_action( 'woocommerce_cart_calculate_fees', 'add_fee', 10 );
function add_fee( $cart ) {
	$cart->add_fee( __( 'Fee', 'woo-gutenberg-products-block' ), 100, true );
}
  1. Add a product that doesn't need shipping (ie: Album) and a product that needs shipping (ie: Cap) to your cart.
  2. Go to the Cart or Checkout pages (using blocks).
  3. Notice the Fees amount appears as expected:
    imatge
  4. Remove the product that needs shipping from the Cart and notice how the Fees amount disappears:
    imatge
@Aljullu Aljullu added type: bug The issue/PR concerns a confirmed bug. block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. labels Dec 7, 2020
@Aljullu Aljullu added this to the 4.1.0 milestone Dec 7, 2020
@Aljullu Aljullu self-assigned this Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
1 participant