Plugin Contributor
Lap
(@lapzor)
Are you able to add a HTML block? If so, you can use the Custom Integration method: https://www.mc4wp.com/kb/add-subscribe-checkbox-custom-form/
Hope that helps. If you have any questions, please let me know!
Thread Starter
Bob33
(@bob33)
Thanks for the reply Lap!
Yeah, that was one of the first things I tried – unfortunately afaics the checkout on WC Blocks doesn’t allow a code block in the main area of the checkout where the checkbox wants to go – only paragraph, image or separator blocks :/
Development is pretty active on the WC Blocks plugin so maybe they will in the future, but I’m guessing they prefer other integrations approaches.
Plugin Contributor
Lap
(@lapzor)
Is this the plugin you are using: https://wordpress.org/plugins/woo-gutenberg-products-block/
Thanks for letting me know.
Plugin Contributor
Lap
(@lapzor)
I’ve looked into it for a bit and for now I’m not able to see a clear-cut way to integrate with this checkout.
While I was able to add the HTML for the custom integration checkbox, by adding a paragraph, then switching to “edit as html” and put the code in there, this still didn’t work as the order data is send in via an ajax call to wp-json/wc/store/v1/checkout and doesn’t included any custom fields…
Maybe they will add some filters or action hooks for us in the future that make it easier to add custom integrations to the checkout.
They do have an action called woocommerce_blocks_enqueue_checkout_block_scripts_after but with my limited understanding of how this all works I wasn’t able to add our integration via that hook within the amount of time/effort that I have available right now. We will be happy to revisit this when the block checkout is more mature (no longer in beta) and becomes more mainstream, or otherwise if it’s requested a lot by our users.
Thread Starter
Bob33
(@bob33)
Thanks for looking into this Lap
Yes, pretty early days for WC Blocks. No doubt quite a few changes and improvements coming up to make things like this a bit more straightforward.
Cheers!