Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WooCommerce: Add meta on checkout (for the product)

I have a question regarding WooCommerce.

In the last step of the checkout, I want to add some meta information to the product. Basically, at the end of the checkout process the user can choose to offer the product to a friend. He will enter fields such as friend's email, name...

I want to be able to retrieve this information in the admin panel when I click on the details of the order, in the "product" block.

... And I have to idea how to do that. I found some information on how to add custom fields to the order, but how do I add information to the product in the order and not the order itself?

Thank you. I'm in a bit of a blur right now.

like image 904
nax_ Avatar asked Nov 07 '12 15:11

nax_


3 Answers

Mike Jolley posted the complete code you can insert in your theme's functions.php I recently used it and works like a charm.

https://gist.github.com/mikejolley/1604009

like image 60
Samuele Contardi Avatar answered Nov 15 '22 04:11

Samuele Contardi


I think the Woothemes Product Add-ons plugin may be exactly what you are looking for. You can use it to add custom fields of nearly any type to your individual products. It will display them on the cart page and save them in your admin.

like image 42
Tomanow Avatar answered Nov 15 '22 03:11

Tomanow


Woocommerce allow some hooks and filters to add fields on checkout pag, but yes it requires strong php knowleget. However there is plugin available here: Checkout option manager plugin

like image 30
Jupiter Rown Avatar answered Nov 15 '22 04:11

Jupiter Rown