2 Easy ways to get WooCommerce sale reports by state?

sale reports by state
Table of Contents

Analyzing different types of sales reports is a critical task of store managers helping them to make proper and on-time decisions for their business success. One of the most important sales reports that has a great impact on manager decisions for the growth and development of their online store is the WooCommerce sale reports by state. 

By evaluation and analysis of this report, managers can quickly check the amount of sales in different states and determine which products have the most sales in each. By preparing this report, they can also identify those states with lower sales and make effective decisions for running marketing campaigns to improve their shop performance.

In this post, we will show you two practical methods to get WooCommerce sale reports by state. Let’s see how easily you can have a deep insight into the performance of your online shop in each state.

What is WooCommerce sale reports by state?

WooCommerce sales report by state helps you understand customer behavior and their needs in different states. In this report, you can see the amount of sales in each province separately and you can plan strategies for business development and targeted marketing.

Reviewing the product sale reports by state WooCommerce free, enables you to check the amount of product sales in different states and run marketing campaigns for the products with the lowest income. In addition, WooCommerce report by state lets you monitor the sales and overall performance of your store.

products report by state WooCommerce sales plays an important role in marketing processes. But WooCommerce doesn’t give you this calculation by default within its report options! Therefore, you should use coding or the WooCommerce report plugin to get the WooCommerce report by state.

Get WooCommerce sale reports by state programmatically

If you want to get WooCommerce sale reports by state programmatically, place the quick snippet below in functions.php and custom CSS in style.css of your child theme.

This is a useful code for generating the total sales amount of your orders in each state as a list in a second. If you need to customize the code, it is easily possible to change the year, the country, and the states in the snippet.

/**
* @snippet   Get Sales by State @ WooCommerce Admin
* @author    Rodolfo Melogli
* @testedwith WooCommerce 8
* @donate $9     https://businessbloomer.com/bloomer-armada/
 */

// -----------------------
// 1. Create "Sales by State" submenu page
add_action( 'admin_menu', 'it_wp_dashboard_woocommerce_subpage', 9999 ); 
function it_wp_dashboard_woocommerce_subpage() {
  add_submenu_page( 'woocommerce', 'Sales by State', 'Sales by State', 'manage_woocommerce', 'bb_sales_by_state', 'it_yearly_sales_by_state', 9999 );
}

// -----------------------
// 2. Calculate sales for all states
function it_yearly_sales_by_state() {
  $year = 2023;
  $sales_by_state = array();
  echo "<h3>Sales by State For Year {$year} ($)</h3>";
      'billing_country' => 'US', // COUNTRY
      'limit' => -1,
      'return' => 'ids',
      'date_created' => strtotime( "first day of january " . $year ) . '...' . strtotime( "last day of december " . $year ),
  );
  $orders = wc_get_orders( $args );
  foreach ( $orders as $order_id ) {
      $order = wc_get_order( $order_id );
      $sales_by_state[$order->get_billing_state()] = isset( $sales_by_state[$order->get_billing_state()] ) ? $sales_by_state[$order->get_billing_state()] + $order->get_total() : $order->get_total();
  }
  echo '<pre style="font-size: 16px">';
  ksort( $sales_by_state );
  print_r( $sales_by_state );
  echo '</pre>';
  }

By running this code, you will see the “Sales by State” submenu in the WooCommerce tab. So, to get WooCommerce sales report by state, simply click on this option to see the total amount of sales for each state as illustrated below.

Get WooCommerce sale reports by state programmatically

To make the PHP code work properly, consider the below points:

  • Back up your website before running this code.
  • If you don’t have any knowledge about running PHP code, ask an expert or ignore this method and use the WooCommerce report plugin instead.
  • To prevent any conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and run the snippet. 
  • This code snippet works properly with all WooCommerce versions offering reports or analytics sections. However, in case of any problem, disable WooCommerce analytics and run the code again.
  • If the report causes the array_merge error, replace the below line:
$reports['orders']['reports'] = array_merge($reports['orders']['reports'],$array);

With this:

if (isset($reports['orders']) && is_array($reports['orders']['reports']) && is_array($array)) {  $reports['orders']['reports'] = array_merge($reports['orders']['reports'],$array); }

Use WooCommerce report plugin to get WooCommerce report by state

Many website managers who are looking for a quick solution to generate WooCommerce sales reports by state and make better decisions for their online shops are using the WooCommerce report plugin. Because this plugin allows you to generate any type of sales report you need with one click.

In the following, we will show you how to get help from this plugin to generate WooCommerce reports by state in three simple steps.

Step 1: Install the WooCommerce report plugin

If you want to use the advanced features of this sale report by state WooCommerce plugin, first you need to download and then install it on your WordPress website.

