Skip to content

fix blocks develop - #509

Merged
gentiprenaj merged 2 commits into
developfrom
hotfix-blocks-develop
Jul 7, 2026
Merged

fix blocks develop#509
gentiprenaj merged 2 commits into
developfrom
hotfix-blocks-develop

Conversation

@gentiprenaj

Copy link
Copy Markdown
Contributor

Fix WooCommerce Blocks compatibility for payment methods

Problem

In the Site Editor, Buckaroo payment methods showed "Incompatible with block-based checkout," and on some stores the Cart/Checkout blocks failed to hydrate (stuck on loading) after upgrading.

Root cause

  • The plugin never declared cart_checkout_blocks compatibility, and registered a single umbrella Blocks integration instead of one per gateway — so WooCommerce flagged every gateway as incompatible.
  • The shared buckaroo-blocks script hard-depended on the conditionally-loaded Apple Pay / Google Pay scripts. When those weren't registered (Apple Pay off, or on the Cart page), WordPress dropped the whole Cart/Checkout block script chain, so Store API hydration never completed.

Changes

  • Declare cart_checkout_blocks compatibility (before_woocommerce_init).
  • Register a Blocks payment method type per enabled gateway (BuckarooBlocks) so each is recognised as compatible.
  • Centralise/clean the buckaroo-blocks script registration (BuckarooBlocksScript) and drop the fragile Apple/Google Pay dependencies (components already guard those globals).
  • Gate availability in canMakePayment: methods show as compatible in the editor but are only offered at checkout for a supported store currency.
  • Content-hash the bundle version so a new build always busts the cache.

Testing

  • Site Editor: no incompatibility warnings, no "switch to Classic Checkout" notice.
  • Cart & Checkout blocks hydrate; Store API completes.
  • Currency-restricted methods (Swish/Twint/Blik) hidden at a EUR checkout; express buttons still work.
  • Classic checkout unchanged.

@gentiprenaj
gentiprenaj merged commit f4d963d into develop Jul 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants