Hi @thekendog
The new Cart and Checkout blocks in WooCommerce are built using JavaScript and React, and they do not support PHP hooks like woocommerce_before_cart
and woocommerce_before_checkout_form
. Instead, they use JavaScript events and filters. Currently, there is no direct equivalent for these hooks. However, you can find all the available hooks here: https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks
As a temporary workaround, you can use classic checkout and cart block or the shortcode. More info: https://woocommerce.com/document/cart-checkout-blocks-status/
For reference, this particular forum is meant for general support with the core functionality of WooCommerce itself. For development and custom coding questions, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.
I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.
Hi @thekendog,
Bummer
I understand how dissapointed you may feel, but as my colleague had shared above you can chooze to use the classic checkout and cart block or the shortcode. More info: https://woocommerce.com/document/cart-checkout-blocks-status/
I hope this helps you achieve your desired goals.
All the best.
Yeah, I know. Just frustrating the direction the plugin (and WordPress for that matter) is going. What used to be an easy PHP thing is now a complex javascript thing.
Hi @thekendog,
Please keep in mind that those are new features, and we’re working on them, you can continue to use the classic shortcodes as mentioned before in the meantime. Kindly know that we value your feedback, and we use it to improve our products in the future, considering ease of use and customization. That is the goal! 🙂
For instance, with Blocks, we’re focusing on visual building and options within the blocks themselves so it is way way easier for users to manage!
Thanks!
-OP