Hi,
Thank your great plugins and continued support. I was wondering if you are considering or would look into adding the ability to create cred forms that attach to woocomerce products, much like the WC Field Factory Plugin does (https://wordpress.org/plugins/wc-fields-factory/). Seems like you have most of the work set. I am in the process of building out a site, but you can see the feature here: (hidden link) I like how it is part of the purchase, rather than a form stuck at the bottom (see at the description area).
Thanks,
Brian
Dear Brian,
Sorry for the delay answer, I was on a trip, for your question:
adding the ability to create cred forms that attach to woocomerce products, much like the WC Field Factory Plugin does (https://wordpress.org/plugins/wc-fields-factory/).
There isn't such a built-in feature within CRED form, but as a workaround, you can try this:
1) setup a new post type "Description" as child post type of "Product"
https://toolset.com/documentation/user-guides/creating-post-type-relationships/
and you can display
2) setup a CRED form for creating child "Description" post, in this CRED form add CRED commerce settings, use action hook "cred_commerce_add_product_to_cart" to dynamically alter the product associated with a CRED Commerce form as it's parent "product", for example:
add_filter('cred_commerce_add_product_to_cart','change_product_to_cart',10,3);
function change_product_to_cart($product_id, $form_id, $post_id) {
if($form_id == 123){
$pid = get_post_meta($post_id, '_wpcf_belongs_product_id',true); // get the parent product ID
if($pid){
$product_id = $pid;
}
}
return $product_id;
}
Please replace 123 with the CRED form ID of step 2
More help
https://toolset.com/toolset-api/cred_commerce_add_product_to_cart/
3) in a single product post, you can also display related child "Description" posts by creating a view:
https://toolset.com/documentation/user-guides/querying-and-displaying-child-posts/
Thank you for your answer, you all are always on top of it. I am looking into this now and trying to wrap my head around it.
OK, please let me know if you need more assistance for it, thanks
Hi Luo,
Is there away to put the cred fields into the product page (without the submit button) ? I would like to save a step. Rather than, having too a guest fill out the cred form, than go to the product page to pick there category (variable product) than go to cart page, to finally finish the checkout page. Would also love it it they can do form entry for each category selected.
Thanks,
The submit button is required by default, but you can try with some custom JS codes to submit the form without submit button, when user click a category link, trigger a function:
hidden link
in this function, submit the CRED form
hidden link