Skip Navigation

[Resolved] Trying to gather and store Woocommerce purchase info into a custom post type.

This support ticket is created 7 years, 8 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 7 years, 7 months ago.

Assisted by: Beda.

Author
Posts
#424299

OK I was asked to post this question in a new thread. I am trying to finish the last criteria of what I am working on.
Quick overview

This is a youth sports club site.

I have a custom post type for the players.
I have the form working on the front end.
The mother and father of the player have a WordPress account. They can create their kids via the cred form which creates a new custom post for each of their players.
I am keeping the player attached to the mother and fathers WordPress account using the author field. If they look in the player custom post type they only have rights to see what they authored.

I have been looking at creating a view for Woo Commerce but I am kind of lost at this point. By goal is to be able to insert the view into a woo commerce product. When the mother or father go to woo commerce they will need to select a product/lesson plan for their player and pay for it. At some time during the checkout process I want to have the list of players come up that they have authored. I need them to be able to select which of their players they are buying the product for. If they have not created a player yet in the player custom post type I want them to have the opportunity to use the cred form or something similar to create the player they are purchasing the product for.If they do already have a player and select the player the player should come up and give then the opportunity to edit the player. Once they are done selecting the player and confirming the player info they can check out. I need the player custom post type to record the product purchased as associated to the player somehow. The club is looking for a view where they can list the players by product purchased and include many of the fields from the players custom post type. There will only be one checkout per player.

I have not had much luck with this. Am I approaching it correctly? In the end I just need to be able to show the staff that lesson #3 was purchased by 35 families and here is their names and the players names enrolled. There will be a few other player fields to include in the final view but that part seems like it would not be hard to do. Some family's have 4 or more players so being able to chose is important.

Am I on the right track? Is there an easier way to do this? I do not know how to write code.

Thanks in advance for the help.

Ted

#424514

You need CRED commerce and add a payment when they actually create the Player, or edit it.

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

As example you can have 3 Products. Let's say a "simple", a "advanced" and a "limitless" product.
Those have different Prices and every Time a Parent creates a Player entry for a child, this payment has to be paid by the Parents to actually create the Post.

Your approach will not work, because the payment, if done with the possiblities Toolset offers, needs to be done when the Post (player) is created or modified.

In the above DOC the steps are outlined, but we also have a Test Site where you can see this in action:
hidden link

You can either download that test Site with the FrameWork Installer Plugin, or play with it on the above Discover Site directly, after creating a free account.

Please let me know if this information is helping you to achieve the goal.

#430939

So is there maybe another way to link one of your custom post types to a product?

So lets say this. I am logged in and a WordPress user. I have 3 kids that play on the sports club. I have created a custom post with all the information for each of my kids. As the parent(mom-Dad) I am linked to my player/children because I am the author of their custom post with all their details. There is a product in Woo-commerce that is the registration and dues for one of my kids. I go into woo-commerce and add it to the cart. Right now I am using woo-commerce custom checkout fields and making them type in the name of the child/player they are purchasing the product for. Then it is a manual process to add that info to the custom post type.

Is there a way that I could allow the user to select which child they are purchasing the product for by either the adding it to the cart process or the checkout process? So instead of typing the info it has a pull down or radial buttons so they can pick? Then whatever product they pick gets associated to the custom post type? If that could happen I could just look for a list of custom post types that are associated to that particular product and I would have the players/kids that signed up.

Thoughts? Should I be approaching this differently?

#431113

Nor the Checkout or Payment can be customized with Toolset.

What you could do is let the user create a Child Post to his Kid (Parent Post)

This Form, that creates a Child Post (Sunscription) would hold the payment (has the WooCommerce Product connected to it)

Still it woudl need to be done for each Kid manually and once per kid, once per subscription.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.