Skip to content

Commerce Foundations is our pre-built Craft Commerce store. See what it includes

Craft CMS plugins

Best Sellers

Essential sales insights and top-performing product data for Craft Commerce stores.

Getting started

This page walks you from composer require to a dashboard showing your sales history.

1. Install#

composer require fostercommerce/commerce-best-sellers
./craft plugin/install best-sellers

A Best Sellers item appears in the control panel nav. Open it. The dashboard shows a notice linking to the backfill utility, and the Products report shows zero.

The plugin records orders placed after it is installed, into its own sales data and daily stats. Your existing orders need a backfill. For which reports depend on it, see data and backfill.

2. Backfill your order history#

./craft best-sellers/backfill
./craft best-sellers/backfill/daily-stats

The first command queues your completed orders. The second builds the daily stats that the dashboard’s KPI cards and charts read.

Each command prints how much it queued.

3. Run the queue#

./craft queue/listen

Leave it running until the queue is empty. On a store with tens of thousands of orders, this step takes longest.

Craft also runs pending jobs during control panel requests, so the backfill advances while you use the control panel, but more slowly than with a worker.

4. Read the dashboard#

Reload Best Sellers -> Dashboard. The notice is gone and the KPI cards show numbers.

Set the date range to All Time to confirm the backfill included your oldest orders. If the earliest months show fewer orders than expected, see troubleshooting.

Change the range back to Past 30 Days. Every report page except Operations shares this control, along with an order status filter and a shipping locations filter, and your selection stays set from page to page. See filters and report pages.

5. Set the defaults for your team#

At Best Sellers -> Settings, set Default order statuses to the statuses reports start on for a user’s first visit in a session.

To report gross profit, add a Money field to your variants, then choose it for each product type on the Product Types tab. See unit costs and profit.

Then grant your team the permissions under a user group’s Best Sellers heading. See permissions.

Where to go next#

  • Dashboard, what each KPI card measures and which filters apply to it
  • Products, how the sales figures are calculated
  • Data and backfill, how the tables stay current and how to rebuild them
  • Templating, reading sales data from Twig

We can take it from here.

We take on the Craft and Craft Commerce sites you built, so you can get back to building. Introduce a client who signs a management contract and you get a $3,000 partnership fee.

How the Dev Partnership Program works
See if we’re a fit