black-lamp / blcms-shop
Shop module for Black-Lamp CMS
Installs: 613
Dependents: 6
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 0
Open Issues: 1
Type:yii2-extension
Requires
- php: >=7.0
- 2amigos/yii2-tinymce-widget: *
- black-lamp/blcms-staticpage: 0.*
- black-lamp/yii2-email-templates: ^3.0.0
- black-lamp/yii2-imagable: 1.*
- black-lamp/yii2-multi-lang: ^1.0.0
- black-lamp/yii2-seo: 0.1.*
- evgeniyrru/yii2-slick: 1.0.1
- kartik-v/yii2-widgets: *
- marqu3s/yii2-summernote: dev-master
- yii2tech/ar-position: *
- yiisoft/yii2: >=2.0.4
- yiisoft/yii2-bootstrap: *
- dev-master
- v0.5.21
- 0.5.20
- 0.5.19
- 0.5.18
- 0.5.17
- 0.5.16
- 0.5.15
- 0.5.14
- 0.5.13
- 0.5.12
- 0.5.11
- 0.5.10
- v0.5.9
- v0.5.8
- v0.5.7
- v0.5.6
- v0.5.5
- 0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- 0.4.9
- 0.4.8
- 0.4.7
- v0.4.6
- v0.4.5
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.3.1
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- 0.1.7
- 0.1.6
- 0.1.5.9
- 0.1.5.5
- v0.1.5.4
- v0.1.5.3
- 0.1.5.2
- 0.1.5.1
- 0.1.5.0
- 0.1.4.11
- 0.1.4.10
- 0.1.4.9
- 0.1.4.8
- 0.1.4.7
- 0.1.4.6
- 0.1.4.5
- 0.1.4.4
- 0.1.4.3
- 0.1.4.2
- 0.1.4.1
- 0.1.4.0
- 0.1.3.12
- 0.1.3.11
- 0.1.3.10
- 0.1.3.9
- 0.1.3.8
- 0.1.3.7
- 0.1.3.6
- 0.1.3.5
- 0.1.3.4
- 0.1.3.3
- 0.1.3.2
- 0.1.3.1
- 0.1.3.0
- 0.1.2.9
- 0.1.2.8
- 0.1.2.7
- 0.1.2.6
- 0.1.2.5
- 0.1.2.4
- 0.1.2.3
- 0.1.2.2
- 0.1.2.1
- 0.1.2.0
- 0.1.1.9
- 0.1.1.8
- 0.1.1.7
- 0.1.1.6
- 0.1.1.5
- 0.1.1.4
- 0.1.1.3
- 0.1.1.2
- 0.1.1.1
- 0.1.1
- 0.1.0.9
- 0.1.0.8
- 0.1.0.7
- 0.1.0.6
- 0.1.0.5
- 0.1.0.4
- 0.1.0.3
- 0.1.0.2
- 0.1.0.1
- 0.1
- 0.0.10
- 0.0.9.1
- 0.0.9
- 0.0.8.2
- 0.0.8.1
- 0.0.8
- 0.0.7
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- 0
- dev-poolsgallery
This package is not auto-updated.
Last update: 2024-12-24 05:18:54 UTC
README
Applying migrations: !Important: this migrations must be applied after Dectrium-User module migrations.
- php yii migrate --migrationPath=@yii/rbac/migrations - php yii migrate --migrationPath=@vendor/black-lamp/blcms-shop/migrations
For cart module:
- php yii migrate --migrationPath=@vendor/black-lamp/blcms-cart/migrations
Configuration for Imagable module:
'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:
'modules' => [ 'shop' => [ 'class' => \bl\cms\shop\console\Module::className(), 'importActions' => [ 'basic' => [ 'class' => bl\cms\shop\console\actions\import\BasicAction::className() ] ] ] ],
REQUIRES
- PHP-version: 7.0 or later
- PHP-extensions: file-info, imagick, intl
Roles and its permissions:
attributeManager
- addAttributeValue
- deleteAttribute
- saveAttribute
- viewAttributeList
countryManager
- saveCountry
- viewCountryList
- deleteCountry
currencyManager
- updateCurrency
- viewCurrencyList
- deleteCurrency
deliveryMethodManager
- saveDeliveryMethod
- viewDeliveryMethodList
- deleteDeliveryMethod
filterManager
- deleteFilter
- saveFilter
- viewFilterList
orderManager
- deleteOrder
- deleteOrderProduct
- viewOrder
- viewOrderList
orderStatusManager
- saveOrderStatus
- viewOrderStatusList
- deleteOrderStatus
productAvailabilityManager
- saveProductAvailability
- viewProductAvailabilityList
- deleteProductAvailability
productManager
- createProduct
- createProductWithoutModeration
- deleteOwnProduct
- deleteProduct
- updateOwnProduct
- updateProduct
- viewCompleteProductList
- viewProductList
productPartner
- accessAdminPanel
- createProduct
- createProductWithoutModeration
- deleteOwnProduct
- deleteProduct
- updateOwnProduct
- updateProduct
- viewCompleteProductList
- viewProductList
shopCategoryManager
- saveShopCategory
- viewShopCategoryList
vendorManager
- saveVendor
- viewVendorList
- deleteVendor
shopAdministrator extends permissions from all managers.
WIDGETS
Recommended products
Example:
<?= \bl\cms\shop\widgets\RecommendedProducts::widget([
'id' => $product->id,
]); ?>
Also you may use bl\cms\shop\widgets\assets\RecommendedProductsAsset in your view.
Filtration widget
To use the widget, you must have set up relations in the models. For example in model Product:
/** * @return \yii\db\ActiveQuery */ public function getProductCountry() { return $this->hasOne(ProductCountry::className(), ['id' => 'country_id']); }
LOGGING
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:
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.
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.
TRANSLATIONS
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:
'i18n' => [
'translations' => [
'shop' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@backend/messages',
'sourceLanguage' => 'en-us',
]
],
],
REPORTS
- "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
Products displaying
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:
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'],
'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.
php yii migrate --migrationPath=@yii/log/migrations/
In backend and frontend configuration of your module add
'enableLog' => true,
Vendor list
- /shop/vendor
Partner requests email Create new templates 'partner-request-manager' and 'partner-request-partner': /admin/email-templates/default/list
You can use next variables: '{contact_person}', '{company_name}', '{website}', '{message}', '{name}', '{surname}', '{patronymic}', '{info}'
Also create template 'partner-request-accept' without variables.
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}.
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}