Skip Navigation

[Closed] How to create a front-end WooCommerce external/affiliate product form by default

This support ticket is created 2 years, 8 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.

Our next available supporter will start replying to tickets in about 6.85 hours from now. Thank you for your understanding.

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 2 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#2330603

I want customers to create a product from front-end and force them to sell an external product with WooCommerce.
Is there any way to do it?

#2330681

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Here is the Doc that will help you to understand how you can create product using Toolset forms:
=> https://toolset.com/course-lesson/creating-front-end-forms-for-adding-woocommerce-products/

To set a product as external product, you will have to add a Toolset Forms hook "cred_save_data":
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

For example:

add_action("cred_save_data", "func_set_product_external_by_default",10,2);
function func_set_product_external_by_default($post_id, $form_data) {
 
           if ($form_data["id"]==9999) {
                        wp_set_object_terms( $post_id, 'external', 'product_type' );
            }
}

Where:
Replace '9999' with your CRED form ID

You can present the form to your users to create a product and the using the Form's hook every time the product is created using that form, it will be set as a external product.

#2330695

Thanks a lot! will try it later on. And how can I add the external link from WooCommerce to CRED form?

#2330753

Minesh
Supporter

Languages: English (English )

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

Do you mean you want to add a link to a page that holds the Toolset form?

The topic ‘[Closed] How to create a front-end WooCommerce external/affiliate product form by default’ is closed to new replies.