Skip Navigation

[Gelöst] Two other follow on questions

This support ticket is created vor 5 Jahren, 5 Monaten. There's a good chance that you are reading advice that it now obsolete.

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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Luo Yang vor 5 Jahren, 5 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#1273217

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:
versteckter 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?

#1273221

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.

#1274031

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.

#1274165

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:
versteckter Link

In this function, hide/show specific options in field "variable subscription product" according to selected value of "Billiing Frequency":
versteckter Link
versteckter Link

For your reference.