In Woocommerce, I’m attempting to add a piece of custom meta to my products and I would like to pass it through to orders. We have a substantial amount of products and they are accountable to different cost centers so I need a select box inside the product admin that we can choice the cost centers that passes a value
Tag: orders
Sorting order items by SKU in Woocommerce
I am trying to order the products by sku within an order in an email in Woocommerce. I have not had any luck with the following code. Some help? Thanks since now! add_filter( ‘…
Display product category names in Woocommerce order details
In Woocommerce, How I can display the product category names in order details (and in backend of Wordpress). Also is it possible to make them appear in the email notifications.
Sort Orders IDs alphabetically based on the shipping last name in Woocommerce
I need to sort my $order_name (more specifically $order_shipping_last_name) alphabetically. I’ve tried many different basic php sort() methods, in many different places, and can’t get this to work. I’m assuming I’m missing something? In my code, get_all_orders_that_have_a_product_variation( $product_id ); function comes from this answer code that allow to get an array of orders IDs from a variation ID… The list
Auto change order status from hold-on to processing in Woocommerce
I would like to change every order from woocommerce with the status ‘HOLD-ON’ to ‘PROCESSING’ with php. I already tried to write a function in the functions.php file but I failed. How can I auto …
Add a sortable custom column in Woocommerce Admin Orders list
I’ve added a custom column to the “Orders” section of WooCommerce for the shipping zip code. The column and its values appear correctly. What I cannot figure out is how to make the sorting of this …
Add value to custom column on customer’s orders page in woocommerce
I was trying to add new column to the orders page of the customer’s recent orders table, the new column should show the details of the product like product name & description. Tried different …
Hook woocommerce price in backend order edition
I need to change item product prices in Woocommerce Backend Order. I tried tu use the following hook, but I have a problem trying to obtain the order id. Any suggestion? Thanks in advance! Complete problem: The complete problem is as follows. I am using a plugin that adds a field to the product called wholesale price. If the customer
Display Custom Total Saving in generated invoice in WooCommerce 3
In WooCommerce I am using WooCommerce Print Invoices & Packing lists plugin… How can I display the total savings of any order in the invoices generated by this plugin ? 1 year ago I have been using this code based on [this answer] and that was working before I updated WooCommerce : So now it doesn’t works anymore. I have
Get orders shipping items details in WooCommerce 3
How can I get the order shipping method id.? For example ‘flate_rate’. Since WooCommerce 3 it is now complicated as everything has changed. I have tried it with $order->get_data() in a foreach loop but the data is protected. Answer If you want to get the Order Items Shipping data, you need first to get them in a foreach loop (for