Snippets for creating conditional blocks based WooCommerce products/cart
These example snippets are based on the custom PHP Logic condition in Conditional Blocks 2.0
- Create the custom function first using the examples.
- Create the block that you want to conditionally display inside the WordPress block editor.
- Select the block & open the Condition Builder. Add the PHP logic condition the block with your custom function, you can use any parameters.