Problem: I would like to allow my Users to select different Product variations based on availability, then use CRED Commerce to create an Order and accept payment in WooCommerce.
Solution: CRED Commerce works best with simple products, not variable products. If you only have a few variations of your product, you could separate those into different products first. WooCommerce can track inventory for each product, and you can use WooCommerce Views and conditional HTML to show a CRED Commerce form based on whether or not a product is in stock.
For example, let's say you have Product A and Product B. If Product A is in stock, you want to show your Users a CRED form that allows them to submit a post. If Product B is in stock, you want to show your Users a different CRED form that allows them to register for the site.
On Product A's single post page, you can insert this code to test whether or not Product A is in stock, and show a CRED form:
[wpv-conditional if="( $(views_woo_in_stock) eq '1' )"] Product A is in stock now! [cred_form form="submit-post-form"] [/wpv-conditional]
On Product B's single post page, you can insert this code to test whether or not Product B is in stock, and show a different CRED form:
[wpv-conditional if="( $(views_woo_in_stock) eq '1' )"] Product B is in stock now! [cred_form form="register-form"] [/wpv-conditional]
Relevant Documentation:
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 11 months ago.
Assisted by: Christian Cox.