PHPackages                             andrewdanilov/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. andrewdanilov/yii2-shop

ActiveYii2-extension

andrewdanilov/yii2-shop
=======================

Yii2 Shop

1.1.2(4y ago)299MITPHPPHP &gt;=5.6.0

Since Nov 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/AndrewDanilov/yii2-shop)[ Packagist](https://packagist.org/packages/andrewdanilov/yii2-shop)[ Patreon](https://www.patreon.com/andrewdanilov)[ RSS](/packages/andrewdanilov-yii2-shop/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (10)Versions (48)Used By (0)

Yii2 Shop
=========

[](#yii2-shop)

Customizable shop module with hierarchical categories, product properties and options, cart, product stickers. Supports i18n.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require andrewdanilov/yii2-shop "~1.1.0"

```

or add

```
"andrewdanilov/yii2-shop": "~1.1.0"

```

to the `require` section of your `composer.json` file.

Then run db migrations, to create needed tables:

```
php yii migrate --migrationPath=@andrewdanilov/shop/console/migrations

```

Do not forget to run migrations after extension updates too.

Usage
-----

[](#usage)

In backend main config `modules` section add:

```
$config = [
    // ...
    'modules' => [
        // ...
        'shop' => [
            'class' => 'andrewdanilov\shop\backend\Module',
            // access role for module controllers, optional, default is ['@']
            'access' => ['admin'],
            // path to user translates, optional, default is '@andrewdanilov/shop/common/messages'
            'translatesPath' => '@common/messages/shop',
            // file manager configuration, optional, default is:
            'fileManager' => [
                'basePath' => '@frontend/web',
                'paths' => [
                    [
                        'name' => 'Product images',
                        'path' => 'upload/images/product',
                    ],
                    [
                        'name' => 'Category images',
                        'path' => 'upload/images/category',
                    ],
                    [
                        'name' => 'Brand images',
                        'path' => 'upload/images/brand',
                    ],
                    [
                        'name' => 'Sticker images',
                        'path' => 'upload/images/sticker',
                    ],
                    [
                        'name' => 'Documents',
                        'path' => 'upload/images/docs',
                    ],
                ],
            ],
        ],
    ],
];
```

Here `access` option allows restricting access to defined roles.

In frontend main config `modules` section and `bootstrap` section add `shop` module:

```
$config = [
    // ...
    'modules' => [
        // ...
        'shop' => [
            'class' => 'andrewdanilov\shop\frontend\Module',
            // path to template views, optional, default is '@andrewdanilov/shop/frontend/views'
            'templatesPath' => '@frontend/views/shop',
            // path to mail template views, optional, default is '@andrewdanilov/shop/common/mail'
            'mailTemplatesPath' => '@common/mail/shop',
            // path to user translates, optional, default is '@andrewdanilov/shop/common/messages'
            'translatesPath' => '@common/messages/shop',
            // main currency, using by shop, optional, default is 'USD'
            'currency' => '$',
        ],
    ],
    // If you use own templates paths, you need to add `shop` module to `bootstrap` section
    // to enable i18n and other settings before using module parts.
    // This is optional, but recommended in any way.
    'bootstrap' => [
        // ...
        'shop',
    ],
];
```

In `common/config/params.php` config file add/modify `adminEmail`, `senderEmail` and `senderName` params like this

```
return [
    // ...
    'adminEmail' => ['admin@example.com', 'admin2@example.com'],
    'senderEmail' => 'noreply@example.com',
    'senderName' => 'Robot',
    // ...
];
```

You will get system messages (i.e., order from site) on one of `adminEmail` e-mails from `senderEmail` e-mail.

To transport e-mail messages you must correctly set up `mailer` component in `common/config/main-local.php`. For example SMTP transport:

```
return [
    'components' => [
        // ...
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'useFileTransport' => false,
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'username' => 'sender@example.com',
                'password' => 'example_password',
                'host' => 'smtp.example.com',
                'port' => '465',
                'encryption' => 'ssl',
            ],
        ],
    ],
];
```

Backend menu items:

```
$shop_menu_items = [
    ['label' => 'Orders', 'url' => ['/shop/order'], 'icon' => 'shopping-cart'],
    ['label' => 'Products', 'url' => ['/shop/product'], 'icon' => 'shopping-bag'],
    ['label' => 'Brands', 'url' => ['/shop/brand'], 'icon' => 'leaf'],
    ['label' => 'Options', 'url' => ['/shop/option'], 'icon' => 'check-square'],
    ['label' => 'Properties', 'url' => ['/shop/property'], 'icon' => 'list'],
    ['label' => 'Property groups', 'url' => ['/shop/group'], 'icon' => 'tags'],
    ['label' => 'Linking', 'url' => ['/shop/relation'], 'icon' => 'share-alt'],
    ['label' => 'Pay methods', 'url' => ['/shop/pay'], 'icon' => 'credit-card'],
    ['label' => 'Shipping methods', 'url' => ['/shop/delivery'], 'icon' => 'truck'],
    ['label' => 'Stickers', 'url' => ['/shop/sticker'], 'icon' => 'bookmark'],
];

