I know it's possible to create products from a frontend CRED form, but is it possible to create Product Attribute with a CRED form, and than assign those newly created variations to this product ?
Thank you.
Dear philippe,
Unfortunately, there isn't such a build-in feature within CRED form, I just tested it in my localhost:
Dashboard-> Products-> Attributes
Add a new Attribute with slug "color2", then search the string "color2" in the database with PHPmyadmin, There are 5 database tables have the records of "color2":
wp_options
wp_term_taxonomy
wp_terms
wp_woocommerce_attribute_taxonomies
wp_woocommerce_termmeta
In above database tables, two of them is custom tables of woocommerce plugin:
wp_woocommerce_attribute_taxonomies
wp_woocommerce_termmeta
Which is out the range of Toolset plugin, I suggest you contact our certified partners for it:
https://toolset.com/consultant/
Ok, but is it possible to create variable products with predefined attribute than ?
For example, can I create in the backend the "Size" attribute, and than add the "S","M","L"',"XL" variations and create a CRED form where the user can create his product frontend and uses a radio field to choose in wich size the produc is available ?
If this is possible, is it possible to add a different prize to different variations. Example if a product is available in "25ml" and "100ml", I would like the user to be able to price his first variation lower than it second.
Thank you.
I tested in my localhost, the variable Woocommerce products is using a hidden post type "product_variation",
which is a child post type of post type "product", and can not be create/edit by CRED
you can view all variable products by run the sql in your database with mysql tools, such as phpmyadmin:
SELECT *
FROM `wp_posts`
WHERE `post_type` LIKE 'product_variation'
Ok, so even If the produc_variation post types are created in the backend, we can't assign an already created product variation via CRED ?
Because if you check this CRED form : hidden link
The Ticket Type section is a Product Variation Field. But even if I check some product variation, the item that is created is still a simple product with no variations.
Sorry, I just checked the URL you mentioned above, I get a blank page, please check it.
And there is a misunderstand in your post:
Woocommerce variable products is a custom post type ""product_variation"", which is a hidden post type, can not be created with CRED form, each variable product is a child post of "product" post.
When you use CRED form to create a "product" post, even you add terms of "Product Attribute", but it still is a "product" post, there isn't "product variation" feature within it.
I suggest you check out our certified partners for it:
https://toolset.com/consultant/
Okay, I understand.
So if I have products, a "T-Shirt" and a "Sweater" and both have a "Small" and "Medium" product variation, in fact what I would have is:
A Product T-Shirt
wich has a child 2 hidden varaible_product post type "T-Shirt Small" and "T-Shirt Medium"
and
A Product Sweater
wich has a child 2 hidden varaible_product post type "Sweater Small" and "Sweater Medium"
I can create the product easily in CRED, but not the variable product hidden child post type.
If I create a new post type that I name "Variations" and I add all the same custom field as the "product_variation", is it possible to have a script to automaticly convert my "Variations" post type to the hidden woocommerce child post and assign him the right parent ? I guess I'll have to check with your partners.
Thank you.
Yes, you are right, the some custom codes are required, for example, you can use CRED action hook "cred_save_data" to create new a new "product_variation" post when your user submit the CRED form:
https://toolset.com/documentation/user-guides/cred-api/#csd
Hey Luo Yang - I am having this same problem do you think you could assist me?