Skip Navigation

[Resolved] purchase the product user creates with CRED

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by pouyaR 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#618844

Hi there
I have gone through the setup of putting a CRED form together which creates a new PRODUCT.

I want the user to purchase that particular paroduct they just created as aposed to selecting one manually. is there a work around for this we can implement? I couldnt find anything online at all

many thanks

#618948

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Firstly, please note that you are posting in the Community Forum for users of the free Types plugin. As a Toolset customer you can and should post in the Technical Support forum which we prioritise and where you should receive speedier service.

The CRED form to publish products does just that, it publishes a product, and the user would normally have to view the product then add it to the cart to be able to buy it.

The simplest version of doing this, with minor manual intervention from the user required, is to set your CRED form to display the product once it is published. Then, if the template for displaying products includes an add-to-cart button they can buy that same product without having to select anything.

If that was too much and you don't want them to have to click buy, then you would need to do it programmatically.

You would use the cred_save_data hook to trigger your code once the product had been published (https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data).

WooCommerce has an API that you can use to add a product to the cart using the add_to_cart function (hidden link)

If you are not familiar with PHP you could contact one of the listed contractors to set this up for you: https://toolset.com/contractors/

#619263

Ah great stuff thank you.

Yes I didnt want to bother the support guys, it wasnt a major problem that needed urgent help so didnt want to be a bother, thought the community could chip in.

Thank you for the great advice

Much appreciated

The forum ‘Types Community Support’ is closed to new topics and replies.