WooCommerce: Search Orders By 2-Letter Country Code [HPOS]

WooCommerce’s order search function is essential for store admins, but with the introduction of High-Performance Order Storage (HPOS), searching by billing or shipping country code may no longer work as expected.

If you’re used to quickly filtering orders by country, this limitation can be frustrating. Fortunately, there’s a simple way to bring back this functionality using a custom code snippet.

In this post, we’ll walk through how to modify the WooCommerce order search to support two-letter country codes, making it easier to find the orders you need. Let’s dive into the solution!

Continue reading WooCommerce: Search Orders By 2-Letter Country Code [HPOS]

WooCommerce: Programmatically Mark Products As Featured

For store owners managing hundreds of products, setting featured items manually is inefficient. A dynamic approach can save admin time by automatically marking products as featured based on specific conditions, such as category, price, or custom logic.

Normally, you’d mark WooCommerce products as featured by logging into wp-admin and clicking the “star” icon in the Products table. But what if you could automate this without clicking anything?

Thankfully, WooCommerce provides a filter hook that allows you to override the featured status on the fly. This means you can apply rules programmatically while keeping your admin time at zero.

Here’s how you can achieve this with a simple PHP snippet!

Continue reading WooCommerce: Programmatically Mark Products As Featured

WooCommerce: Sticky Product “Update” Button @ WP Admin

In the WooCommerce product edit / add new product screen, the “Publish” / “Update” button is crucial for saving changes.

However, when editing long product descriptions, adding images, or configuring variations, the button can disappear as you scroll down. This forces users to scroll back up every time they need to save, which can be frustrating and time-consuming.

A simple solution is to make the button sticky, ensuring it remains visible no matter how far you scroll. With a small CSS snippet, you can fix the button’s position in the middle of the screen, improving workflow efficiency and reducing unnecessary clicks.

In this post, I’ll share a quick code snippet that achieves this with minimal effort. Whether you’re managing a large WooCommerce store or simply looking for a more convenient editing experience, this tweak can make a big difference. Let’s dive into the code and make your “Publish” / “Update” button always accessible!

Continue reading WooCommerce: Sticky Product “Update” Button @ WP Admin

WooCommerce: Filter Products By Sale Status @ WP Dashboard

Managing a WooCommerce store means keeping a close eye on your product pricing, especially when running promotions or sales. However, sorting through hundreds or even thousands of products to find those with active sale prices can be a tedious task using the default WordPress admin interface.

Imagine being able to quickly filter your product list to display only items that are currently on sale, allowing you to streamline your updates and promotional strategies…

In this post, I’ll show you how to enhance your WooCommerce admin panel with a simple PHP snippet that adds a custom filter for sale status.

This solution not only saves you time but also simplifies inventory management, making it easier to plan marketing campaigns and update product details efficiently. Let’s dive into the code and get started!

Continue reading WooCommerce: Filter Products By Sale Status @ WP Dashboard

WooCommerce: Allow Only Simple Products

WooCommerce stores that exclusively sell simple products can benefit from a cleaner backend by removing unused product types like variable, grouped, and external products. Simplifying the product editor and backend product listings not only declutters the interface but also reduces the chances of store managers making mistakes when adding or managing products.

With fewer options to navigate, the product management workflow becomes more efficient and user-friendly. Store managers can focus solely on the essentials, without being distracted by unnecessary settings or product types that aren’t relevant to the store. This is especially useful for teams managing a high volume of products or multiple users accessing the store backend.

By restricting WooCommerce to simple products only, you can create a focused environment that improves accuracy and reduces confusion. Below, we’ll share useful snippets to help you remove unnecessary options and tailor WooCommerce to simple products exclusively.

Continue reading WooCommerce: Allow Only Simple Products

WooCommerce: Duplicate Order @ WordPress Dashboard

In WooCommerce, the ability to quickly duplicate orders can save time when managing repeat purchases or creating similar orders. However, this feature isn’t available by default. While plugins exist to add it, they can be complex or overengineered for simple use cases.

