Skip Navigation

[Resuelto] Cred for Woocomerce (similar to field factory)

This support ticket is created hace 7 años, 2 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 5 respuestas, tiene 2 mensajes.

Última actualización por Luo Yang hace 7 años, 2 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#567715

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: (enlace oculto) I like how it is part of the purchase, rather than a form stuck at the bottom (see at the description area).

Thanks,
Brian

#568346

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/

#568494

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.

#568580

OK, please let me know if you need more assistance for it, thanks

#569361

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,

#569394

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:
enlace oculto
in this function, submit the CRED form
enlace oculto