Order

WooCommerce Database Explained: How It Works and Where To Find Data

The term “database” is widely used and known to millions of people, but the proportion of people who have it in their vocabulary without understanding what it describes is sizable. Databases are at the core of so many digital services today that it is easy to overlook them entirely, but whether you run a shopping […]

The post WooCommerce Database Explained: How It Works and Where To Find Data appeared first on Business Bloomer.

WooCommerce: Update Order Field Value After a Successful Order

We’ve already seen how to update user meta after a successful order, but this time our goal is to “correct” or “edit” a checkout field value after the order is placed. You could for example add a phone number prefix if it’s not there, and by doing so, correct the phone number before sending it […]

The post WooCommerce: Update Order Field Value After a Successful Order appeared first on Business Bloomer.

WooCommerce: Advanced Order Search

When it comes to saving time, the out-of-the-box WooCommerce plugin doesn’t give you many options and features. For example, searching through your WooCommerce orders is not straight forward enough because the search options are fairly limited. By default, you can go to the WooCommerce Orders admin page (wp-admin/edit.php?post_type=shop_order) and use the basic search bar. You […]

The post WooCommerce: Advanced Order Search appeared first on Business Bloomer.

WooCommerce: Save & Display Order Total Weight

For tracking purposes, or maybe because your shop manager needs to be aware of this, saving the total weight of each order and displaying it on the single order admin page is quite simple. That’s right – WooCommerce does not save this value by default. You either need to save it yourself into the “order […]

The post WooCommerce: Save & Display Order Total Weight appeared first on Business Bloomer.

WooCommerce: Set Checkout Field Value @ Order Creation

This is a very specific function. Sometimes, you need to “set” a checkout field value upon order creation (because it was not required and left empty for example). In some other cases, you might want to override what the customer input if you have certain requirements. Either way, overriding the checkout fields on order creation […]

The post WooCommerce: Set Checkout Field Value @ Order Creation appeared first on Business Bloomer.

WooCommerce: Send Email to Admin Every 3 Hours (Cron Job)

This snippet consists of many WooCommerce tasks: setting up a “WordPress Cron Job” (i.e. schedule a hook that runs on a specific time interval), getting the WooCommerce completed orders from the database, and finally sending a simple email to the store admin. Complex, but as usual you can simply copy/paste and re-adapt it to your […]

The post WooCommerce: Send Email to Admin Every 3 Hours (Cron Job) appeared first on Business Bloomer.

WooCommerce: Add Column to Orders Table @ WP Dashboard

The WooCommerce Orders Table, which can be found under WP Dashboard > WooCommerce > Orders, provides us with 7 default columns: Order – Date – Status – Billing – Ship to – Total – Actions. This is used by shop managers to have an overview of all orders, before eventually clicking on a specific one. […]

The post WooCommerce: Add Column to Orders Table @ WP Dashboard appeared first on Business Bloomer.

WooCommerce: Set Custom Order Status for New Orders

All WooCommerce orders go to either “processing”, “completed”, “on-hold” and other default order statuses based on the payment method and product type. Sometimes these statuses are not enough. For example, you might need to mark certain orders in a different way for tracking, filtering, exporting purposes. Or you might want to disable default emails by […]

The post WooCommerce: Set Custom Order Status for New Orders appeared first on Business Bloomer.

WooCommerce: Disable Customer Order Email for Free Orders

There are times when you sell free products to give customers access to a membership, an online course, or for other reasons. In this cases, you might not want to send them the “Order Completed” email, as the follow-up work is done by your email marketing software or they are automatically redirected to the resource […]

The post WooCommerce: Disable Customer Order Email for Free Orders appeared first on Business Bloomer.

WooCommerce: Get Order Info (total, items, etc) From $order Object

As a WooCommerce development freelancer, every day I repeat many coding operations that make me waste time. One of them is: “How to get ____ if I have the $order variable/object?“. For example, “How can I get the order total“? Or “How can I get the order items“? Or maybe the order ID, customer ID, […]

The post WooCommerce: Get Order Info (total, items, etc) From $order Object appeared first on Business Bloomer.

WooCommerce: Update User Meta After a Successful Order

When an order is placed in WooCommerce, you might want to change/add something in the User Meta programmatically. For example, you could “check” a custom checkbox in the User Profile. Or maybe assign the User Twitter username. And so on 🙂 PHP Snippet: Update User Meta After a Successful Order in WooCommerce In this example, […]

The post WooCommerce: Update User Meta After a Successful Order appeared first on Business Bloomer.

WooCommerce: Add Order Notes to WooCommerce PDF Invoices

I use the “WooCommerce PDF Invoices & Packing Slips” plugin, available on the WP Repository, to invoice my clients. At times, for accounting purposes, I need to show the VAT/TAX ID of the client on the PDF invoice. So, I open the order via WooCommerce > Orders, open the order I want to edit, add […]

The post WooCommerce: Add Order Notes to WooCommerce PDF Invoices appeared first on Business Bloomer.

WooCommerce: Add New Row @ Order Totals (Email & Thank-you Page)

While working for a freelance client, I did some research on the code that generates the “Order Totals” table. This shows on the Thank-you Page and also on the Email Receipt. So, what if we wanted to add a table row to the foot of such table? PHP Snippet: Add Row to Order Totals Table […]

The post WooCommerce: Add New Row @ Order Totals (Email & Thank-you Page) appeared first on Business Bloomer.

WooCommerce: Check if Product ID is in the Order

Once a customer places an order, you might want to know if such order contains a given product ID. you can use this for tracking purposes, redirect to a custom thank you page or run your custom functions. Either way, checking this is quite simple thanks to the “woocommerce_thankyou” hook which runs on the order […]

The post WooCommerce: Check if Product ID is in the Order appeared first on Business Bloomer.