The WooCommerce “Order Again” button displays for ‘completed’ orders on the Thank You page and View Order page. That’s a pity, because it would be useful to show it on the My Account > Orders page as well, as a custom “action”, same as the “View”, “Pay” (if pending), “Cancel” (if subscription), “Edit” (custom snippet), “Confirm” (custom snippet) buttons.
The good news is that we can code it ourselves! And just reuse most of the code we already wrote, as well as rely on the WooCommerce “listener” for the existing “Order Again” button. Enjoy!
Continue reading WooCommerce: Order Again Button @ My Account > Orders
Exactly. By default, when you search for orders in the WordPress > WooCommerce > Orders backend, using a SKU will give you 0 results. Which is pretty poor for a store manager.
Let’s change this. Despite the code is a little complex, all you need is a simple copy & paste. Enjoy!
Continue reading WooCommerce: Search Orders By SKU @ Admin
An order can be marked as “completed” only by the WooCommerce store manager – manually. In certain cases, this operation may be automatic i.e. for downloadable orders.
However, what if we want our customers to complete (confirm) their processing order instead? Well, this is quite easy: we display a “CONFIRM ORDER” button under My Account > Orders, and on click some code triggers the status change. Enjoy!
Continue reading WooCommerce: Let Customers Complete a Processing Order
I’ve been testing for over an hour but finally I found a way to make this work. When you are in “Edit Order” view under WordPress Dashboard > WooCommerce > Orders, there is a dropdown of “Order actions”: “Email invoice”, “Resend new order notification”, etc.
A major problem I’ve always had while troubleshooting or working on the WooCommerce thank you page was that I had to build that URL by hand in order to view it again or to avoid placing yet another test order (it follows the format e.g. https://example.com/checkout/order-received/214008/?key=wc_order_aHB6YrmLOZIKP).
Well, from today, you can access that order thank you page URL directly from the “Order actions” dropdown. Enjoy!
Continue reading WooCommerce: View Thank You Page @ Order Admin
This is going to be a great tutorial. And it works for sure, because I’ve just implemented it on the brand new WooWeekly website!
Basically I was looking for a way to create an order on Business Bloomer WooCommerce website when a customer registered from the My Account page on the WooWeekly WooCommerce website. The reason for doing that is that I’m using email marketing on Business Bloomer, and the only way to add an email contact from another website was by using the “REST API” that WooCommerce provides.
Now, I learned all this today, so you can manage to achieve complex stuff too. I’ll just save you a couple of hours of headaches trying to figure out how the system works – that’s why you’re here!
So, how do you create a WooCommerce order on one website when an event occurs on another website? Enjoy!
Continue reading WooCommerce: Create An Order From Another Website!
If 2020 taught us anything, it was that businesses needed to stay nimble and find new ways to adapt. During the pandemic many businesses turned to WooCommerce as digital transformation was accelerated overnight out of necessity. Traditionally in-person shops selling anything from food to clothing to auto parts needed an online presence to continue selling in a safe and convenient way.
Developers, agencies and business owners (like yourself) worked very quickly as demand surged to fill in feature gaps for these new use cases in WooCommerce.
A clear problem started to occur for businesses fulfilling orders in real-time. Knowing when the order was placed and starting the order fulfillment process was manual, slow and not organized. This resulted in increased time for employees to manage orders, errors in orders and delays getting orders to customers quickly.
And here comes Cloud Printing to the rescue. Adding such a system to your WooCommerce store can immediately cut manual steps in the post-purchase fulfillment process resulting in many benefits for your business.
You can expect reduced operations costs, increased employee efficiency and happiness while also increasing customer satisfaction by getting the order in customers hands quicker. So, let’s understand cloud printing better and see how this can be implemented. Enjoy!
Continue reading WooCommerce: How To Print Orders Automatically
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 site or a business server, building an understanding of them is worthwhile regardless of whether or not you are directly responsible for administration duties.
Having a grasp of the underpinnings of what a database is and how it works is sensible, especially if you run a WooCommerce site and you want to make optimal use of all that this platform has to offer.
To that end, here is an overview of the database fundamentals to bring you up to speed.
Continue reading WooCommerce Database Explained: How It Works and Where To Find Data
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 to your courier. Likewise, you could remove punctuation, trim spaces, format accents, and do any manipulation you desire on whatever order field.
So, here’s how they do it. Enjoy!
Continue reading WooCommerce: Update Order Field Value After a Successful Order
When SKU matters to the end user, displaying it in the Cart page, Checkout page, Thank you page, My Account View Order page and Order Emails under the item name is a must.
Ideal for B2B businesses and international brands, this simple customization can help you learn how to add any sort of content under the Cart/Checkout/Order item names. Simply use the same hook and try “getting” something different than SKU with this guide. Enjoy!
Continue reading WooCommerce: Show SKU @ Cart, Checkout, Order & Emails
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 can look for a customer name, a customer billing email and a few more, but that’s pretty much all you can do. You can’t look for multiple fields, you can sort, you can’t filter by order total, and so on.
You get the picture – for a store manager this Orders dashboard is not handy at all. Each extra minute wasted in trying to find something could be better invested – in marketing spend for example.
That’s why we want to show you a quick alternative in order to do advanced searches in seconds. You won’t need any PHP snippets – just a quick plugin that turns your order list into an intuitive and easy-to-use spreadsheet so that you can do all the filtering and manipulation you desire.
Continue reading WooCommerce: Advanced Order Search
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 meta” or recalculate the weight based on the order items and their quantities. Here, we’ll cover option one (saving is better than calculating in regard to performance).
Continue reading WooCommerce: Save & Display Order Total Weight
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 is super easy. Here’s how it’s done – enjoy!
Continue reading WooCommerce: Set Checkout Field Value @ Order Creation
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 unique specifications. For example, I’m using it to send a survey email to each customer who has placed an order. There are thousands of applications, so this is just the start. Enjoy! Continue reading WooCommerce: Send Email to Admin Every 3 Hours (Cron Job)
How can WooCommerce customers edit an order they just placed and paid for? I swear I looked on search engine results and other places before coming to the conclusion I needed to code this myself.
For example, a user might want to change the delivery date (if you provide this on the checkout page). Or maybe they need to change size, or make up their mind about a given product in the order.
Either way it’s shocking to me this functionality is not in a plugin – as usual if you’re interested in customizing this snippet/plugin for your specific needs feel free to get in touch.
So, let’s see how it’s done!
Continue reading WooCommerce: Allow Users to Edit Processing Orders
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.
So the question is: how can we display additional columns to that same orders table, so that we can immediately visualize an order custom field, a specific product contained in the order, or anything order-related that can be “calculated” once we have access to the $order variable? Continue reading WooCommerce: Add Column to Orders Table @ WP Dashboard
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 bypassing the default order status changes.
Either way, setting a custom order status automatically once the order is processed is quite easy. And today we’ll see which PHP snippets you need in order to make this work! Continue reading WooCommerce: Set Custom Order Status for New 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 upon checkout.
Of course, you definitely want to keep the “Order Completed” emails for orders that are not $0. Unfortunately, the method suggested by WooCommerce which “unhooks the emails” cannot be used together with a conditional check (in our case we need to verify if the Order total is $0), so a workaround is needed. Here’s the fix.
Continue reading WooCommerce: Disable Customer Order Email for Free Orders
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, billing info, payment method, total refunds and so on… hopefully this article will help you save time as well!
As we’ve seen in other articles, get product info from $product object and get cart info from $cart object, not always you can have direct access to the $order variable.
Sometimes, you may have the $order_id available for example. In that scenario, you can “get” the order object with the wc_get_order WooCommerce function.
It’s also possible to gain $order information if you are in an email template. This can be helpful to show additional $order information in your transactional communications or trigger custom functions. Either way, enjoy!
Continue reading WooCommerce: Get Order Info (total, items, etc) From $order Object
We already saw how to check if a product category is in the cart, if a product ID is in the cart, and if a product ID is in the order… now it’s time to complete the series with the latest addition!
For this client, the scope was to do something on the “Thank You” page if a certain product category was purchased. For example, echo a “Thank you for becoming a member!” image in case the category “membership” was in the order.
Here’s the snippet, together with PHP comments so that you can understand how this is done. Enjoy!
Continue reading WooCommerce: Check if Product Category is in the Order
A BloomerArmada fan had a nice challenge with a client – how to display the total amount of sales generated by a given coupon code?
So I managed to create this snippet, which adds a brand new column to the WooCommerce Coupon table view with “total sales” value in it for each coupon code – enjoy!
Continue reading WooCommerce: Calculate Sales by Coupon Code