Need exact steps to reproduce. Thank you.
Thanks for reply.
I have native woocommerce site, but I need to write a react configurator that will react to user inputs. After filling in all the necessary inputs, I wanted to send this data together with the product to the cart. That’s why I thought that it would be good to use your custom data for this particular case. Subsequently, I will simply place an order and expect to see this data somewhere. (Based on this data, I produce personalized products).
The problem is that I can’t see this data anywhere. I don’t see them in the database, I don’t see them in the order. Where is this data stored please?`
Or to simplify it.
1. I want to create a product, e.g. gold bracelet with product ID 32.
2. There will be no add to cart button on the product page, but Configure It instead.
3. After clicking the Configure button, the user will be redirected to the React page, where he can choose the exact shape of the bracelet, select the font for engraving, enter the text for engraving.
4. After confirming the configuration, a function will be called which, with the help of cocart, will add the product with ID 32 to the cart.
// However, here I would like to pass the bracelet shape, engraving font and engraving text. I would like to see this data in the order with the product so that I can instruct production based on the customer’s preference.
Hey @thedareback
To give you an example on how to convert a cart to an order. Check out this code example. Any cart item data that is applied at the time the item is added to the cart will be applied to the order if you do it this way.
Hope it helps.
Hello @sebd86
please, is there any method to which I would pull out this custom data specifically?
I mean something like this:
foreach ( $order->get_items() as $item_id => $item ) {
$custom_data = $item->get_custom_data();
}
Thanks
-
This reply was modified 2 years, 3 months ago by
thedareback.
-
This reply was modified 2 years, 3 months ago by
thedareback.
-
This reply was modified 2 years, 3 months ago by
thedareback.
-
This reply was modified 2 years, 3 months ago by
thedareback.