Quickly Anonymize Customer and Order Data in WooCommerce

In a recent Business Bloomer Club discussion, a member asked if there’s an efficient way to anonymize customer and order data across their WooCommerce store. While WooCommerce includes GDPR compliance features that allow manual anonymization for individual users, it lacks a bulk anonymization function.

This article explores solutions, including custom code options to anonymize all customer and order data quickly, especially useful when creating a staging environment.

Continue reading Quickly Anonymize Customer and Order Data in WooCommerce

Displaying Order Language in WooCommerce Backend Using WPML

In a recent Business Bloomer Club thread, a member asked how to display the language in which an order was placed in the WooCommerce backend, specifically in the order list or single order page.

This feature can be useful for managing orders across multiple languages in a WooCommerce store that uses WPML for multilingual capabilities. Below, we’ll explore ways to retrieve and display the order language, including a solution that leverages order meta fields.

Continue reading Displaying Order Language in WooCommerce Backend Using WPML

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, 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: 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: View Customer Order History on Single Order Admin Page

Viewing the WooCommerce customer’s order history directly on the single order admin page can be incredibly useful when you need quick access to a customer’s past purchases without navigating away from the current order screen.

With a simple PHP snippet, you can add this functionality, enabling you to view previous orders and better understand customer behavior in real time.

This customization not only enhances your workflow but also improves customer service, allowing you to address inquiries more efficiently.

Below, I’ll walk through the steps needed to implement this feature, providing you with the PHP code necessary to display order history details on the order admin page itself.

As always, remember to test customizations in a staging environment to ensure compatibility with your setup!

Continue reading WooCommerce: View Customer Order History on Single Order Admin Page

WooCommerce: Prevent Orders From Blacklisted Email Addresses

In some cases, you may need to block certain customers from completing orders on your WooCommerce store.

This could be due to fraud prevention, policy violations, or simply wanting to prevent repeat offenders from making purchases. Thankfully, WooCommerce provides the flexibility to implement an email blacklist with just a few lines of code.

In this tutorial, I’ll show you how to add a simple email blacklist using a custom function that checks the customer’s email at checkout. By adding these 8 lines of PHP to your theme’s functions.php file, you’ll be able to prevent orders from specific email addresses efficiently. Enjoy!

Continue reading WooCommerce: Prevent Orders From Blacklisted Email Addresses

WooCommerce: Edit Custom Field @ Order Admin

Adding a custom field to your WooCommerce checkout is a breeze. It’s a fantastic way to collect extra information from your customers. It could be a custom Billing field, a Shipping field, or a completely unrelated custom field.

But while you can easily view the custom field data in the backend, editing it directly from the order admin is a frustratingly locked feature. This presents a significant challenge for businesses needing to modify order details post-purchase.

Luckily, a bit of custom code can fix this, giving you the flexibility and control you need to manage your orders effectively.

Let’s dive in and explore how to overcome this hurdle. Enjoy!

Continue reading WooCommerce: Edit Custom Field @ Order Admin

WooCommerce: How to Sync Products, Stock and Orders Between Several Stores

Running multiple WooCommerce stores can be a recipe for success, but keeping your products and stock levels synchronized across them can quickly turn into a nightmare.

Imagine the frustration of a customer trying to buy a product that shows “in stock” in one store, only to find it out of stock when they checkout. Yikes.

But fear not! This tutorial is your guide to conquering inventory chaos with product and stock syncing. We’ll dive into the amazing benefits of syncing your WooCommerce stores (e.g. products, stock, orders, etc.) so you can streamline your operations and watch your sales grow.

This multi-store functionality typically requires the use of additional plugins or services designed to manage multiple WooCommerce sites – one such solution is the WooMultistore plugin.

Continue reading WooCommerce: How to Sync Products, Stock and Orders Between Several Stores

WooCommerce: Retrieve Paid Orders Only

The wc_get_orders function is the recommended method for fetching orders in WooCommerce due to its flexibility, safety, and adherence to best practices. It offers several advantages over using custom WP_Query or database queries. It’s also HPOS compatible.

You can specify various arguments to filter orders based on properties like status (pending, completed, on-hold, etc.), customer (ID, email), date range, order IDs, payment method, total, custom fields and more.

Today, I’d like to talk about paid orders – at the moment there is no way to filter out free orders with a wc_get_orders parameter, so we need to find a workaround.

My solution uses the “payment_method” parameter, which accepts a payment method ID (cheque, bacs, afterpay, paypal, stripe, woocommerce_payments, ppcp-gateway, klarna_payments, etc. based on the payment gateway plugins you use). Clearly, an order that comes with a specific payment method is a paid order.

Unfortunately you can only select one payment method (as opposed to an array), so we also need to do some array merging. Enjoy!

Continue reading WooCommerce: Retrieve Paid Orders Only

WooCommerce: Set Different Currency For Manual Orders

Business Bloomer website sells in USD only for the time being, as that seems to be the standard for WordPress plugin / products stores.

However, I prefer to invoice clients in EUR (I also switch PayPal and Stripe keys on the go). Which means, I needed to find a way to “set” a different currency whenever I create a manual order (which, by default, is in USD). So, here’s the fix!

Continue reading WooCommerce: Set Different Currency For Manual Orders

WooCommerce Cart item data from an external API?

I would like to save metadata in each item in the cart (collecting item data from an external API) and I would like this data to be maintained in the order.

I’m not interested in viewing it because it’s a metadata that serves me in the backend to process the order in the internal ERP.

Are there already any example snippets that can help me?

WooCommerce: Create Order From Contact Form Submission

So, I’ve built my own event management system for WooCommerce.

My objective was to embed a form on the event registration page, and then programmatically create a free WooCommerce order for that customer – so I can track the number of attendees (orders) and follow up with email automations (customers).

You can already see the system in action on the How to Contribute to WooCommerce Core” event page: you can clearly see an email input and a “Register Now” button inside the “You’re invited” section. That’s the form – actually a Fluent Forms plugin contact form.

And then there is a simple snippet that hooks into the Fluent Form submission, and conditionally generates a WooCommerce order.

In this post, you’ll learn about a quick way to create a Fluent Forms form on your WordPress site, about the “fluentform/validate_input_item_input_email” hook, and finally about the wc_create_order() WooCommerce function that, of course, let us generate an order automatically. Enjoy!

Continue reading WooCommerce: Create Order From Contact Form Submission

WooCommerce: Order Number Prefix / Suffix

As you know WooCommerce uses the “order ID” (which is also the ID of the order post in the database) as the order number. This displays in the “WooCommerce” > “Orders” table, on each line of the order, under the “Order ” column, as well as the order “quick view” window, the single order page and the customer’s My Account page.

But what if you need to add a prefix or a suffix to this number, so that this is in line with your business or invoice requirements?

Here’s the fix – enjoy!

Continue reading WooCommerce: Order Number Prefix / Suffix

Where to find the WooCommerce order source?

In Shopify, there’s an option to view the source of each order, specifically showing the last external link clicked before the purchase. This is useful for tracking where customers are coming from and measuring marketing performance.

So how can one see order attribution in WooCommerce based on the Last Click criteria? WooCommerce doesn’t provide this feature natively ***, but it does offer flexibility through plugins and custom scripts.

Is there a way to bring this information into WooCommerce Analytics or to generate a report like this in WooCommerce? There are certainly options to explore, but finding the right approach depends on your specific needs and setup.

Continue reading Where to find the WooCommerce order source?