Skip Navigation

[Resolved] How to “sell” a product with informations from a CPT post

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)

This topic contains 3 replies, has 1 voice.

Last updated by catherineB 1 hour, 39 minutes ago.

Assisted by: Minesh.

Author
Posts
#2794271

I’m trying to build a multi-vendor bilingual webiste, using different subscription level to limit number of products a vendor can have, whose product are reservations (Service X Monday 13 feb 11a.m.). Also, the website will be a One product / multi-vendor type, as the vendors will have to choose among a specific list of products.

Let say I'm using WCFM to manage all vendors / products aspects. I pre-create all the autorized products, and the vendors can select which one they want to sell.

I could create a CPT called "Booking", which mainly contains 4 infos, Year, Month, Date (taxonomies), and Time (CF).

To add availabilities to a product, each vendor needs to create a new CPT "Booking" post, select taxonomies and fill-up the CF, and associate the post to the product it belongs. This then allows me to create a Search filter with both Woocommerce product list, and Year / Month / Date filters.

But I still (sick) have 2 issues
1) Once the customer selects one of the results (CPT Booking), I can have the page show details as if it was a "full individual product", but it's still a CPT. Can I add a button "Add to cart" that first adds the correct related product to the cart AS WELL as the CTP specific data (Y/M/D/T) to the invoice?

I know WCFM is Toolset / CF / Taxonomies compatible, but I'm not sure that would work if I'm trying to "sell a CPT", or a product with variable taxonomies/custom fields info.

2) I would need the said CPT to be deleted once "bought", because it corresponds to one sigle spot / appointment, and therefore can only be bought one time.

Thanks,

Catherine 🙂
N.B. I have many questions that I’ve separated in different posts to make it easier to answer 🙂

What is the link to your site?
Still on planning mode, so no dev link yet.

#2794336

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I do not have much exposer with "WCFM".

What can I say is Toolset offers plugin Toolset Forms Commerce that allow you to either buy specific subscription:
- https://toolset.com/course-lesson/charge-users-for-submitting-content/

or you can charge users while registering:
- https://toolset.com/course-lesson/charge-users-for-registering-premium-accounts/

I suggest you should check with all posibility and features and try to explore and then make a decition what way you would like to go ahead.

#2794517

For the first link, as I understand, the form allows the user to submit content, and then buys a specific product / fee.

In the second link, it creates a user account, while paying a subscription fee.

In both cases, the final product is "independant" from the content of the form, which is not what I would need. I would need the invoice to include the main product price and info (add to cart - Product X), as well as the info in the CPT "Booking" post from which the "Add to cart" button was clicked, because it would have the appointment details (Date and Hour).

I understand the actual Toolset Commerce hooks may not allow this "info transfert".

As for the second issue, is there any way to delete a CPT post once it's marked as "used". In other words, on "Booking" post would mean 1 spot available at a specific date and time. So if manage to link the post to a product and send them "both" to the cart, is there a hook / rule / trigger that exits that would delete that post (availability) once the purchase completed?

Writing this down it seems quite complicated to do, so I do not expect a postive answer haha

Happy Tuesday,

Catherine

#2794524

Minesh
Supporter

Languages: English (English )

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

I think deleting the post is not a good idea but you can change the post status to draft or something so you will have that post in record and it will give you luxury to fetch the information.

Here is the list of all Toolset Forms Commrece hook:
- https://toolset.com/documentation/programmer-reference/cred-commerce-api/

#2794749

Looking at the different hooks, it really only is related to either submiting new content, or sending a specific product to the cart, nothing related to sending existing post info as custom product infos. So I bet it won't work.

Thank you! 😀

Catherine