The documentation for WooCommerce Blocks has moved to the WooCommerce monorepo.
Please refer to the documentation in the new location as the files in this repository will no longer be updated and the repository will be archived.
Zip file for testing: woocommerce-gutenberg-products-block.zip
Enhance validation for limited use coupons and guest users. (11860)
- Create a new coupon and limit its usage to 1 per customer.
- Logged in, with an email you remember, place an order using that coupon, it should pass.
- Logged out, using the same email, try placing an order with that coupon, you should get a top level error "coupon_name" was removed from the cart. Coupon usage limit has been reached.".
- Create a new coupon and limit its usage to 1 per customer.
- Logged in, with an user email you remember, place an order using that coupon, and a different billing email. It should pass.
- Logged out, using the same user email (not the billing email), try placing an order with that coupon, you should get a top level error "coupon_name" was removed from the cart. Coupon usage limit has been reached.".
- Create a new coupon and limit its usage to 1 per customer.
- Logged out, use the coupon with an email you remember, that email should belong to an existing user.
- You should be able to place the order fine.
- Logged in with the user that own that email.
- Go to checkout, add the coupon, using the same email, try to place the order.
- You should get a top level error.
- Change your billing email to something else, add the coupon again.
- Try to place the order, you should get an error.
- Create a new coupon and limit its usage to 1 per customer.
- Logged in, with an email you remember, place an order using that coupon, it should pass.
- Logged in again, back to checkout, change your email, and try adding the coupon, you should get an inline error that you can't use the coupon.
Fixed params passed to woocommerce_before_thankyou for block checkout. This should be an order ID, not an order object. (11862)
- Implement a function that expects an integer for the order ID, attached to the woocommerce_before_thankyou hook.
function test_function_11851( int $order_id ): void {
printf( 'Hello, this is order %d', $order_id );
}
add_action( 'woocommerce_before_thankyou', 'test_function_11851' );
- Place an order on the WooCommerce store.
- Thanks page should show without errors. Should see
Hello, this is order X