PHPackages                             dvizh/yii2-shop - 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. [Admin Panels](/categories/admin)
4. /
5. dvizh/yii2-shop

ActiveYii2-extension[Admin Panels](/categories/admin)

dvizh/yii2-shop
===============

yii2-shop it's a module for site shop backend

311.2k[7 issues](https://github.com/dvizh/yii2-shop/issues)PHP

Since Jul 28Pushed 8y ago2 watchersCompare

[ Source](https://github.com/dvizh/yii2-shop)[ Packagist](https://packagist.org/packages/dvizh/yii2-shop)[ RSS](/packages/dvizh-yii2-shop/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Yii2-shop
=========

[](#yii2-shop)

Модуль представляет из себя бекенд для Интернет-магазина.

[![yii2-shop](https://cloud.githubusercontent.com/assets/8104605/15448447/751a647a-1f7b-11e6-87e7-c7354306f10e.png)](https://cloud.githubusercontent.com/assets/8104605/15448447/751a647a-1f7b-11e6-87e7-c7354306f10e.png)

В состав входит возможность управлять (CRUD):

- Категориями
- Производителями
- Товарами
- Ценами
- Фильтрами (опциями)
- Дополнительными полями

Если есть необходимость, можно также подтянуть мои другие модули:

- [dvizh/yii2-cart](https://github.com/dvizh/yii2-cart) - корзина
- [dvizh/yii2-order](https://github.com/dvizh/yii2-order) - заказ
- [dvizh/yii2-promocode](https://github.com/dvizh/yii2-promocode) - промокоды

Установка
---------

[](#установка)

Рекомендую устанавливать в common/modules/dvizh:

```
git clone https://github.com/dvizh/yii2-shop.git

```

И подключать через psr-4 секцию composer.json:

```
"autoload": {
    "psr-4": {
        "dvizh\\shop\\": "common/modules/dvizh/yii2-shop"
    }
}

```

Модуль зависит от многих других пакетов, скопируйте их из моего в свой composer.json в секцию require. После этого не забудьте выполнить composer update и миграции каждого модуля.

Если хотите установить в папку vendor через composer и ничего не менять потом, устанавливайте стандартно: 'php composer require dvizh/yii2-shop "@dev"' в командной строке.

Миграция:

```
php yii migrate --migrationPath=vendor/dvizh/yii2-shop/src/migrations

```

Настройка
---------

[](#настройка)

В конфиг (скорее всего, bootstrap.php) добавить:

```
Yii::setAlias('@storageUrl','/frontend/web/images');

```

В секцию modules конфига добавить:

```
    'modules' => [
        //..
        'shop' => [
            'class' => 'dvizh\shop\Module',
            'adminRoles' => ['administrator', 'superadmin', 'admin'],
            'defaultPriceTypeId' => 1, //Цена по умолчанию
        ],
        'filter' => [
            'class' => 'dvizh\filter\Module',
            'adminRoles' => ['administrator'],
            'relationFieldName' => 'category_id',
            'relationFieldValues' =>
                function() {
                    return \dvizh\shop\models\Category::buildTextTree();
                },
        ],
        'field' => [
            'class' => 'dvizh\field\Module',
            'relationModels' => [
                'dvizh\shop\models\Product' => 'Продукты',
                'dvizh\shop\models\Category' => 'Категории',
                'dvizh\shop\models\Producer' => 'Производители',
            ],
            'adminRoles' => ['administrator'],
        ],
        'relations' => [
            'class' => 'dvizh\relations\Module',
            'fields' => ['code'],
        ],
        'gallery' => [
            'class' => 'dvizh\gallery\Module',
            'imagesStorePath' => dirname(dirname(__DIR__)).'/storage/web/images/store',
            'imagesCachePath' => dirname(dirname(__DIR__)).'/storage/web/images/cache',
            'graphicsLibrary' => 'GD',
            'placeHolderPath' => dirname(dirname(__DIR__)).'/storage/web/images/placeHolder.png',
        ],
        //..
    ]

```

В секцию components:

```
    'components' => [
        //..
        'fileStorage' => [
            'class' => '\trntv\filekit\Storage',
            'baseUrl' => '@storageUrl/source',
            'filesystem'=> function() {
                $adapter = new \League\Flysystem\Adapter\Local(dirname(dirname(__DIR__)).'/frontend/web/images/source');
                return new League\Flysystem\Filesystem($adapter);
            },
        ],
        //..
    ]

```

Использование
-------------

[](#использование)

- ?r=shop/product - продукты
- ?r=shop/category - категории
- ?r=shop/producer - производители
- ?r=filter/filter - фильтры (опции)
- ?r=field/field - доп. поля

Виджеты
-------

[](#виджеты)

- dvizh\\shop\\widgets\\ShowPrice - передается 'model', выводит цену. Связан с dvizh\\cart\\widgets\\ChangeOptions через jQuery триггер и может определять, какая модификация выбрана и динамически менять цену.

Пример карточки товара со всеми виджетами магазина и корзины, которые работают сообща и динамически меняют данные друг-друга.

```

    Shop

        ShowPrice

    Cart

            ChangeCount

            ChangeOptions

            BuyButton

            TruncateButton

            CartInformer

            ElementsList

        .block {
            border: 2px solid blue;
        }

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.3% 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://avatars.githubusercontent.com/u/8104605?v=4)[pistol88](/maintainers/pistol88)[@pistol88](https://github.com/pistol88)

---

Top Contributors

[![pistol88](https://avatars.githubusercontent.com/u/8104605?v=4)](https://github.com/pistol88 "pistol88 (40 commits)")[![Deadly299](https://avatars.githubusercontent.com/u/10967614?v=4)](https://github.com/Deadly299 "Deadly299 (15 commits)")[![halumein](https://avatars.githubusercontent.com/u/5361342?v=4)](https://github.com/halumein "halumein (13 commits)")[![Chagmar](https://avatars.githubusercontent.com/u/21173072?v=4)](https://github.com/Chagmar "Chagmar (3 commits)")[![PROloggg](https://avatars.githubusercontent.com/u/25814457?v=4)](https://github.com/PROloggg "PROloggg (2 commits)")[![mixartemev](https://avatars.githubusercontent.com/u/5181924?v=4)](https://github.com/mixartemev "mixartemev (1 commits)")[![nn250495](https://avatars.githubusercontent.com/u/19989765?v=4)](https://github.com/nn250495 "nn250495 (1 commits)")

### Embed Badge

![Health badge](/badges/dvizh-yii2-shop/health.svg)

```
[![Health](https://phpackages.com/badges/dvizh-yii2-shop/health.svg)](https://phpackages.com/packages/dvizh-yii2-shop)
```

PHPackages © 2026

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