Skip Navigation

[Resolved] Cart is empty when using child post link form commerce

This thread is resolved. Here is a description of the problem and solution.

Problem:

create a child post link to create a CPT and used Toolset form API add to cart, I got: empty cart

Solution:

In case it is a compatibility problem, please check these in your website:

Deactivate plugins and switch to wordpress default theme, Follow our document to setup a fresh Tooslet form(without your custom CSS/JS codes)

Relevant Documentation:

https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/

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

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)

Author
Posts
#1112432

I am trying to: create a child post link to create a CPT and used CRED API add to cart

Link to a page where the issue can be seen: hidden link and click on: new Booking as a child post link -> which goes to a separate page with a url parameter to the parent post.

I expected to see: an item in the cart with number of days replaced the quantity

Instead, I got: empty cart

#1112814

Hello,

The problem you mentioned above is abnormal:

1) You should submit the Toolset form by clicking a submit button, it should not be a link

2) According to your form setting:
hidden link
After submit the form, it should redirect you to checkout page, and add product "Booking" to the cart, none of them working in your website.

In case it is a compatibility problem, please check these in your website:
1) Deactivate plugins and switch to wordpress default theme, Follow our document to setup a fresh Tooslet form(without your custom CSS/JS codes):
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/
Using Toolset Forms Commerce to Add Payments to Forms

2) If you want to change the product in cart dynamically, please try the filter hook cred_commerce_add_product_to_cart:
https://toolset.com/documentation/programmer-reference/cred-commerce-api/#cred_commerce_add_product_to_cart
Filter that allows to dynamically alter the product associated with a CRED Commerce form, when adding to cart.

See the solution of another thread:
https://toolset.com/forums/topic/inserting-more-than-a-cred-form-on-the-same-page/#post-1091182

#1113092
Screen Shot 2018-09-21 at 11.57.16 AM.png
Screen Shot 2018-09-21 at 11.39.28 AM.png
Screen Shot 2018-09-21 at 11.39.18 AM.png
Screen Shot 2018-09-21 at 11.39.06 AM.png

Hello Luo,

Please ignore the form above the link and see the attached screenshots.

Thanks,

#1114127

Minesh
Supporter

Languages: English (English )

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

Luo has a day off today. He will get back tomorrow and reply you here.

#1114453

My issue is resolved now. Thank you!