After activation, click on the iT Woo Report menu in the WordPress dashboard to get to the main page of the plugin. 

Install the WooCommerce report plugin

On this page, you can find a list of all required reports in the left panel which are divided into different categories like Orders, Products, Customers, etc. This makes the process of generating report much easier for you. You can simply open one of the categories, find the exact report you need in the submenu, and generate the report with one click.

WooCommerce Report Plugin banner

Now let’s review these simple steps for generating WooCommerce sales reports by state.

Step 2: Generate WooCommerce sales report by state

The user-friendly interface of the WooCommerce report plugin made generating various types of sale report by state WooCommerce quick and smooth for store managers. To better show you how to use this order report by state WooCommerce plugin, let’s make some examples.

Example 1: Get ordered by state in the WooCommerce report plugin

Follow the below instructions to get order report by state WooCommerce in this plugin:

  1. Open the Order tab and click on the All Orders submenu. 
select all orders section in orders menu
  1. On this page, press the Search icon to open the Filter Form.
  2. Set Date from and Date to fields using the built-in calendar in the plugin.
set date range in orders filter form
  1. Locate the State field and choose the state you want to get the order report from the list –London in this example.
  2. Set other filters if you need them (optional).
  3. Press the Search button.

You have successfully generated an order report by state in the WooCommerce report plugin.

As you can see in the below picture, all the information you need is reported in different columns of a table, including:

  • Order Id: The specific order number assigned by WooCommerce. 
  • Name: The first name of the customer in the billing form.
  • Customer: The last name of the customer in the billing form.
  • Email: Customer email address.
  • Phone No.: Customer Phone number.
  • Date: The date of placing the order.
  • Country: The country of order.
  • State: The state of order, which is London in this example.
  • Status: The order status like complete, processing, on hold, refunded, etc.
  • Payment Method: The payment method that the customer chooses for the order.
  • Coupon code: The discount coupon code used in the order by the customer. 
  • Products: The products ordered by customers.
  • SKU: The SKU of products. 
  • Category: The product category. 
  • Variation: The product variation.
  • Qty.: Total quantity of products ordered by customers.

There is also a summary report at the bottom of the table, which provides you with brief information about the order sales, which are the Total number of orders, Total number of products, Total quantity of products, Total amount of orders, Total discounts, and Net amount of orders.

This is useful when you want to have brief information about the performance of your online shop in the selected state. 

Example 2: Get product sale report by state WooCommerce 

To generate a product sale report by state WooCommerce free, try the below steps:

  1. Go to the Cross tab and choose Product/State report.
select product and state section in cross tab
  1. Open the Filter Form by pressing the Search button.
  2. Set From Date and Do date by using the built-in calendar.
  3. Set other filters if you need (optional).
  4. Press the Search button.
set status of product in filter form

The result of this product report by state WooCommerce sales is a list of all products and their sales amount in different states, which are reported in separate columns of the table.

result products per state report

Step 3: Customize the order report by state in the WooCommerce report plugin

Despite generating sales reports by state, the WooCommerce report plugin comes with many tools for customizing the reports.

Here, you can get familiar with some of them:

Customize the report Columns

There is a Select column field on top of the table reports, allowing you to display/ hide the columns in your report.

You can easily open the select columns form and mark those fields you want to be included in the report:

Customize the report Columns in WooCommerce

Filter the sales report by state based on WooCommerce fields

As we mentioned above, you can use a Filter Form in each report to instruct the plugin to show your required data in the report.

For example, if you use the Filter Form of product sale report by state WooCommerce (Example 2) and set London in the State field:

Filter the sales report by state based on WooCommerce fields

The data reported in the table is just related to this state, including:

  • Product SKU
  • Product Name
  • Category
  • Total
result products per state London report
WooCommerce Report Plugin banner

Extra features of ordered by state WooCommerce plugin

In addition to customization options, there are some extra features available in the sale report by state WooCommerce plugin. Let’s get familiar with some of them:

Export WooCommerce sales report by state to CSV, XLS or PDF

Exporting tools are designed on top of the table report, allowing you to download the WooCommerce sales report by state in the below formats:

  • CSV
  • Excel
  • Pdf
Export WooCommerce sales report by state to CSV, XLS or PDF

You can also print the report directly if you need a hard copy.

Search in ordered by state WooCommerce plugin report

Another useful feature enabling you to look for specific data in your report is the Search box. You can type any information like state name, product name, customer name, etc. To instruct the plugin, show the information about it in the table report.

Search in ordered by state WooCommerce plugin report

Conclusion

The most successful store managers looking for a professional tool to get WooCommerce sale reports by state use the WooCommerce report plugin. This order report by the state WooCommerce plugin provides valuable information about the sales performance of online stores and lets store managers grow and develop their businesses by making proper decisions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha loading...