Skip Navigation

[Closed] Toolset Forms Commerce is not automatically adding the product to the cart.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. 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 7 months ago.

Assisted by: Minesh.

Author
Posts
#2646643

Please see the following Video:

Link: hidden link

The form is not automatically adding the specified woocomerce product in the shopping cart after submitting the form.

#2647015

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

What if you try to set the product ID using the hook.

Could you please try to use following code - you can add the following code to "Custom Code" section offered by Toolset or functions.php file of your current theme:
=> https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/

add_filter('cred_commerce_add_product_to_cart','func_set_product_id_on_fly',10,3);
function func_set_product_id_on_fly($product_id, $form_id, $post_id) {

  if ($form_id==99999) {
   $product_id=11111; 
}
  
return $product_id; // this is important, to return it
}

Where:
- Replace 99999 with your original form ID
- Replace 11111 with the product ID you want to see in the cart

More info:
- https://toolset.com/documentation/user-guides/cred-commerce-api/

#2647293

Hi Minesh,

Thank you for your help. I made another video, still seems to not want to add the product to the checkout page.
Link: hidden link

#2647419

Minesh
Supporter

Languages: English (English )

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

That is really strange.

In order to minimize the cause of the issue and to ensure there is no conflict between the third-party plugin/theme you are using:

Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?
- Do you see any difference?
If no, then I will require admin access details in order to check whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

The topic ‘[Closed] Toolset Forms Commerce is not automatically adding the product to the cart.’ is closed to new replies.