Skip Navigation

[Resolved] Create form with product attributes to select product variation

This support ticket is created 4 years, 5 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 4 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1896149

Trying to create a classifieds form where the price changes based on the user selections.
I have created a single Woocommerce product with 3 paid attributes - duration (1-4 weeks), newsletter to promote in (Offcuts, WoodWeek, both) and add logo to advert ($50). This creates 24 different product variations, with each having its own ID and price.
For the Toolset public form, I have included custom fields for the user to select the options they want (which use either ratio or checkboxes).
I want the public price to update in realtime based on the selections. This would likely be a formula that dynamically pulls in the 3 slugs to find the correct product variant and output the price.
I also need a hidden field with the correct product ID to be used by the Toolset Forms Commerce field to connect the product and payment system.
Both the updated price and hidden product ID fields need to be dynamically created based on the 3 selections above.

I have spent the whole day or two with trial and error and searching for answers.
While I can paste in 'basic' PHP functions and use plugin shortcodes, I'm not a coder.
Any help would be welcome.
Cheers,
Ken

#1896835

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

It seems you are not aware about that:

You can create Toolset forms for adding and editing Simple Products and External/Affiliate products. You cannot create Toolset forms for Variable and Grouped products.

This information already available with our Doc:
=> https://toolset.com/course-lesson/creating-front-end-forms-for-adding-woocommerce-products/#what-kinds-of-products-you-can-add-with-forms

Having said that, Creating/Adding variable product using Toolset Form is not supported natively.

#1897043

Thanks for the quick reply.
Sorry, I may not have been clear in my issue. I'm not using Toolset to create new WooCommerce products.
Instead, it is for the public to create jobs and buy/sell classifieds (via custom post type) on our website. WooCommerce is used for credit card payments.
We charge a fee based on the number of weeks their ad is displayed (1, 2 3, or 4 weeks), the number of newsletter platforms they can promote on (Friday Offcuts and/or WoodWeek), and add a logo/image to the advert.
Given the options above, there are 24 different product combinations.

Using WooCommerce, I created one product with 3 attributes (duration, newsletters, and extra image) and generated 24 variations. For example, one product variation would be an advert for 3 weeks, in 2 newsletters, and include an image for $800. Each variation has an individual product ID.
If I could create a formula/function in ToolSet that pulls in the attribute selections from the 3 pricing questions into one field, then use this to automatically find the exact variation product ID to insert into the Toolset Forms Commerce field.

Another way would be to create 24 individual products, however, not sure the best way to use conditional formatting within Toolset to select the right product ID (and using Toolset Forms Commerce to connect it to WooCommerce). A ratio field with all 24 products listed would be very confusing for the user. As an example, one product would be called, 'Ad 2 Weeks - One Newsletter - No image'.

A better option, however, would be using the Toolset front-end form to use field selections and formulas to calculate the price and then use WooCommerce to process payment.
Could this be possible with a 'Name Your Price' WooCommerce product? See hidden link or https://docs.woocommerce.com/document/name-your-price/.
If so, this would be a massive benefit for Toolset users - the ability to generate any combination of pricing with front-end form selections and using that in an 'any price' WooCommerce product.
Looking forward to your thoughts and help in finding the best solution. I'm a little frustrated at the moment as wasted a lot of time trying to work this out.
Cheers,
Ken

#1897213

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check this similar ticket where I offered the user to use the Toolset Form hook:
=> https://toolset.com/forums/topic/cred-woocommerce-and-name-your-price/#post-366144

If that does not help, Honestly, we do not have any official integration with Name Your Price plugin and we are not allowed to debug or offer support for third party integration.

Any solution to get this working would have to be a custom one, since its with a 3rd Party plugin and our support policy prevent us from offering such custom solutions. I hope this is understandable.

What I can recommend that you do is to contact one of our certified consultants. They should be able to assist you for your any custom programming needs. You can find the certified Toolset consultants with the following link:
=> https://toolset.com/consultant/