Thanks for the link - not sure what I am missing here as I've created a new select field, but the dropdown for 'Select a custom field here is blank' and doesn't show me any options. See video below:
hidden link
Two other follow on questions...
1) Can I link to a variable subscription?
2) I've setup a taxonomy for Membership type here, which is a useful taxonomy I also want to show in the back end. I was thinking I could use that to choose what product is added to cart but doesn't seem like this is possible?
Hello,
Please elaborate the questions with more details:
Q1) Can I link to a variable subscription?
How do you setup the "variable subscription"? with other plugins?
How and where do you want to link the "variable subscription"
Q2) I've setup a taxonomy for Membership type here ...
How do you setup the "taxonomy" and "Membership type"?
Are you going to put different product into cart, depends on the chosen taxonomy/field value?
If it is, it needs custom codes, for example, after user submit the post form, you can use filter hook "cred_commerce_add_product_to_cart", to trigger a PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/
In this PHP function, get the taxonomy/field value:
https://codex.wordpress.org/Function_Reference/wp_get_post_terms
https://developer.wordpress.org/reference/functions/get_post_meta/
And change the product ID to what you want.
How do you setup the "variable subscription"? with other plugins?
How and where do you want to link the "variable subscription"
The variable subscription is setup with WooCommerce Subscriptions.
I want to link a custom field for membership type to a variable subscription.
This gets tricky as I have a variable subscription product with two different attributes used for variations:
- Number of Employees (4 options)
- Billing Frequency (2 options)
There is a variable subscription product setup with these atrributes. This looks like it is working OK by using the variation ID.
The main issue I see how is I setup the form - It's a bad user experience to list all the different variations as a single dropdown in the form so I'm thinking of using Toolset's conditional form features.
EG Custom field type for "Billiing Frequency"
If they choose monthly:
- Select custom field with options to link to 4 monthly variable products
If they chose annual:
- Select custom field with options to link to 4 annual variable products
How do you setup the "taxonomy" and "Membership type"?
Are you going to put different product into cart, depends on the chosen taxonomy/field value?
I think using the above scenario I can avoid using custom code to achieve this. I'm setting up a test now but from what I can see this should work for my needs here.
For the question:
It's a bad user experience to list all the different variations as a single dropdown in the form so I'm thinking of using Toolset's conditional form features.
There isn't such a built-in feature within Toolset form, see our document:
https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/
The "Conditional Display for Form Inputs" feature works for display different fields, it does not work for options of one select fields.
In your case, you will need to consider custom JS codes, for example:
When user choose an option in field "Billiing Frequency", trigger a JS function:
hidden link
In this function, hide/show specific options in field "variable subscription product" according to selected value of "Billiing Frequency":
hidden link
hidden link
For your reference.