V
V
Vitaly2019-07-28 16:58:53
WordPress
Vitaly, 2019-07-28 16:58:53

How to change product price in Woocommerce order?

Hello, I have a question, is there any way in the woocommerce admin panel in the order to change the price per unit of the product. There, by default, there is a column for changing the total price for that one product and its quantity.
Has anyone encountered this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy, 2019-07-29
@Seahunter

Found yesterday a solution to the problem, maybe someone will be interested.
In Woocommerce, where the unit price is displayed, there is no filter to change the output, it's just a line of text. But, it is possible to add your own column to the table. I hid the old, unnecessary column, and added a new one, exactly the same, only with input inside.
Hooks that were used:
woocommerce_admin_order_item_headers - table header and th tag
woocommerce_admin_order_item_values ​​- cell content - td > input etc.
woocommerce_saved_order_items - save the meta field with the new price in the order

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question