echo \yii\widgets\Menu::widget(['items' => $shop_menu_items]);
```

Widgets
-------

[](#widgets)

You can use these widgets to add cart, mini-cart, modal windows and buy buttons to your shop:

```
// Place this widget everywhere you want to see buy button
echo \andrewdanilov\shop\frontend\widgets\Buttons\Buy::widget([
    'product_id' => 123,
    // optional, text label displaying on buy button
    'label' => 'Buy it!',
    // optional, html tag uset for representing buy button
    'tag' => 'div',
    // optional, extended classes for buy button
    'classes' => 'orange-buy-button',
    // optional, use to define own template for buy button
    'template' => '@frontend/views/shop/buy-button',
]);

// Place these two widgets on checkout page.
// First is for displaying form to retrieve client information like e-mail, phone, etc.
// Second is for displaying cart contents table.
\andrewdanilov\shop\frontend\widgets\Checkout\Client::widget();
\andrewdanilov\shop\frontend\widgets\Checkout\FullCart::widget();

// Widget for mini-cart button. Place it somewhere in main layout.
\andrewdanilov\shop\frontend\widgets\Checkout\MiniCart::widget();

// Widget for placing modal windows on page
\andrewdanilov\shop\frontend\widgets\Forms\Modals::widget();
```

If you need your own content inside the widgets, you can copy the widget directory to your desired location and then call them from there. If you do, remember to change the namespaces accordingly.

Features
--------

[](#features)

### I18n

[](#i18n)

Extension supports internationalisation. You can set your language in `common/config/main.php`

```
return [
    // ...
    'language' => 'ru-RU',
    // ...
];
```

On the moment you can use one of languages out of the box: English, Russian. Also, you can create and use your own translations by defining `translatesPath` property of shop module (see above). Therefore, you need to place language files to `xx-XX` folder inside `translatesPath` path. You can copy example from `src/common/messages` path of extension.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity61

Established project with proven stability

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 ~9 days

Recently: every ~46 days

Total

47

Last Release

1600d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec54b9a17d56bc1ccf0be4d4d91269a020986e86ac0ba407906391912cb17ca4?d=identicon)[AndrewDanilov](/maintainers/AndrewDanilov)

---

Tags

yii2extensionshopcatalogcartproductstickers

### Embed Badge

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

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

###  Alternatives

[fancyecommerce/fecshop

fancyecommerce yii2 fecshop

5.3k12.3k6](/packages/fancyecommerce-fecshop)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)[fancyecommerce/fecshop-app-advanced

Yii 2 Advanced Project Template

8519.5k](/packages/fancyecommerce-fecshop-app-advanced)

PHPackages © 2026

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