, (*1)
This module is currently under active development.
Need help! English Translation is incomplete. Any PR would be appreciated :)
Laraplug Shop
Laraplug Shop is a flexible, extendable e-commerce module, built on top of AsgardCMS platform., (*2)
Integrated with the modules below
laraplug/product-module
laraplug/attribute-module
laraplug/cart-module
laraplug/order-module
laraplug/theme-module (Deprecated), (*3)
Table Of Contents
Installation
-
Install the package via composer:, (*4)
composer require laraplug/shop
-
Execute migrations via AsgardCMS's module command:, (*5)
php artisan module:migrate Attribute
php artisan module:migrate Product
php artisan module:migrate Cart
php artisan module:migrate Order --seed
php artisan module:migrate Shop --seed
-
Execute publish via AsgardCMS's module command:, (*6)
php artisan module:publish Attribute
php artisan module:publish Product
php artisan module:publish Cart
php artisan module:publish Order
php artisan module:publish Shop
-
Done!, (*7)
Usage
Extend Product Model
To create your own Book
Product Eloquent model on BookStore
module, just extend the \Modules\Product\Entities\Product
model like this:, (*8)
use Modules\Product\Entities\Product;
class Book extends Product
{
// Override entityNamespace to identify your Model on database
protected static $entityNamespace = 'bookstore/book';
// Override this method to convert Namespace into Human-Readable name
public function getEntityName()
{
return trans('bookstore::books.title.books');
}
}
Add EAV to Product model
Add $systemAttributes
to utilize laraplug/attribute-module on code-level like this:, (*9)
use Modules\Product\Entities\Product;
class Book extends Product
{
...
// Set systemAttributes to define EAV attributes
protected $systemAttributes = [
'isbn' => [
'type' => 'input'
],
'media' => [
'type' => 'checkbox',
'options' => [
'audio-cd',
'audio-book',
'e-book',
]
]
];
}
Available SystemAttributes Parameters
type : String of input type (list below)
- input
: input[type=text]
- textarea
: teaxarea
- radio
: input[type=radio]
- checkbox
: input[type=checkbox]
- select
: select
- multiselect
: select[multiple], (*10)
options : Array of option keys, (*11)
has_translatable_values : boolean, (*12)
Register Your Product
You can register your Entity using ProductManager
like this:, (*13)
use Modules\Product\Repositories\ProductManager;
use Modules\BookStore\Products\Book;
class BookStoreServiceProvider extends ServiceProvider
{
...
public function boot()
{
...
// Register Book
$this->app[ProductManager::class]->registerEntity(new Book());
...
}
}
About Laraplug
LaraPlug is a opensource project to build e-commerce solution on top of AsgardCMS., (*14)
Contributing
We welcome any pull-requests or issues :), (*15)