How a 2017 Code Snippet Became Sales by State

Back in 2017 I was in the middle of a simple content rule I had set for myself: publish one WooCommerce code snippet per week on Business Bloomer. Every week, a new problem and a new piece of code to fix it. One of those weeks, I published a tutorial on how to calculate WooCommerce…

How a 2017 code snippet became Sales by State

Back in 2017 I was in the middle of a simple content rule I had set for myself: publish one WooCommerce code snippet per week on Business Bloomer.

Every week, a new problem and a new piece of code to fix it.

One of those weeks, I published a tutorial on how to calculate WooCommerce sales by state.

That post is where Sales by State started.

The idea wasn’t even mine. Like almost every snippet I’ve ever published, it came from client work.

A client request

A merchant based in the US, selling online to customers in different states, asked me for a WooCommerce customization. They wanted to see their revenue broken down by state.

Simple enough, I thought. Surely WooCommerce already does that somewhere?

Nope, it didn’t.

WooCommerce gives you plenty of reports, but not your sales split by state, province, county or region, whatever it’s called in a given country.

So I had to come up with a workaround: a custom WordPress page with a few dropdowns and a “Generate report” button. Pick your options, click, and get the totals per state.

Not the best “design”, but it got the job done back then:

What I didn’t know at the time is that this is a real “thing”, especially in the US. If you sell to customers in different states, you need to keep an eye on every state you sell to. Go over a certain limit in one of them, and you need to register for sales tax there too.

For a US merchant, knowing your sales by state is not a nice-to-have. It’s how you avoid surprises.

The blog post comments

I published the snippet and moved on to the next week’s problem. But this one kept coming back.

Over time, that post collected about 41 comments and became one of the most popular posts on Business Bloomer. People asked questions, shared their own versions, asked for more options. It was clear a lot of store owners had the same gap my client had.

At some point I decided to turn my code snippets into mini-plugins. A snippet is fine if you’re comfortable pasting PHP into your theme; a plugin is something you install and use.

And when I wrote the list of snippets to convert first, sales by state was near the top.

The plugin sales

The first version of the plugin was released in March 2025, and today it’s a subscription. Looking back at the order history, it’s one of the few plugins in my catalog that kept selling steadily, month after month.

That told me something. There is a real, ongoing need for this kind of report, and it doesn’t go away.

Since then, I’ve shaped it around two groups of people. First, US merchants, for tax purposes, who need to watch their numbers state by state. Second, everyone else. A store in Canada, Australia, Italy or anywhere with states, provinces or regions can use the same report for different reasons: logistics, business decisions, marketing.

Where do my customers actually live? Where should I spend my ad budget? Where is it worth offering faster shipping? A revenue report by state answers all of those.

Why me?

I’ve been in the WooCommerce space since 2011, and I’ve been building my customization blog since 2014. After all those snippets, I know every weakness of core WooCommerce, and I know what can be done to improve it.

Each little snippet was my way of proving one thing: anything is possible with WooCommerce. Sales by State is one more example.

Today the reports work with increased compatibility, and they use the same interface as WooCommerce Analytics, so they feel like part of WooCommerce instead of something bolted on.

Sales by State table in WooCommerce with net and gross sales per state

Not just work

The funny part is that business is not the only thing I care about. There is also family, and there is sport. Keeping all three going at the same time is never easy.

So whenever I have some free time, I try to make one of them happen. My daily schedule is very flexible, and whenever I can, business comes third 🙂

I think that’s healthy. It also means that whatever I build has to be worth the time I take away from the other two.

From a blog post to a… business

Sales by State did well enough, in my eyes, that I decided to purchase salesbystate.com and build a standalone website all about it.

I also got some help, and that let us look beyond WooCommerce. Sales by State now targets other ecommerce software too, like FluentCart, EDD and SureCart, with more on the way. Knowing your sales by state matters to many merchants around the world, whatever platform they sell on.

Three things make us different from the competition: custom threshold alerts, a threshold database, and fast reports. You set the limits that matter to you, you get warned before you cross them, and the numbers show up quickly even on a busy store.

And recently, Sales by State landed on the WooCommerce Marketplace. We’ll see how that goes for us.

Where this goes next

It’s funny to think all of this started with one client request and one weekly blog post in 2017. A custom page with a few dropdowns turned into a plugin, then a subscription, then a website, and now a product on more than one platform.

If you sell online and you’ve ever had to answer “how much did we sell in each state?”, that’s the question I’ve been answering since 2017. I’m still answering it, just with better tools.


Leave a Reply

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

More from the journal

The latest news on sustainability, knitwear and clothing care guides.