PHPackages                             black-lamp/blcms-cart - 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. black-lamp/blcms-cart

ActiveYii2-extension

black-lamp/blcms-cart
=====================

Cart component for Blcms-shop module

v0.1.7(9y ago)042211GPL-3.0PHP

Since Sep 26Pushed 7y ago5 watchersCompare

[ Source](https://github.com/black-lamp/blcms-cart)[ Packagist](https://packagist.org/packages/black-lamp/blcms-cart)[ RSS](/packages/black-lamp-blcms-cart/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (33)Used By (1)

Blcms-cart
==========

[](#blcms-cart)

Cart module and component for Blcms-shop module

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist black-lamp/blcms-cart "*"

```

or add to the require section of your `composer.json` file:

```
"black-lamp/blcms-cart": "*"

```

If you need to save orders to database, apply next migration:

**Migrations**

- php yii migrate --migrationPath=@vendor/black-lamp/blcms-staticpage/migrations
- php yii migrate --migrationPath=@vendor/black-lamp/blcms-cart/migrations

**Common configuration**

```
'name' => 'ProjectName',
'components' => [
    'cart' => [
                'class' => bl\cms\cart\CartComponent::className(),
                'emailNotifications' => true,
                'sender' => 'info@mail.com',
                'sendTo' => [
                    'test@mail.com'
                ],
                'saveToDataBase' => true,

                'enablePayment' => true, //If true, you need to add blcms-payment module to your composer.json file.
            ],
],

```

**Frontend configuration**

```
'modules' => [
    'cart' => [
                'class' => bl\cms\cart\frontend\Module::className(),
            ],
    'user' => [
                'class' => 'dektrium\user\Module',
                'modelMap' => [
                    'User' => 'bl\cms\shop\common\components\user\models\User',
                    'Profile' => 'bl\cms\cart\common\components\user\models\Profile',
                ],
                'controllerMap' => [
                    'registration' => 'bl\cms\cart\common\components\user\controllers\RegistrationController',
                    'settings' => 'bl\cms\cart\frontend\components\user\controllers\SettingsController',
                ],
                'as frontend' => 'dektrium\user\filters\FrontendFilter',
            ],
'components' => [
    //For Dektrium User module
    'mailer' => [
                'class' => yii\swiftmailer\Mailer::className(),
                'useFileTransport' => false,
                'messageConfig' => [
                    'charset' => 'UTF-8',
                ],
                'transport' => [
                    'class' => 'Swift_SmtpTransport',
                    'username' => 'info@mail.com',
                    'password' => '123456789',
                    'host' => 'mail.server.com',
                    'port' => '587',
                ],
            ],
    //For cart
   'shopMailer' => [
        'class' => yii\swiftmailer\Mailer::className(),
        'useFileTransport' => false,
        'messageConfig' => [
            'charset' => 'UTF-8',
        ],
        'viewPath' => '@vendor/black-lamp/blcms-cart/frontend/views/mail',
        'htmlLayout' => '@vendor/black-lamp/blcms-cart/frontend/views/mail/layout',
        'transport' => [
                'class' => 'Swift_SmtpTransport',
                'username' => 'info@host.ua',
                'password' => 'password',
                'host' => 'pop.host.ua',
                'port' => '587',
            ],
    ],
]

```

**Backend configuration**

```
'modules' => [
        'cart' => [
            'class' => bl\cms\cart\backend\Module::className(),
        ],
        'user' => [
                    'class' => 'dektrium\user\Module',
                    'enableRegistration' => false,
                    'enableConfirmation' => false,
                    'admins' => ['admin'],
                    'adminPermission' => 'rbacManager',
                    'modelMap' => [
                        'Profile' => 'bl\cms\cart\common\components\user\models\Profile',
                    ],
                    'as backend' => [
                        'class' => 'dektrium\user\filters\BackendFilter',
                        'only' => ['register'], // Block View Register Backend
                    ],
                ],

        'seo' => [
            'class' => 'bl\cms\seo\backend\Module'
        ],
    ],

```

**Params**'adminEmail' =&gt; '',

Usage
-----

[](#usage)

Adding to cart

```
Yii::$app->cart->add($productId, $count, $priceId);

```

Getting total cost

```
$totalCost = Yii::$app->cart->getTotalCost();

```

Getting all user orders ''' $orders = Yii::$app-&gt;cart-&gt;getAllUserOrders(); '''

Clearing cart

```
Yii::$app->cart->clearCart();

```

**Static page**

There is page in Static page module for cart show page on frontend. It has key 'cart'. You need to configure it: add title, seo-data etc. http://YOUR\_DOMAIN.com/admin/seo/static

**Logging**This configuration is for Shop module and Cart module.

For enable logging add log component to your common configuration file:

```
'components' => [
        'log' => [
            'targets' => [
                [
                    'logTable' => 'shop_log',
                    'class' => 'yii\log\DbTarget',
                    'levels' => ['info'],
                    'logVars' => [],
                    'categories' => [
                        'afterCreateProduct', 'afterDeleteProduct', 'afterEditProduct',
                        'afterCreateCategory', 'afterEditCategory', 'afterDeleteCategory',
                    ],
                ],
                [
                    'logTable' => 'cart_log',
                    'class' => 'yii\log\DbTarget',
                    'levels' => ['info'],
                    'logVars' => [],
                    'categories' => [
                        'afterChangeOrderStatus'
                    ],
                ],
                [
                    'logTable' => 'user_log',
                    'class' => 'yii\log\DbTarget',
                    'logVars' => [],
                    'levels' => ['info'],
                    'categories' => [
                        'afterRegister', 'afterConfirm'
                    ],
                ],
            ],
        ],

```

Then apply migration, but only after you will configure your app. The migration will create tables for log targets, which are listed in configuration.

```
php yii migrate --migrationPath=@yii/log/migrations/

```

In backend configuration of your module add

```
'enableLog' => true,

```

\###Email templates Configure frontend component:

```
components => [
    'emailTemplates' => [
        'class' => bl\emailTemplates\components\TemplateManager::class
    ],
]

```

After you will apply migrations, there will be able two records for emails - 'new-order' and 'order-success'. You can find its in admin panel: /admin/email-templates/default/list In mail subject and object you can use next variables: {name}, {surname}, {patronymic}, {email}, {phone}, {orderUid}, {zip}, {country}, {region}, {city}, {street}, {house}, {apartment}, {products}, {totalCost}. Variable {products} renders view @bl\\cms\\cart\\frontend\\views\\mail\\products You can setup mail layout in frontend config for shopMailer component. Now it use @bl\\cms\\cart\\frontend\\views\\mail\\layout

**Welcome email**You can create templates here: /admin/email-templates/default/list (use 'welcome' key for it) Use next variables: {token} =&gt; confirmation token

**Recovery email**Create 'recovery' template. Use next variables: {token} =&gt; confirmation token

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 69.8% 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 ~5 days

Recently: every ~16 days

Total

32

Last Release

3340d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e1784ec992318bf7ed40a2025a0ca035a01143de89054f0f4c9bc39469928c1?d=identicon)[GutsVadim](/maintainers/GutsVadim)

---

Top Contributors

[![GutsVadim](https://avatars.githubusercontent.com/u/9513738?v=4)](https://github.com/GutsVadim "GutsVadim (44 commits)")[![nojes](https://avatars.githubusercontent.com/u/17221145?v=4)](https://github.com/nojes "nojes (17 commits)")[![rshkvyrya](https://avatars.githubusercontent.com/u/10230007?v=4)](https://github.com/rshkvyrya "rshkvyrya (2 commits)")

---

Tags

yii2shopcartblcms

### Embed Badge

![Health badge](/badges/black-lamp-blcms-cart/health.svg)

```
[![Health](https://phpackages.com/badges/black-lamp-blcms-cart/health.svg)](https://phpackages.com/packages/black-lamp-blcms-cart)
```

###  Alternatives

[fancyecommerce/fecshop

fancyecommerce yii2 fecshop

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

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

13825.6k46](/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)
