This members-only tutorial provides the code to register a custom condition for outputting elements to users depending on whether they have purchased specific WooCommerce product(s) via the Pay For Post with WooCommerce plugin in Oxygen.
With a Page protected like this:
![](https://wpdevdesign.com/wp-content/uploads/2021/06/pay-per-post-with-woocommerce-page-settings.png)
and the Page edited with Oxygen and
![](https://wpdevdesign.com/wp-content/uploads/2021/06/has-pay-per-post-access-true.png)
our custom condition set to a Section having "This is protected content." heading
and
![](https://wpdevdesign.com/wp-content/uploads/2021/06/has-pay-per-post-access-false.png)
condition applied to a Section having the no access message code, this is what the Page will appear to users that have NOT purchased the associated product(s), "Beanie" in this case:
![](https://wpdevdesign.com/wp-content/uploads/2021/06/oxygen.local_protected-page_.png)
and users that have purchased the product will see:
![](https://wpdevdesign.com/wp-content/uploads/2021/06/CleanShot-2021-06-03-at-10.57.51@2x-1024x221.png)
Step 1 - Register the Condition
Add the following using a plugin like Code Snippets or in a custom functionality plugin:
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $599 one-time).
Already a member? Log in below or here.