PHPackages                             fostercommerce/commerce-best-sellers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fostercommerce/commerce-best-sellers

ActiveCraft-plugin

fostercommerce/commerce-best-sellers
====================================

1.1.2(1mo ago)0359↓38.2%proprietaryPHPPHP &gt;=8.2CI passing

Since Mar 29Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/FosterCommerce/commerce-best-sellers)[ Packagist](https://packagist.org/packages/fostercommerce/commerce-best-sellers)[ RSS](/packages/fostercommerce-commerce-best-sellers/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (14)Versions (17)Used By (0)

[![Screenshot](resources/images/header.png)](resources/images/header.png)

Best Sellers
============

[](#best-sellers)

Essential sales insights and top performing product data

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 5.0.0 or later, and PHP 8.2 or later.

Installation
------------

[](#installation)

You can install this plugin from the Plugin Store or with Composer.

#### From the Plugin Store

[](#from-the-plugin-store)

Go to the Plugin Store in your project’s Control Panel and search for “Best Sellers”. Then press “Install”.

#### With Composer

[](#with-composer)

Open your terminal and run the following commands:

```
# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require fostercommerce/commerce-best-sellers

# tell Craft to install the plugin
./craft plugin/install best-sellers
```

Usage
-----

[](#usage)

#### Console command to process existing orders

[](#console-command-to-process-existing-orders)

```
php craft best-sellers/backfill

```

#### Twig

[](#twig)

```
# product's total sales (all time)
{{ craft.bestsellers.productTotalSales(product.id) }}

# product's total sales (last 2 weeks)
{{ craft.bestsellers.productTotalSales(product.id, '2 weeks ago') }}

# variant's total sales (all time)
{{ craft.bestsellers.variantTotalSales(product.defaultVariant.id) }}

# variant's total sales (specific date range)
{{ craft.bestsellers.variantTotalSales(product.defaultVariant.id, '2023-01-01', '2023-03-01') }}

```

#### PHP

[](#php)

```
use fostercommerce\bestsellers\variables\BestSellersVariable;
$bestSellers = new BestSellersVariable();
// product's total sales (all time)
$productSales = $bestSellers->productTotalSales($product->id);
// product's total sales (last 2 months)
$productSales = $bestSellers->productTotalSales($product->id, '2 months ago');
// variant's total sales (all time)
$variantSales = $bestSellers->variantTotalSales($product->defaultVariant->id);
// variant's total sales (specific date range)
$variantSales = $bestSellers->variantTotalSales($product->defaultVariant->id, '2023-01-01', '2023-03-01');
```

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance85

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~72 days

Recently: every ~90 days

Total

6

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ac5b96165dd51aed8f0b9ea079d5d5beeb430a915cd07d645db0a228b0ac3aa?d=identicon)[fostercommerce](/maintainers/fostercommerce)

---

Top Contributors

[![peteeveleigh](https://avatars.githubusercontent.com/u/827065?v=4)](https://github.com/peteeveleigh "peteeveleigh (29 commits)")[![sjcallender](https://avatars.githubusercontent.com/u/984311?v=4)](https://github.com/sjcallender "sjcallender (8 commits)")[![johnnynotsolucky](https://avatars.githubusercontent.com/u/4161106?v=4)](https://github.com/johnnynotsolucky "johnnynotsolucky (3 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/fostercommerce-commerce-best-sellers/health.svg)

```
[![Health](https://phpackages.com/badges/fostercommerce-commerce-best-sellers/health.svg)](https://phpackages.com/packages/fostercommerce-commerce-best-sellers)
```

###  Alternatives

[verbb/image-resizer

Resize assets when they are uploaded.

127269.1k7](/packages/verbb-image-resizer)[verbb/workflow

Enforce multi-step review processes for creating entries.

138120.3k1](/packages/verbb-workflow)[verbb/events

A full-featured plugin for event management and ticketing.

2311.7k](/packages/verbb-events)[craftcms/shopify

Shopify for Craft CMS

549.2k1](/packages/craftcms-shopify)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
