There's an issue where the Checkout Block is not properly showing the subscription recurring totals on the checkout and are instead being rendered as simple/single prices.
After some investigation, I found out this was being caused by our Checkout Blocks support code never being attached because at the time of initing WC Subscriptions, the Automattic\WooCommerce\Blocks\Package class doesn't exist yet.
To fix this, I've made sure we're always attaching our woocommerce_blocks_loaded code and then moved our version checks to happen inside those callbacks.
How to test this PR
Activate WooCommerce 7.9, Subscriptions 5.3.1 & the latest Stripe
Add a Checkout Block page
Add a subscription product to your cart
On trunk you'll see a non-recurring total on the checkout
On this branch you should see the correct recurring totals:
Product impact
[ ] Added changelog entry (or does not apply)
[ ] Will this PR affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
[ ] Will this PR affect WooCommerce Payments? yes/no/tbc, add issue ref
[ ] Added deprecated functions, hooks or classes to the spreadsheet
Fixes #486
Description
There's an issue where the Checkout Block is not properly showing the subscription recurring totals on the checkout and are instead being rendered as simple/single prices.
After some investigation, I found out this was being caused by our Checkout Blocks support code never being attached because at the time of initing WC Subscriptions, the
Automattic\WooCommerce\Blocks\Package
class doesn't exist yet.To fix this, I've made sure we're always attaching our
woocommerce_blocks_loaded
code and then moved our version checks to happen inside those callbacks.How to test this PR
trunk
you'll see a non-recurring total on the checkoutProduct impact