[Waiting for user confirmation] Pass custom fields from a custom post to woocommerce product

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.

Our next available supporter will answer your ticket in about 10.56 hours from now. Thank you for your understanding.

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Related documentation:

This topic contains 9 replies, has 2 voices, and was last updated by  Shane 1 day, 4 hours ago. The support staff assigned to this topic is Shane.

Viewing 10 posts - 1 through 10 (of 10 total)
Author
Posts
#526043

I am trying to: pass custom field content that was created by a CRED woocommerce to a product order form.
in other words the process is
1. User fill a custom post CRED form and submit it (free /fee) . the custom post is created and published
2. any user view the custom post on the front end
3. any user click to purchase a product related to the custom post he view (have a few products options for the custom post
4. user redirected to a product page
5. product page include custom fields from the custom post e.g. title, name, date, etc..
6. user select variations and quantities
7. user complete checkout
8. user and store manager receive email with order information including custom fields from the custom post
9. store manager can custom the product based on the order information including custom fields from the custom post

I visited this URL: https://yizkorleolam.com/

I expected to see: product page include custom fields from the custom post e.g. title, name, date, etc..

Instead, I got: nothing as I'm not sure how to do this with toolset. I looked at the post https://wp-types.com/forums/topic/fields-from-existing-custom-type-of-posts-into-woocommerce but its missing some steps to complete what i'm looking for.

I thought of parent child relationship where the custom post is a parent and product is a child but i'm not sure if this is the right way to go.

also, passing query string from the is an option but i'm not sure how to pass them into the product page and than to the order info in the email.

Please advise,
thanks,

David

#526315

Shane
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/Jamaica (GMT-05:00)

Hi David,

Thank you for contacting our support forum.

I'm not quite sure I understand the issue fully, Is it that you want to display your custom fields on the product page itself?

Or is it that you want these custom fields that were filled out by the customer to be stored on the product and then displayed on the frontend.

Please let me know.

Thanks,
Shane

#526392

Hi Shane,

the first option is what i'm looking for. I want to display custom fields on the product page itself.
I already use the second option to creat the custom post.
think about as one client submit the custom field for free
the second client or any client can view the custom post and order a product with data stored in the custom fields from the custom post.

hope this makes it clear.
thanks,

David

#527122

Shane
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/Jamaica (GMT-05:00)

Hi David,

Thanks for the information.

You can actually do this by taking a look at the link below.
https://wp-types.com/learn/create-an-ecommerce-wordpress-site/single-product/

Thanks,
Shane

#528105

hI Shane,
yes, I have looked at this link before.
however I dont understand how to take the information from a custom post and plug it into the product page and transfer it to the order.
I can see that I can plugin the custom field in the product page.
so I created custom field that apply to both custom post and products.

again the process is:
client submit a custom post that have custom fields in it (paid or not is not the issue here, I know how to do both)
Second step is client or owner of the custom post want to purchase a product that have information (custom field) from the custom post.
client click on buy product from the custom post from end and redirect to checkout page that include the custom fields from the custom post and complete the order.

so my question is how to take custom fields from custom post into a product.

I hope its more clear.
please advise,
thanks,

David

#528196

Shane
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/Jamaica (GMT-05:00)

Hi David,

I believe I understand a bit more clearly now.

But i'm still not clear on a few things.

The user is creating a Custom Post or a Product, or Both

Please let me know.

Thanks,
Shane

#528221

Hi Shane,
allow me to be more specific.

user go to https://yizkorleolam.com/order/ and create a custom post with custom field in it as seen on the page.
after submitting the post (for a fee or for free) the post is been published. see example of published custom posts at https://yizkorleolam.com/yizkors/
a specific custom post look like this post https://yizkorleolam.com/in_memory_of/o1020a/

I want to add a button to the custom post page (example page https://yizkorleolam.com/in_memory_of/o1020a) that will allow a user to purchase of a product that will take the name, URL and Years from the custom post and create a customized product.

For example buy a picture print with a picture from the custom post, including the full name, the birth and death years, and the URL of the custom post.

the user is redirected to the product page and the information to create the customized product is populated automatically from the custom post information.

many users can order multiple product for the same custom post.
at the moment I'm looking at 3 different products per custom post: Picture print, Labels, and a plate with the information from the custom post.

I can create the three products in woocommerce but not sure how to customize the order process so the required fields from the custom post will come from the custom post.
I dont want the user to manually input the information as errors will happen and the UX will be very bad.

please let me know if you have any question.
thanks,

David

#528438

Shane
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/Jamaica (GMT-05:00)

Hi David,

Ok so based on this workflow i fully understand what you want to achieve. Its pretty much creating a custom product based on What the user selects.

Ok Regarding the custom product section I wouldn't be able to assist with this since it would be going into woocommerce code to achieve. It will also take some custom coding to achieve as well where the button is created on the page to run a code that will create the custom product once it is clicked and allow the customer to order that product.

Even though i'm not able to assist with the coding of this I can however point you in the right direction where you can get some assistance from our certified consultants.

You can contact them by going to the link below.
http://wp-types.com/consultant/

Please let me know if this helps.

Thanks,
Shane

#528648

Hi Shane,

I'm sorry to here that. it sounds like toolset cannot do what I want.

as for creating the custom product, it seems that toolset know how to do that and the link you provided show how to do just that. so I can create a custom product with toolset without going to woocommerce code as you suggested.

the only thing that is not clear to me is how to pass the fields from the custom post to the custom product.

when I insert a custom field (that is available for custom post and products) into the product template I can theoretically use a parent child relationship but I'm note sure about the definitions.

for example can I create product as child of custom post and than insert the data to the product from the parent custom post?

or should custom post should be child of product and when linking to the product I can pull the child data into it.

also, i'm not clear if I can use the "The parent of the current post (WordPress parent) " relationship for this.
or use query strings to do this task.

Please note that sending me to vendors that will do this for me is defeating the purpose of using toolset.

Its not the first time I hear the easy way is to hire a vendor to do it but with some research I was able to find solutions for all my issues without hiring a vendor.

I ask you to please help me by escalating this to a product manager or the developer lead that manage this features at onthego systems. I'm sure they will be able to provide a solution with some example I can tweak like I've done many times in the past.

Thanks,

David

#528874

Shane
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/Jamaica (GMT-05:00)

Hi David,

Before I can escalate this ticket I will need to cover all the grounds .

From your explanation I gather that this is you workflow:

- Customer creates a Post using CRED
- That Post creation then Creates a product with the custom fields filled out from the previous post, essentially a custom product based on that Post.
- The user is then redirected to that created custom product.
- The customer then selects the quantity of that product and then they can order that product.

My question is why not just create a custom product from the beginning instead of this 2 step process. You can add the custom fields that you want the user the product to have and then allow the user to create the custom product.

Then with CRED the user can be redirected to that newly created product and you can use our Views alongside Woocommerce views to display that products custom fields that the user filled out. The user can then select the quantities that they want and order.

Now that is the simplest way I can think of it and it would still require some custom coding so that the custom fields that are in the product be included in the order email.

If we go by your route we can create the Custom Post, but then there is no way to create a product after that except through use of code and then copying those attributes that were filled out to that created product.

We should be able to achieve this by using our CRED hooks to create the product and redirect us to that product.

Take a look here as to an example of what needs to be done to create the product through code.
https://wordpress.stackexchange.com/questions/137501/how-to-add-product-in-woocommerce-with-php-code

Please let me know if this clears things up a bit for you.

Thanks,
Shane

Viewing 10 posts - 1 through 10 (of 10 total)

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Known issues and their solutions

We document known issues and their solutions in Toolset erratas. Save time by checking there first and seeing if what you are facing is a known issue. This list is kept short. We do our best to resolve all known issues with every release of Toolset plugins.

Support Policy

Toolset staff will help you use the Toolset plugins correctly, provide any information you need, help troubleshoot problems and advice on best-practices.

Please make sure to issue only one topic per each support ticket.

For more information, read our full Customer Support Policy.

Need custom programming work for your site? Check out our certified partners.