2017 © Pedro Peláez
 

yii2-extension blcms-shop

Shop module for Black-Lamp CMS

image

black-lamp/blcms-shop

Shop module for Black-Lamp CMS

  • Tuesday, April 24, 2018
  • by GutsVadim
  • Repository
  • 4 Watchers
  • 0 Stars
  • 605 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 100 Versions
  • 0 % Grown

The README.md

Applying migrations: !Important: this migrations must be applied after Dectrium-User module migrations., (*1)

- php yii migrate --migrationPath=@yii/rbac/migrations
- php yii migrate --migrationPath=@vendor/black-lamp/blcms-shop/migrations

For cart module:, (*2)

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

Configuration for Imagable module:, (*3)

        'shop_imagable' => [
            'class' => bl\imagable\Imagable::className(),
            'imageClass' => \bl\imagable\instances\CreateImageImagine::className(),
            'nameClass' => bl\imagable\name\CRC32Name::className(),
            'imagesPath' => '@frontend/web/images',
            'categories' => [
                'origin' => false,
                'category' => [
                    'shop-product' => [
                        'origin' => false,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 500,
                                'height' => 500,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                    'shop-vendors' => [
                        'origin' => false,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 320,
                                'height' => 240,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                    'delivery' => [
                        'origin' => false,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 500,
                                'height' => 500,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                    'shop-category/cover' => [
                        'origin' => false,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 500,
                                'height' => 500,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                    'shop-category/thumbnail' => [
                        'origin' => false,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 500,
                                'height' => 500,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                    'shop-category/menu_item' => [
                        'origin' => false,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 500,
                                'height' => 500,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                    'payment' => [
                        'origin' => false,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 500,
                                'height' => 500,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                ]
            ]
        ],

Add module to your backend config

    'bootstrap' => [
        //'bl\cms\shop\backend\components\events\PartnersBootstrap',
        'bl\cms\shop\backend\components\events\ShopLogBootstrap',
        'bl\cms\cart\backend\components\events\CartBootstrap',
    ],
    'modules' => [
        'shop' => [
            'class' => 'bl\cms\shop\backend\Module',
            'enableCurrencyConversion' => true
        ]
    ],
    'components' => [
        'urlManagerFrontend' => [
            'class' => bl\multilang\MultiLangUrlManager::className(),
            'baseUrl' => '/',
            'showScriptName' => false,
            'enablePrettyUrl' => true,
            'enableDefaultLanguageUrlCode' => false,
            'rules' => [
                [
                    'class' => bl\articles\UrlRule::className()
                ],
                [
                    'class' => bl\cms\shop\UrlRule::className(),
                    'prefix' => 'shop'
                ],
            ]
        ]
    ]

Add module to your frontend config

    'modules' => [
        ...
        'shop' => [
                    'class' => bl\cms\shop\frontend\Module::className(),
                    'enableCurrencyConversion' => true,
                    'partnerManagerEmail' => $params['partnerManagerEmail'],
                    'senderEmail' => $params['senderEmail'],
                    'showChildCategoriesProducts' => false
                ],
        ...
    ],

    'components' => [
        ...
        'urlManager' => [
            ...
            'rules' => [
                ...
                [
                    'class' => bl\cms\shop\UrlRule::className(),
                    'prefix' => 'shop'
                ]
            ],
            ...
        ],
        'partnerMailer' => [
                    'class' => yii\swiftmailer\Mailer::className(),
                    'useFileTransport' => false,
                    'messageConfig' => [
                        'charset' => 'UTF-8',
                    ],
                    'viewPath' => '@vendor/black-lamp/blcms-shop/frontend/views/partner-request/mail',
                    'htmlLayout' => '@vendor/black-lamp/blcms-shop/frontend/views/partner-request/mail/layout',
                    'transport' => [
                        'class' => 'Swift_SmtpTransport',
                        'username' => 'info@mail.com',
                        'password' => '55555555',
                        'host' => 'pop.mail.com',
                        'port' => '587',
                    ],
                ],
        ...
    ]

    'bootstrap' => [
        'bl\cms\shop\frontend\components\events\PartnersBootstrap',
        'bl\cms\cart\frontend\components\events\UserRegistrationBootstrap'
    ],

If you need some console import scripts:, (*4)

    'modules' => [
        'shop' => [
            'class' => \bl\cms\shop\console\Module::className(),
            'importActions' => [
                'basic' => [
                    'class' => bl\cms\shop\console\actions\import\BasicAction::className()
                ]
            ]
        ]
    ],

REQUIRES, (*5)

  • PHP-version: 7.0 or later
  • PHP-extensions: file-info, imagick, intl

Roles and its permissions:, (*6)

attributeManager - addAttributeValue - deleteAttribute - saveAttribute - viewAttributeList, (*7)

countryManager - saveCountry - viewCountryList - deleteCountry, (*8)

currencyManager - updateCurrency - viewCurrencyList - deleteCurrency, (*9)

deliveryMethodManager - saveDeliveryMethod - viewDeliveryMethodList - deleteDeliveryMethod, (*10)

filterManager - deleteFilter - saveFilter - viewFilterList, (*11)

orderManager - deleteOrder - deleteOrderProduct - viewOrder - viewOrderList, (*12)

orderStatusManager - saveOrderStatus - viewOrderStatusList - deleteOrderStatus, (*13)

productAvailabilityManager - saveProductAvailability - viewProductAvailabilityList - deleteProductAvailability, (*14)

productManager - createProduct - createProductWithoutModeration - deleteOwnProduct - deleteProduct - updateOwnProduct - updateProduct - viewCompleteProductList - viewProductList, (*15)

productPartner - accessAdminPanel - createProduct - createProductWithoutModeration - deleteOwnProduct - deleteProduct - updateOwnProduct - updateProduct - viewCompleteProductList - viewProductList, (*16)

shopCategoryManager - saveShopCategory - viewShopCategoryList, (*17)

vendorManager - saveVendor - viewVendorList - deleteVendor, (*18)

shopAdministrator extends permissions from all managers., (*19)

WIDGETS, (*20)

Recommended products, (*21)

Example:, (*22)

<?= \bl\cms\shop\widgets\RecommendedProducts::widget([
    'id' => $product->id,
]); ?>

Also you may use bl\cms\shop\widgets\assets\RecommendedProductsAsset in your view., (*23)

Filtration widget, (*24)

To use the widget, you must have set up relations in the models. For example in model Product:, (*25)

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getProductCountry()
    {
        return $this->hasOne(ProductCountry::className(), ['id' => 'country_id']);
    }

LOGGING, (*26)

Your application can record how many people watched a particular product. To enable logging, you must add the following settings in the frontend configuration file:, (*27)

public $log = [
        'enabled' => true,
        'maxProducts' => 10 // Max number of viewed products by one user.
    ];

In it, you specify the number of products, which is stored in the table shop_product_views for one user. This value can be 'all', ie infinitely., (*28)

If the 'maxProducts' property value is "all", the "views" of Product object increases by one for a registered user once. Otherwise it will increase by one each time when registered user views product., (*29)

TRANSLATIONS, (*30)

The module has translations on several languages. If there is not your language or if you would like change its on your own, you can configure it in backend or frontend configuration file:, (*31)

'i18n' => [
            'translations' => [
                'shop' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@backend/messages',
                    'sourceLanguage' => 'en-us',
                ]
            ],
        ],

REPORTS, (*32)

  • "Class 'Imagick' not found"

If you use OpenServer with PHP 7, you must install Imagick extension like here http://open-server.ru/forum/viewtopic.php?f=4&t=2897&hilit=imagick, (*33)

Products displaying, (*34)

You can select one of two modes: showing products of current category and its children or only current category. Use property $showChildCategoriesProducts in frontend Module class configuration. migration:, (*35)

Logging This configuration is for Shop module and Cart module., (*36)

For enable logging add log component to your common configuration file:, (*37)

'components' => [
        'log' => [
            'targets' => [
                [
                    'logTable' => 'shop_log',
                    'class' => 'yii\log\DbTarget',
                    'levels' => ['info'],
                    'categories' => [
                        'afterCreateProduct', 'afterDeleteProduct', 'afterEditProduct',
                        'afterCreateCategory', 'afterEditCategory', 'afterDeleteCategory',
                    ],
                ],
                [
                    'logTable' => 'cart_log',
                    'class' => 'yii\log\DbTarget',
                    'levels' => ['info'],
                    'categories' => [
                        'afterChangeOrderStatus'
                    ],
                ],
                [
                    'logTable' => 'user_log',
                    'class' => 'yii\log\DbTarget',
                    '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., (*38)

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

In backend and frontend configuration of your module add, (*39)

'enableLog' => true,

Vendor list - /shop/vendor, (*40)

Partner requests email Create new templates 'partner-request-manager' and 'partner-request-partner': /admin/email-templates/default/list, (*41)

You can use next variables: '{contact_person}', '{company_name}', '{website}', '{message}', '{name}', '{surname}', '{patronymic}', '{info}', (*42)

Also create template 'partner-request-accept' without variables., (*43)

Information about new product by product partner to manager - template 'new-product-to-manager'. You can use next variables: {productId}, {title}, {ownerId}, {ownerEmail}, {owner}, {link} For sending information abount new product to partner which created this product, add template 'new-product-to-partner' with variables {productId}, {title}, {ownerId}, {ownerEmail}, {owner}, {link}., (*44)

If product is moderated and status is 'accept' the mail 'accept-product-to-owner' will be sent. You may use variables: {title}, {ownerEmail}, {owner}, {link}, (*45)

The Versions

16/01 2017

dev-poolsgallery

dev-poolsgallery

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

16/01 2017

0.0.8.2

0.0.8.2

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

12/01 2017

0.0.8.1

0.0.8.1

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

11/11 2016

v0.1.8

0.1.8.0

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

31/10 2016

0.1.7

0.1.7.0

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

31/10 2016

0.1.6

0.1.6.0

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

28/10 2016

0.1.5.5

0.1.5.5

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

27/10 2016

v0.1.5.4

0.1.5.4

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

27/10 2016

v0.1.5.3

0.1.5.3

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

26/10 2016

0.1.5.2

0.1.5.2

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

26/10 2016

0.1.5.0

0.1.5.0

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

24/10 2016

0.1.4.10

0.1.4.10

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

24/10 2016

0.1.4.9

0.1.4.9

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

24/10 2016

0.1.4.8

0.1.4.8

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

24/10 2016

0.1.4.11

0.1.4.11

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

24/10 2016

0.1.5.1

0.1.5.1

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

24/10 2016

0.1.5.9

0.1.5.9

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

23/10 2016

0.1.4.7

0.1.4.7

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

22/10 2016

0.1.4.6

0.1.4.6

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

22/10 2016

0.1.4.5

0.1.4.5

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

22/10 2016

0.1.4.4

0.1.4.4

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

22/10 2016

0.1.4.3

0.1.4.3

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

22/10 2016

0.1.4.2

0.1.4.2

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

22/10 2016

0.1.4.1

0.1.4.1

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

21/10 2016

0.1.4.0

0.1.4.0

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

21/10 2016

0.1.3.12

0.1.3.12

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

21/10 2016

0.1.3.10

0.1.3.10

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

21/10 2016

0.1.3.11

0.1.3.11

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

20/10 2016

0.1.3.9

0.1.3.9

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

19/10 2016

0.1.3.8

0.1.3.8

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

16/10 2016

0.1.3.7

0.1.3.7

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

13/10 2016

0.1.3.6

0.1.3.6

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

12/10 2016

0.1.3.5

0.1.3.5

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

12/10 2016

0.1.3.4

0.1.3.4

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

12/10 2016
12/10 2016

0.1.3.2

0.1.3.2

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

12/10 2016

0.1.3.3

0.1.3.3

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

07/10 2016

0.1.3.1

0.1.3.1

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

05/10 2016

0.1.3.0

0.1.3.0

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

05/10 2016

0.1.2.9

0.1.2.9

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

03/10 2016

0.1.2.8

0.1.2.8

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

03/10 2016

0.1.2.7

0.1.2.7

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

02/10 2016

0.1.2.6

0.1.2.6

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

29/09 2016

0.1.2.5

0.1.2.5

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

26/09 2016

0.1.2.4

0.1.2.4

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

16/09 2016

0.1.2.3

0.1.2.3

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

16/09 2016

0.1.2.2

0.1.2.2

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

14/09 2016

0.1.2.1

0.1.2.1

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

14/09 2016

0.1.2.0

0.1.2.0

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

13/09 2016

0.1.1.9

0.1.1.9

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

12/09 2016

0.1.1.8

0.1.1.8

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

09/09 2016

0.1.1.7

0.1.1.7

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

06/09 2016

0.1.1.6

0.1.1.6

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

05/09 2016

0.1.1.5

0.1.1.5

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

01/09 2016

0.1.1.4

0.1.1.4

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

01/09 2016

0.1.1.3

0.1.1.3

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

31/08 2016

0.1.1.2

0.1.1.2

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms

31/08 2016

0.1.1.1

0.1.1.1

Shop module for Black-Lamp CMS

  Sources   Download

The Requires

 

by Gutsulyak Vadim
by Albert Gainutdinov

yii2 shop blcms