I assumed the get_name call was raising it. These are the only places in the code where woocommerce data is retrieved. Reply. Kim.
Update (For WooCommerce 3+). Now for the code you can use WC_Order_Item_Product (and WC_Product ) methods instead, like:
If you use the get_id() method, you get your item ID which is 15 in your code. Get the product ID: The correct WC_Order_Item_Product method ...
However based on my problem I was able to use $item->get_total() and $item->get_quantity() . Based on this, I can just divide price by total ...
Get the Order ID in Woocommerce order received page as shortcode; Get Order items ...
Get the metadata of an order item in woocommerce 3,Reading up the
products – line_item type,; shipping – shipping type,; fee – fee type. Order items has their own tables in WordPress database – {prefix} ...
So I ended up combining a few answer out there and split out orders when adding to the cart, and also when updating the cart. The below works, though it's ...