All posts in WooCommerce

How to Bulk Refund Orders in WooCommerce Programmatically

While running your WooCommerce store it might become necessary to refund a large number of customer orders.
Refunding an order is possible via the WordPress dashbord, but if the number of orders is more than 100 you might want to do this programmatically using a script and WP CLI.

Here are some examples of why you might need to refund large numbers of orders:

  • An online class is cancelled.
  • Vendor did not deliver stock.
  • Product stock was incorrect and items were oversold.
  • Product price has changed and partial refund will be given to customers.

For this how to you’re going to need shell or ssh access to the server you’ll be working on. In this post I’m going to share parts of a script we use to bulk refund large numbers of WooCommerce orders programmatically.

  1. Get input for the script
  2. WooCommerce Helper Functions
  3. Organizing the WP CLI script
  4. Programmatically refunding a WooCommerce order
  5. Check the script output

Now, let’s get started with the script!

Read More…

WooCommerce: Stop Adding Pixel Tracking Code to Thank You Page

A common task for ecommerce sites is needing to add a tracking pixel to the Order Completed, or Thank You page of WooCommerce. This pixel will help report data to an external service like Facebook Ads, Google Ads, Pinterest, or a CRM.

Adding a snippet of javascript to the WooCommerce template might seem easy, but it can quickly cause issues with your reporting.

In today’s article I’ll share why the practice of adding code to a template is an issue and how to fix it.

  1. What is Thank You page code
  2. Why adding code to the thank you template is a potential issue
  3. Two alternatives to adding code directly to Thank You page template

Let’s go!

Read More…

WooCommerce Subscriptions: How to Bulk Update Next Payment Date

If you run a WooCommerce Subscriptions site for long enough you will experience a situation where you need to change the Next Payment date for subscriptions. Knowing how to bulk update the next payment date in WooCommerce Subscriptions is a vital tool for developers and shop managers.

In this article I’ll explain how to change the Next Payment date on one or thousands of subscriptions at one time in a few steps:

  1. Why would I need to bulk update next payment date on a subscription?
  2. How to update Next Payment date on a WooCommerce subscription
  3. How to bulk update Next Payment Date in many WooCommerce subscriptions

Let’s get started!

Read More…

How To Test WooCommerce Webhooks

Webhooks is a term used for sending data to a URL when an event happens. An example is when someone subscribes to an email marketing list, the service that manages the list can send data like the subscriber’s name and email to another system like a Customer Relationship Manager.

In this article, you’ll learn how to add and update WooCommerce Webhooks with these

  1. Add WooCommerce Webhook
  2. Test WooCommerce Webhook
Read More…

Remove Default WooCommerce Payment Gateways

By default, WooCommerce 2.2.8 ships with five payment gateways:

  • BACS (Bank Transfer/Wire)
  • Pay by Check (or Cheque)
  • Cash on Delivery
  • PayPal
  • Simplify Commerce

If you want to have only one payment gateway available on the Checkout page, the unused payment gateways can be disabled in the admin settings.

Read More…