zakharov-andrew / yii2-shop
Yii2 Shop
Installs: 29
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.3
- zakharov-andrew/yii2-image-upload-widget: *
README
Yii2 shop module. A module for creating an online store based on Yii2. This module provides basic functionality for managing products, categories, orders, and other elements of an e-commerce store.
Features β’ Installation β’ Usage β’ Contributing β’ License
π·πΊ Π ΡΡΡΠΊΠ°Ρ Π²Π΅ΡΡΠΈΡ
β¨ Features
-
π¦ Product Management
- Create, edit, and delete products.
- Add attributes and specifications to products.
- Upload product images.
- Manage product stock levels.
-
ποΈ Categories and Filters
- Hierarchical category system.
- Support for subcategories.
- Filter products by attributes (color, size, price, etc.).
- Flexible filter configuration for categories.
-
π Order Management
- Create and manage orders.
- Order statuses (new, processing, delivered, canceled, etc.).
- Order history and change tracking.
- Support for various delivery methods.
-
π Shopping Cart and Checkout
- Add products to the cart.
- Edit the cart (change quantities, remove products).
- Checkout with customer details.
- Coupon and discount support (planned for future updates).
-
π€ User and Role Management
- User registration and authentication.
- Role and permission management (admin, manager, customer).
- User account with order history.
-
π Search and SEO
- Search products by name, description, and attributes.
- SEO optimization: meta tags, human-readable URLs (slug).
- Sitemap generation (sitemap.xml).
-
π Multilingual Support
- Support for multiple languages in the store interface.
-
π Analytics and Reports
- Sales reports.
- Product popularity analysis.
- Export data to CSV, Excel, and other formats.
-
βοΈ Store Settings
- Flexible configuration of core store parameters.
- Email notification settings for customers and administrators.
π Installation
The preferred way to install this extension is through composer.
Either run
$ composer require zakharov-andrew/yii2-shop
or add
"zakharov-andrew/yii2-shop": "*"
to the require
section of your composer.json
file.
Subsequently, run
./yii migrate/up --migrationPath=@vendor/zakharov-andrew/yii2-shop/migrations
in order to create the settings table in your database.
Or add to console config
return [ // ... 'controllerMap' => [ // ... 'migrate' => [ 'class' => 'yii\console\controllers\MigrateController', 'migrationPath' => [ '@console/migrations', // Default migration folder '@vendor/zakharov-andrew/yii2-shop/src/migrations' ] ] // ... ] // ... ];
π Usage
Add this to your main configuration's modules array
'modules' => [ 'shop' => [ 'class' => 'ZakharovAndrew\shop\Module', 'catalogTitle' => 'Catalog Title', 'storeName' => 'My Store', 'bootstrapVersion' => 5, // if use bootstrap 5 'params' => [ '1' => [ 'title' => [ 'en-US' => 'Weight', 'ru' => 'ΠΠ΅Ρ' ] ] ], 'defaultProductImage' => '/images/default-product-image.jpg', // Path to the default image for a product 'uploadWebDir' => '/web/path/to/upload/dir/' ], 'imageupload' => [ 'class' => 'ZakharovAndrew\imageupload\Module', 'uploadDir' => '/path/to/upload/dir/', ], // ... ],
Note: the maximum number of additional parameters is 3. Change the value of uploadDir to the directory for uploading images. Uses the yii2-image-upload-widget module to upload images.
Add this to your main configuration's urlManager array
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ // ... 'catalog/<url:[\w\-]+>' => 'shop/product-category/view', 'catalog' => 'shop/catalog/index', 'product/<url:[\w\d\-]+>' => 'shop/product/view', 'cart' => 'shop/cart/index', 'checkout' => 'shop/checkout/index', 'admin/orders' => 'shop/admin-order/index', 'admin/orders/<id:\d+>' => 'shop/admin-order/view', 'admin/orders/update-status/<id:\d+>' => 'shop/admin-order/update-status', // ... ], ],
π₯ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.