PHPackages                             by/best-seller-products - 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. by/best-seller-products

ActiveCraft-plugin

by/best-seller-products
=======================

A plugin to get bestseller products

04PHP

Since Dec 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/bhashkar007/bestsellerproducts)[ Packagist](https://packagist.org/packages/by/best-seller-products)[ RSS](/packages/by-best-seller-products/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

[![](https://github.com/bhashkar007/bestsellerproducts/raw/master/src/icon.svg)](https://github.com/bhashkar007/bestsellerproducts/blob/master/src/icon.svg)

Best Seller Products plugin for Craft CMS 3.x
=============================================

[](#best-seller-products-plugin-for-craft-cms-3x)

Best Seller Product is a Craft CMS plugin that helps you to get best selling products in your Commerce Store.

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

[](#requirements)

- Craft CMS 3.x
- Craft Commerce 2.x

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

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require by/best-seller-products

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Best Seller Products.

Using Best Seller Products
--------------------------

[](#using-best-seller-products)

To simply get a list of best selling product IDs, use :

```
{% set bestSellerProductIds = craft.bestSellerProducts.getBSPIds(limit) %}
{% set bestsellers = craft.products.id(bestSellerProductIds).all() %}

```

To get the Number of Times a product has been bought, use:

```
{% for bsp in craft.bestSellerProducts.getBSP(limit) %}
    {{ bsp.purchasableId }} -- {{ bsp.times_bought }}
{% endfor %}

```

`craft.bestSellerProducts.getBSP(limit)` will return an array cointaing `purchasableId` and `times_bought`

`limit` is the no. of products you would like to get. Default is **10**

---

Brought to you by [Bhashkar Yadav](http://sidd3.com)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/81237c96f024cd781b34acc8b6de40a9ed2668a5d7f988fc2c643bbbdac91897?d=identicon)[bhashkar007](/maintainers/bhashkar007)

---

Top Contributors

[![bhashkar007](https://avatars.githubusercontent.com/u/1473647?v=4)](https://github.com/bhashkar007 "bhashkar007 (3 commits)")

### Embed Badge

![Health badge](/badges/by-best-seller-products/health.svg)

```
[![Health](https://phpackages.com/badges/by-best-seller-products/health.svg)](https://phpackages.com/packages/by-best-seller-products)
```

PHPackages © 2026

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