Reputation: 143
I am trying to implement an e-commerce site where the client can pick the t-shirt he wants to buy. And then he may choose one of the available patterns to print it into that t-shirt. Or he can provide a text that he wants imprinted on that t-shirt.
The problem is that I am not quite sure how would I take this information from the client and append it to the product of the order on checkout. I was thinking of using wp_ajax to get the chosen pattern/text from the client, but I am not quite sure how would I link that information to the right product + user combo.
I am not very experienced in the plugin, so I am having a little trouble with finding a way to do this. Any help is appreciated.
Thank you in advance!
Upvotes: 0
Views: 504
Reputation: 1860
Make your product as a variable product. Add an attribute design
and let the user choose which design they want to order.
This solves your design picking issue.
Next -> (How to get text from the user.)
You can use this tutorial https://pluginrepublic.com/woocommerce-custom-fields/ which explains how to add custom fields to your product.
How to show it on frontend and eventually add that value in your order meta.
There are plugins as well which will can help you add custom fields for a product.
Found this which should do the job for getting the text data in order : https://wordpress.org/plugins/woo-custom-product-addons/
Upvotes: 1