This custom PHP snippet adds a “Duplicate” button to the order actions in the WordPress dashboard. It duplicates the order directly in the database wherever possible, offering a lightweight solution without unnecessary overhead.

If you need a practical and efficient way to duplicate WooCommerce orders directly from the “Orders” admin page, this approach offers a tailored solution that integrates seamlessly with your existing workflow.

Continue reading WooCommerce: Duplicate Order @ WordPress Dashboard

WooCommerce: Remove “Payments” From WordPress Sidebar Admin Menu

The “Payments” tab in the WordPress admin sidebar menu, introduced in newer versions of WooCommerce, is designed to provide a centralized and streamlined management interface for handling payment-related settings and configurations.

Another significant reason for this tab is to promote WooPayments, the platform’s native payment solution. This service integrates tightly with WooCommerce and offers seamless checkout experiences, built-in subscriptions, and real-time payment tracking.

So, if you’ve always wanted to get rid of it, here’s a quick snippet that will do the trick! Don’t worry — it’s simple, efficient, and won’t require you to install any extra plugins. Let’s dive into the code and clean up the admin sidebar in just a few minutes!

Continue reading WooCommerce: Remove “Payments” From WordPress Sidebar Admin Menu

WooCommerce: Add Custom Badge To Featured Products @ Shop Page

If you’ve ever wanted to customize how WooCommerce featured products appear on your classic product grid (Shop, Category, Tag, archive, search, shortcode pages) or Product Collection block, you’re in the right place!

For example, adding a custom label gives your featured products the attention they deserve and helps them stand out, catching the eye of your shoppers. Amazon does that, for example.

Whether you want to create a sleek, minimalist tag or a bold, colorful banner, a bit of custom code can transform your product display and enhance your store’s design.

In this guide, you’ll discover how to add a fully customizable label specifically for featured products in WooCommerce. With a simple CSS code snippet, you can take control of your shop’s visual identity. Read on to find the solution and start enhancing your store today!

Continue reading WooCommerce: Add Custom Badge To Featured Products @ Shop Page

WooCommerce: How to Split Orders After Purchase

Splitting WooCommerce orders programmatically can be incredibly useful for store owners who need to manage complex workflows.

Whether you’re dealing with pre-orders, dropshipping, or simply organizing items for multiple shipments, dividing an order based on its products ensures smoother operations and a better customer experience.

However, splitting an order isn’t just about separating items; replicating crucial details like payment methods, shipping methods, and totals is equally important to maintain consistency.

In this tutorial, we’ll explore how to programmatically split orders in WooCommerce, ensuring that cloned orders include all relevant details from the original, such as payment method, order status, and billing and shipping addresses.

By the end of this guide, you’ll have a robust solution to automate order splitting directly in your WooCommerce store. Let’s dive into the code and get started!

Continue reading WooCommerce: How to Split Orders After Purchase

WooCommerce: Display Only Products On Sale @ Shop

In my own WooCommerce shop, for Black Friday, I wanted to send customers directly to the Shop page showcasing only items on sale. To my surprise, WooCommerce doesn’t provide a built-in way to sort products by “on sale” out of the box.

This led me to explore a solution that not only solved the problem but also added a new sorting option to the WooCommerce Shop page dropdown.

Now, with a simple code snippet, you can enable a “Sort by On Sale” feature, or even use the “orderby=on_sale” parameter with your Shop page URL to show sale items effortlessly!

Continue reading WooCommerce: Display Only Products On Sale @ Shop

WooCommerce: Edit “x customer reviews” String @ Single Product Page

WooCommerce is a powerful ecommerce platform that offers a robust review system to help businesses build trust and credibility.

While WooCommerce provides a default review display, you may want to customize it to fit your specific needs. This tutorial will guide you through the process of editing the “x customer reviews” text on a single product page.

By following these steps, you can tailor your product review display to match your brand’s aesthetic and provide a more engaging shopping experience for your customers.

Continue reading WooCommerce: Edit “x customer reviews” String @ Single Product Page