Relative Content

Tag Archive for phpwordpresswoocommercehook-woocommerceorders

Add order total weight to WooCommerce admin orders list (HPOS compatible)

I used to use a plugin to add the total order weight to each order and display it on the orders page on the back end. However, HPOS broke this and I have been trying to write the code to implement it again. I have Frankensteined a few snippets I have found, as my PHP skills are very limited, and this is as far as I have gotten, I just can’t seem to get it to populate the values.

How to avoid woocommerce_thankyou hook to be trigerred multiple times?

I’m using the woocommerce_thankyou hook in my WooCommerce site to send order data to an external URL via a POST request whenever a new order is created. However, I’ve noticed that this hook is sometimes triggering on very old orders, causing unexpected POST requests. Here’s the code I’m using:

How to avoid woocommerce_thankyou Hook Triggering on Old Orders?

I’m using the woocommerce_thankyou hook in my WooCommerce site to send order data to an external URL via a POST request whenever a new order is created. However, I’ve noticed that this hook is sometimes triggering on very old orders, causing unexpected POST requests. Here’s the code I’m using: