Add subtotal to edit order admin woocommerce
Order subtotal is missing from edit order screen in woocommerce after version 3.2 release. Here is a Github thread relevant to this discussion: Woocommerce Github
You can add following piece of code to your active theme’s functions.php file, so that it will show subtotal as shown in image below.
This is great, but is it possible to show the sub total with discounts (coupons) applied.
That is what we want to display. It also makes more sense as it appears after the discount is listed.
@Mark If you see in arguments, you are getting order id there. So you can get order total and & coupon total and perform mathematical operations there and display the amount as you wish. Doesn’t it work that way?
Wonderful and easy fix thanks.
Quick question: How can I pull a checkout fee right under that?
The fee is generated by dynamic pricing and discounts plugin.
I am glad it helped you. You can custom code it to show the fees there. It is just that place can be found using this hook!
Hi is there a similar code to get ITEM QUANTITY TOTALS in orders same as with price? Cant find plugins or working codes to enable that feature 🙁
You can get it by order id. Get object of order and then custom code it.
hi…
“You can get it by order id. Get object of order and then custom code it.”
and how do i do that?
Hi Gaby,
You can refer to order’s class file in woocommerce for this. Otherwise you can write me to vidish1@gmail.com and I can custom develop this for you if you wish.
Thanks,
Vidish
This code in the new version of WOO 4.1 does not work!
Hi Oleg,
This code works with 4.0.1. But I am pretty sure, it should work with latest woo! If you need me to help on this further, feel free to email at vidish1@gmail.com
Hello, thanks for the answer, but the calculation of coupons in the system is carried out correctly both in the cart and when processing orders in the admin-panel when applying the coupon to the order.
The whole system works perfectly!!!
In the previous version 3.9.8, the discount display for each product was displayed correctly and was calculated taking into account the discount for one product and for several products, and the display was correct, but in the new version 4.1.1 this calculation function in the order is not displayed correctly, since you have to manually calculate the cost of items at a discount for further processing of the order by the administrator.
Maybe there is a development of an additional “hook” or a plugin for administering orders to display the main price of the product and the discount price for each product (s)?
like for example here for the shopping cart https://businessbloomer.com/woocommerce-display-regularsale-price-cart-table/,
but so that this hook appears in the admin-order?
Hi,
It is possible to edit the order page of the administrator to be able to edit the value of the order already placed, that is to say to be able to change the amount of the order.
You can edit order amount in woocommerce order admin but only if the order status is pending, on hold, refunded or cancelled. Otherwise, we have to custom build that!