Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show / hide blocks based on Woocommerce product price and shipping class #115

Open
lpbevan opened this issue Oct 27, 2024 · 0 comments
Open
Labels
Enhancement New enhancement or feature request.

Comments

@lpbevan
Copy link

lpbevan commented Oct 27, 2024

What problem does this address?

I would like to be able to show or hide blocks on my Woocommerce single product template based on price and shipping class. For example, I would like to show "trade-in available" and "in person delivery with expert installation" blocks to customers on my single product pages, but only if the product price is above certain thresholds.

I can also think of some uses for being able to show or hide blocks based on product tags and attributes.

I get the sense that these things are probably already possible using a PHP filter and a custom function, but I am having trouble targeting specific instances of blocks (in this case group and row blocks).

What is your proposed solution?

Add some additional rule options to the Woocommerce product control.

Alternatively, provide some additional documentation describing the attributes passed via the PHP filter, and perhaps some sample code for targeting individual blocks.

Repository owner deleted a comment Oct 28, 2024
@ndiego ndiego added the Enhancement New enhancement or feature request. label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New enhancement or feature request.
Projects
None yet
Development

No branches or pull requests

2 participants