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.

Console commands

All of these are also available at Utilities -> Best Sellers, except clear-logs, which is on the Operations page. The console commands do not check permissions.

Command What it does
best-sellers/backfill Queues every completed order for processing, in batches of 25. Already-recorded orders are skipped, so re-running does not double-count.
best-sellers/backfill/refresh-orders Deletes the recorded sales data, then queues the orders again.
best-sellers/backfill/clear-orders Clears the sales data without queueing a rebuild.
best-sellers/backfill/fill-unit-costs Queues completed orders to add unit costs to lines with no unit cost, from each variant’s current cost. See data and backfill.
best-sellers/backfill/daily-stats Rebuilds daily stats from Commerce’s orders, over the range detected from your earliest and latest completed order.
best-sellers/backfill/refresh-daily-stats Clears daily stats before rebuilding.
best-sellers/backfill/clear-daily-stats Clears the daily stats without queueing a rebuild.
best-sellers/backfill/clear-logs Deletes every backfill log entry.

Options#

--start-date and --end-date scope backfill, refresh-orders, and fill-unit-costs to a range. Both are YYYY-MM-DD in the site’s timezone, and the range includes both days. Give both: one on its own is ignored. On refresh-orders they also narrow what is deleted.

--product-types limits fill-unit-costs to product types by handle, comma-separated. Without it, the command fills every product type with a unit cost field. It exits with an error when none of the named product types has a unit cost field.

--date scopes daily-stats and refresh-daily-stats to one day, and that day is rebuilt immediately rather than queued.

./craft best-sellers/backfill --start-date=2025-01-01 --end-date=2025-12-31
./craft best-sellers/backfill/daily-stats --date=2026-03-15
./craft best-sellers/backfill/fill-unit-costs --product-types=apparel,accessories

Queue#

backfill, refresh-orders, fill-unit-costs, and the two daily stats rebuilds without --date push queue jobs. The reports do not change until a queue worker runs those jobs. The clear- commands and the --date rebuilds run in the console process.

./craft queue/listen

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