WooCommerce: Auto complete paid orders

The most accurate, effective and lightweight solution (For WooCommerce 3 and above) – 2019 This filter hook is located in: WC_Order Class inside payment_complete() method which is used by all payment methods when a payment is required in checkout. WC_Order_Data_Store_CPT Class inside update() method. As you can see, by default the allowed paid order statuses … Read more

Get Order items and WC_Order_Item_Product in WooCommerce 3

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 to get the Product Id is: get_product_id() Get the variation ID: The correct WC_Order_Item_Product method to get the variation Id is: get_variation_id() Get the order ID The correct WC_Order_Item_Product method … Read more