Skip Navigation

[Resolved] Toolset Cred Commerce – Multiple Form Submission

This support ticket is created 2 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
- 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)

Author
Posts
#2459619

Tell us what you are trying to do?

Hi there, I am trying to send email notifications to fields included in forms submitted by the user once payment is completed. For example, a user adds multiple cred-connected items to their cart and checkouts out once paying for all these items. For the most part this works, however only the second form (post) receives the email notification despite two (or more) posts being created (where relevant). So if one day permit is purchased everything works as expected. When more than one permit is purchased only the user who has their details entered second will receive a notification. I noticed on investigating that the second post (day permits in this case) would display published but the first would retain the status of wc-pending suggesting there might be a bug here?

Post form settings is set to create posts with status 'pending payment' and the to change the post type to published once the payment status updates. However, this only happens to the last submitted form entry/post. The previously added items are not updated.

Is there any documentation that you are following?

I have reviewed the available documentation.

Is there a similar example that we can see?

Yes, you can add 'purchase multiple day passes' on the paarltrails.com site under memberships & permits.

What is the link to your site?

hidden link

#2460453

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Toolset Forms commerce is designed in such a way that you can buy one product at a time, you can not use multiple products.

To buy multiple products, you may would like to use the following plugins:
- https://wordpress.org/plugins/woocommerce-bulk-order-form/
Or
Here is the related ticket that might help you:
- https://toolset.com/forums/topic/i-need-to-sell-multiple-products-in-a-single-form/

#2460599

Hi Minesh,

I think we might be speaking past each other. At the moment I have a cred form that users completes. This add a designated product to the cart (product determined by cred form field). Once a user has added a product to their cart (they can/do) add another product to their cart using the cred for form. They then check out and pay for both products. No problems so far. The problem now arises that only the LAST CPT that was created by completing the cred form is set to published and receive the notification set up within the cred form settings. The first CPT (day permit in this case) remains with a 'wc-pending' status. In other words, I need all CPTs created through a single order to be updated, not only the last.

Hope this makes more sense?

#2460819

Minesh
Supporter

Languages: English (English )

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

Is the following hook useful for you?
=> https://toolset.com/documentation/programmer-reference/cred-commerce-api/#cred_commerce_after_payment_completed

The "cred_commerce_after_payment_completed" hook will run once the payment is successfully completed and if you have the way to get the post ID of your previous form then you can use this hook to set the post status based on the post ID.

If this is not helpful then I will require a test site where I will require to review how user will navigate through the 1st and 2nd post and then I will be able to guide you in the right direction.

#2461403

Hi Minesh,

Thank you for this. This could definitely solve the problem. Before I go and make changes, please confirm that the expected behavior is that on checkout only the last item created by a cred form will see its status updated? For example, complete a cred form that creates a new CPT and sets the status to wc-pending. I then complete the form again for a second item which then generates a second CTP. Both products related to the cred form posts are in my basket. I then check out and pay for both items (both CPTs Id's are reflected on the WC order in DB). Now, only the last item added to the cart is updated to published. The first remains as is despite the reference to the WC order.

This seems odd for expected behaviour?

#2461951

Minesh
Supporter

Languages: English (English )

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

Toolset Forms commerce can only process one thing in the cart at a time (even though it doesn't prevent you from adding more than one thing), so I suggest you should go with the solution I shared and use the Form's commerce hook as workaround.