Resolve conflicts
This commit is contained in:
commit
6384b84746
|
|
@ -3,7 +3,7 @@ APP_ENV=local
|
|||
APP_VERSION=0.1.6
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://yourdomain.com
|
||||
APP_URL=http://localhost
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ DB_PASSWORD=
|
|||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=10
|
||||
SESSION_LIFETIME=20
|
||||
QUEUE_DRIVER=sync
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
|
|
@ -42,4 +42,4 @@ PUSHER_APP_SECRET=
|
|||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,179 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class BagistoInstall extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'bagisto:install';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'This command will try to configure and install new Bagisto instance';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$path = base_path('.env');
|
||||
|
||||
$uname = strtolower(\php_uname());
|
||||
|
||||
if (str_contains($uname, 'win'))
|
||||
shell_exec('copy .env.example .env');
|
||||
else
|
||||
shell_exec('cp .env.example .env');
|
||||
|
||||
$this->line('Hello and welcome to Bagisto command line installer.');
|
||||
|
||||
$APP_NAME = $this->ask('[KEY = "APP_NAME"] Please enter name of application instance?');
|
||||
$this->comment($APP_NAME ?? 'Bagisto');
|
||||
$this->changeEnvironmentVariable('APP_NAME', $APP_NAME);
|
||||
|
||||
$APP_ENV = $this->choice('[KEY = "APP_ENV"] Choose environment for this instance of Bagisto?', ['development', 'production'], 0);
|
||||
$this->comment($APP_ENV);
|
||||
$this->changeEnvironmentVariable('APP_ENV', $APP_ENV);
|
||||
|
||||
// $APP_DEBUG = $this->ask('Choose APP_DEBUG?', ['true', 'false'], 0);
|
||||
// $this->comment($APP_DEBUG);
|
||||
// $this->changeEnvironmentVariable('APP_DEBUG', $APP_DEBUG);
|
||||
|
||||
$APP_URL = $this->ask('[KEY = "APP_URL"] Please enter application URL (Optional, default = localhost)?');
|
||||
$this->comment($APP_URL ?? 'localhost');
|
||||
$this->changeEnvironmentVariable('APP_URL', $APP_URL);
|
||||
|
||||
$DB_CONNECTION = $this->ask('[KEY = "DB_CONNECTION"] Enter database connection (Optional, default = mysql)?');
|
||||
$this->comment($DB_CONNECTION ?? 'mysql');
|
||||
$this->changeEnvironmentVariable('DB_CONNECTION', $DB_CONNECTION);
|
||||
|
||||
$DB_HOST = $this->ask('[KEY = "DB_HOST"] Enter database host (Optional, default = 127.0.0.1)?');
|
||||
$this->comment($DB_HOST ?? '127.0.0.1');
|
||||
$this->changeEnvironmentVariable('DB_HOST', $DB_HOST);
|
||||
|
||||
$DB_PORT = $this->ask('[KEY = "DB_PORT"] Enter database port (Optional, default = 3306)?');
|
||||
$this->comment($DB_PORT ?? '3306');
|
||||
$this->changeEnvironmentVariable('DB_PORT', $DB_PORT);
|
||||
|
||||
$DB_DATABASE = null;
|
||||
|
||||
while(! isset($DB_DATABASE)) {
|
||||
$DB_DATABASE = $this->ask('[KEY = "DB_DATABASE"] Enter name of database?');
|
||||
$this->comment($DB_DATABASE ?? 'forge');
|
||||
}
|
||||
|
||||
$this->changeEnvironmentVariable('DB_DATABASE', $DB_DATABASE);
|
||||
|
||||
while(! isset($DB_USERNAME)) {
|
||||
$DB_USERNAME = $this->ask('Enter database username?');
|
||||
$this->comment($DB_USERNAME ?? 'root');
|
||||
}
|
||||
|
||||
$this->changeEnvironmentVariable('[KEY = "DB_USERNAME"] DB_USERNAME', $DB_USERNAME);
|
||||
|
||||
$DB_PASSWORD = $this->ask('Please enter database password?');
|
||||
$this->comment($DB_PASSWORD);
|
||||
$this->changeEnvironmentVariable('[KEY = "DB_PASSWORD"] DB_PASSWORD', $DB_PASSWORD);
|
||||
|
||||
$this->info('We are done with application and database params, good job!');
|
||||
|
||||
$this->info('Do you want me to be mail ready, i am loaded with notifications!');
|
||||
|
||||
$MAIL_DRIVER = $this->ask('[KEY = "MAIL_DRIVER"] Enter MAIL_DRIVER (Optional, default = smtp)?');
|
||||
$this->comment($MAIL_DRIVER ?? 'smtp');
|
||||
$this->changeEnvironmentVariable('MAIL_DRIVER', $MAIL_DRIVER ?? 'smtp');
|
||||
|
||||
$MAIL_HOST = $this->ask('[KEY = "MAIL_HOST"] Enter MAIL_HOST (Optional, default = smtp.mailtrap.io)?');
|
||||
$this->comment($MAIL_HOST ?? 'smtp.mailtrap.io');
|
||||
$this->changeEnvironmentVariable('MAIL_HOST', $MAIL_HOST ?? 'smtp.mailtrap.io');
|
||||
|
||||
$MAIL_PORT = $this->ask('[KEY = "MAIL_PORT"] Enter MAIL_PORT (Optional, default = 2525)?');
|
||||
$this->comment($MAIL_PORT ?? '2525');
|
||||
$this->changeEnvironmentVariable('MAIL_PORT', $MAIL_PORT ?? '2525');
|
||||
|
||||
$MAIL_USERNAME = $this->ask('[KEY = "MAIL_USERNAME"] Enter MAIL_USERNAME?');
|
||||
$this->comment($MAIL_USERNAME ?? null);
|
||||
$this->changeEnvironmentVariable('MAIL_USERNAME', $MAIL_USERNAME);
|
||||
|
||||
$MAIL_PASSWORD = $this->ask('[KEY = "MAIL_PASSWORD"] Enter MAIL_PASSWORD?');
|
||||
$this->comment($MAIL_PASSWORD ?? null);
|
||||
$this->changeEnvironmentVariable('MAIL_PASSWORD', $MAIL_PASSWORD);
|
||||
|
||||
$MAIL_ENCRYPTION = $this->ask('[KEY = "MAIL_ENCRYPTION"] Enter MAIL_ENCRYPTION (default = tls)?');
|
||||
$this->comment($MAIL_ENCRYPTION ?? 'tls');
|
||||
$this->changeEnvironmentVariable('MAIL_ENCRYPTION', $MAIL_ENCRYPTION ?? 'tls');
|
||||
|
||||
$SHOP_MAIL_FROM = $this->ask('[KEY = "SHOP_MAIL_FROM"] Enter SHOP_MAIL_FROM?');
|
||||
$this->comment($SHOP_MAIL_FROM ?? null);
|
||||
$this->changeEnvironmentVariable('SHOP_MAIL_FROM', $SHOP_MAIL_FROM);
|
||||
|
||||
$ADMIN_MAIL_TO = $this->ask('[KEY = "ADMIN_MAIL_TO"] Enter ADMIN_MAIL_TO?');
|
||||
$this->comment($ADMIN_MAIL_TO ?? null);
|
||||
$this->changeEnvironmentVariable('ADMIN_MAIL_TO', $ADMIN_MAIL_TO);
|
||||
|
||||
$this->info('We are done setting all the configuration in the env file, now we will proceed by running the commands necessary for Bagisto');
|
||||
|
||||
\Artisan::call('config:cache');
|
||||
|
||||
$this->info('Running migrations...');
|
||||
|
||||
\Artisan::call('migrate');
|
||||
|
||||
$this->info('Migration completed.');
|
||||
|
||||
$this->info('Running seeders...');
|
||||
|
||||
\Artisan::call('db:seed', ['--force' => true]);
|
||||
|
||||
$this->info('Seeders finished.');
|
||||
|
||||
\Artisan::call('storage:link');
|
||||
|
||||
$this->info('Storage link created...');
|
||||
|
||||
\Artisan::call('vendor:publish', [0]);
|
||||
|
||||
$this->info('All provider tags are published...');
|
||||
|
||||
$this->info('Installation completed.');
|
||||
|
||||
$this->info('Please write us: SUPPORT@BAGISTO.COM');
|
||||
|
||||
$this->info('Thank you!!!');
|
||||
}
|
||||
|
||||
public static function changeEnvironmentVariable($key, $value)
|
||||
{
|
||||
$path = base_path('.env');
|
||||
|
||||
if (file_exists($path)) {
|
||||
|
||||
file_put_contents($path, str_replace(
|
||||
$key . '=' . env($key),
|
||||
$key . '=' . $value,
|
||||
file_get_contents($path)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Webkul\Product\Repositories\ProductRepository as Product;
|
||||
|
||||
class GenerateProducts extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'bagisto:generate {value}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Generates product with random attribute values.';
|
||||
|
||||
/**
|
||||
* ProductRepository instance
|
||||
*/
|
||||
protected $product;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Product $product)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->product = $product;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if ($this->argument('value') == 'products') {
|
||||
$this->comment('Under development.');
|
||||
} else {
|
||||
$this->line('Sorry, generate option is either invalid or does not exist.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -28,6 +28,8 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -48,7 +50,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'admin_name',
|
||||
'label' => trans('admin::app.datagrid.admin-name'),
|
||||
'label' => trans('admin::app.name'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
|
|
@ -57,7 +59,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'type',
|
||||
'label' => trans('admin::app.datagrid.type'),
|
||||
'label' => trans('admin::app.type'),
|
||||
'type' => 'string',
|
||||
'sortable' => true,
|
||||
'searchable' => true,
|
||||
|
|
@ -66,7 +68,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'is_required',
|
||||
'label' => trans('admin::app.datagrid.required'),
|
||||
'label' => trans('admin::app.required'),
|
||||
'type' => 'boolean',
|
||||
'sortable' => true,
|
||||
'searchable' => false,
|
||||
|
|
@ -80,7 +82,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'is_unique',
|
||||
'label' => trans('admin::app.datagrid.unique'),
|
||||
'label' => trans('admin::app.unique'),
|
||||
'type' => 'boolean',
|
||||
'sortable' => true,
|
||||
'searchable' => false,
|
||||
|
|
@ -95,7 +97,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'value_per_locale',
|
||||
'label' => trans('admin::app.datagrid.per-locale'),
|
||||
'label' => trans('admin::app.locale-based'),
|
||||
'type' => 'boolean',
|
||||
'sortable' => true,
|
||||
'searchable' => false,
|
||||
|
|
@ -110,7 +112,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'value_per_channel',
|
||||
'label' => trans('admin::app.datagrid.per-channel'),
|
||||
'label' => trans('admin::app.channel-based'),
|
||||
'type' => 'boolean',
|
||||
'sortable' => true,
|
||||
'searchable' => false,
|
||||
|
|
@ -127,15 +129,15 @@ class AttributeDataGrid extends DataGrid
|
|||
public function prepareActions()
|
||||
{
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'method' => 'GET', //use post only for redirects only
|
||||
'title' => 'Edit Attribute',
|
||||
'method' => 'GET', //use get for redirects only
|
||||
'route' => 'admin.catalog.attributes.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'method' => 'POST', //use post only for requests other than redirects
|
||||
'title' => 'Delete Attribute',
|
||||
'method' => 'POST', // other than get request it fires ajax and self refreshes datagrid
|
||||
'route' => 'admin.catalog.attributes.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -26,9 +26,11 @@ class AttributeFamilyDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
'label' => trans('admin::app.id'),
|
||||
'type' => 'number',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
|
|
@ -37,7 +39,7 @@ class AttributeFamilyDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'code',
|
||||
'label' => trans('admin::app.datagrid.code'),
|
||||
'label' => trans('admin::app.code'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
|
|
@ -46,7 +48,7 @@ class AttributeFamilyDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'name',
|
||||
'label' => trans('admin::app.datagrid.name'),
|
||||
'label' => trans('admin::app.name'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
|
|
@ -56,14 +58,14 @@ class AttributeFamilyDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Attribute Family',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.catalog.families.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Attribute Family',
|
||||
'method' => 'POST', // use GET request only for redirect purposes and POST for rest
|
||||
'route' => 'admin.catalog.families.delete',
|
||||
// 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class CMSPageDataGrid extends DataGrid
|
|||
|
||||
$locales = app('Webkul\Core\Repositories\LocaleRepository');
|
||||
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -88,14 +90,14 @@ class CMSPageDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit CMSPage',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.cms.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete CMSPage',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.cms.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -28,9 +28,11 @@ class CartRuleDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
'label' => trans('admin::app.id'),
|
||||
'type' => 'number',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
|
|
@ -39,7 +41,7 @@ class CartRuleDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'name',
|
||||
'label' => trans('admin::app.datagrid.name'),
|
||||
'label' => trans('admin::app.name'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
|
|
@ -48,7 +50,7 @@ class CartRuleDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'status',
|
||||
'label' => trans('admin::app.datagrid.status'),
|
||||
'label' => trans('admin::app.status'),
|
||||
'type' => 'boolean',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
|
|
@ -117,14 +119,14 @@ class CartRuleDataGrid extends DataGrid
|
|||
public function prepareActions()
|
||||
{
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit CartRule',
|
||||
'method' => 'GET', //use post only for redirects only
|
||||
'route' => 'admin.cart-rule.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete CartRule',
|
||||
'method' => 'POST', //use post only for requests other than redirects
|
||||
'route' => 'admin.cart-rule.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ class CatalogRuleDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -107,14 +109,14 @@ class CatalogRuleDataGrid extends DataGrid
|
|||
public function prepareActions()
|
||||
{
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit CatalogRule',
|
||||
'method' => 'GET', //use post only for redirects only
|
||||
'route' => 'admin.catalog-rule.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete CatalogRule',
|
||||
'method' => 'POST', //use post only for requests other than redirects
|
||||
'route' => 'admin.catalog-rule.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ class CategoryDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'category_id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -91,14 +93,14 @@ class CategoryDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Category',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.catalog.categories.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Category',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.catalog.categories.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class ChannelDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -65,14 +67,14 @@ class ChannelDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Channel',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.channels.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Channel',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.channels.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class CurrencyDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -56,14 +58,14 @@ class CurrencyDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Currency',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.currencies.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Currency',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.currencies.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ class CustomerDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'customer_id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -89,7 +91,6 @@ class CustomerDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.customer.edit',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
|
|
@ -97,7 +98,6 @@ class CustomerDataGrid extends DataGrid
|
|||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.customer.delete',
|
||||
'icon' => 'icon trash-icon',
|
||||
|
|
@ -105,7 +105,6 @@ class CustomerDataGrid extends DataGrid
|
|||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Add Note',
|
||||
'method' => 'GET',
|
||||
'route' => 'admin.customer.note.create',
|
||||
'icon' => 'icon note-icon',
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class CustomerGroupDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => 'ID',
|
||||
|
|
@ -56,14 +58,14 @@ class CustomerGroupDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Customer Group',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.groups.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Customer Group',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.groups.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ class CustomerReviewDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'product_review_id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -92,14 +94,14 @@ class CustomerReviewDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Customer Review',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.customer.review.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Customer Review',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.customer.review.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ class ExchangeRatesDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'currency_exch_id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -58,14 +60,14 @@ class ExchangeRatesDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Exchange Rate',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.exchange_rates.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Exchange Rate',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.exchange_rates.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class InventorySourcesDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -80,14 +82,14 @@ class InventorySourcesDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Inventory Source',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.inventory_sources.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Inventory Source',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.inventory_sources.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class LocalesDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -65,14 +67,14 @@ class LocalesDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Locales',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.locales.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Locales',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.locales.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class NewsLetterDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -62,14 +64,14 @@ class NewsLetterDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit News Letter',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.customers.subscribers.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete News Letter',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.customers.subscribers.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ class OrderDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -134,7 +136,7 @@ class OrderDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'View',
|
||||
'title' => 'Order View',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.sales.orders.view',
|
||||
'icon' => 'icon eye-icon'
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class OrderInvoicesDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -65,7 +67,7 @@ class OrderInvoicesDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'View',
|
||||
'title' => 'Order Invoice View',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.sales.invoices.view',
|
||||
'icon' => 'icon eye-icon'
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ class OrderShipmentsDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'shipment_id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -108,7 +110,7 @@ class OrderShipmentsDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'View',
|
||||
'title' => 'Order Shipment View',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.sales.shipments.view',
|
||||
'icon' => 'icon eye-icon'
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ class ProductDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'product_id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -129,14 +131,14 @@ class ProductDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Product',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.catalog.products.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Product',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.catalog.products.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class RolesDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -57,14 +59,14 @@ class RolesDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.roles.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.roles.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class SliderDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'slider_id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -60,14 +62,14 @@ class SliderDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Slider',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.sliders.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Slider',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.sliders.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class TaxCategoryDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -56,14 +58,14 @@ class TaxCategoryDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Tax Category',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.tax-categories.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Tax Category',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.tax-categories.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class TaxRateDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -101,14 +103,14 @@ class TaxRateDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit Tax Rate',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.tax-rates.store',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete Tax Rate',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.tax-rates.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class UserDataGrid extends DataGrid
|
|||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->setInvoker($this);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'user_id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
|
|
@ -85,14 +87,14 @@ class UserDataGrid extends DataGrid
|
|||
|
||||
public function prepareActions() {
|
||||
$this->addAction([
|
||||
'type' => 'Edit',
|
||||
'title' => 'Edit User',
|
||||
'method' => 'GET', // use GET request only for redirect purposes
|
||||
'route' => 'admin.users.edit',
|
||||
'icon' => 'icon pencil-lg-icon'
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'type' => 'Delete',
|
||||
'title' => 'Delete User',
|
||||
'method' => 'POST', // use GET request only for redirect purposes
|
||||
'route' => 'admin.users.delete',
|
||||
'icon' => 'icon trash-icon'
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use Webkul\Admin\Mail\NewAdminNotification;
|
|||
use Webkul\Admin\Mail\NewInvoiceNotification;
|
||||
use Webkul\Admin\Mail\NewShipmentNotification;
|
||||
use Webkul\Admin\Mail\NewInventorySourceNotification;
|
||||
|
||||
use Webkul\Admin\Mail\CancelOrderNotification;
|
||||
/**
|
||||
* Order event handler
|
||||
*
|
||||
|
|
@ -69,4 +69,15 @@ class Order {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @param mixed $order
|
||||
* */
|
||||
public function sendCancelOrderMail($order){
|
||||
try{
|
||||
Mail::queue(new CancelOrderNotification($order));
|
||||
}catch (\Exception $e){
|
||||
Log::error('Error occured when sending email '.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Webkul\Admin\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CancelOrderNotification extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/*
|
||||
* @var Order
|
||||
* */
|
||||
public $order;
|
||||
|
||||
public function __construct($order)
|
||||
{
|
||||
$this->order = $order;
|
||||
}
|
||||
|
||||
public function build()
|
||||
{
|
||||
return $this->to($this->order->customer_email, $this->order->customer_full_name)
|
||||
->subject(trans('shop::app.mail.order.cancel.subject'))
|
||||
->view('shop::emails.sales.order-cancel');
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,7 @@ class EventServiceProvider extends ServiceProvider
|
|||
Event::listen('sales.invoice.save.after', 'Webkul\Admin\Listeners\Order@sendNewInvoiceMail');
|
||||
|
||||
Event::listen('sales.shipment.save.after', 'Webkul\Admin\Listeners\Order@sendNewShipmentMail');
|
||||
|
||||
Event::listen('sales.order.cancel.after','Webkul\Admin\Listeners\Order@sendCancelOrderMail');
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,9 @@ return [
|
|||
'no result' => 'No result',
|
||||
'product' => 'Product',
|
||||
'attribute' => 'Attribute',
|
||||
'actions' => 'Actions',
|
||||
'id' => 'ID',
|
||||
'action' => 'action',
|
||||
'yes' => 'Yes',
|
||||
'no' => 'No',
|
||||
'true' => 'True',
|
||||
|
|
@ -18,6 +21,16 @@ return [
|
|||
'apply' => 'Apply',
|
||||
'action' => 'Action',
|
||||
'label' => 'Label',
|
||||
'name' => 'Name',
|
||||
'title' => 'Title',
|
||||
'code' => 'Code',
|
||||
'type' => 'Type',
|
||||
'required' => 'Required',
|
||||
'unique' => 'Unique',
|
||||
'locale-based' => 'Locale based',
|
||||
'channel-based' => 'Channel based',
|
||||
'status' => 'Status',
|
||||
'select-option' => 'Select option',
|
||||
|
||||
'common' => [
|
||||
'no-result-found' => 'We could not find any records.',
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<div class="page-action">
|
||||
<button type="submit" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.catalog.categories.-btn-title') }}
|
||||
{{ __('admin::app.catalog.categories-btn-title') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@
|
|||
<!-- Cart Attributes -->
|
||||
<div class="control-container mt-20" v-for="(condition, index) in conditions_list" :key="index">
|
||||
<select class="control" name="cart_attributes[]" v-model="conditions_list[index].attribute" title="You Can Make Multiple Selections Here" style="margin-right: 15px; width: 30%;" v-on:change="enableCondition($event, index)">
|
||||
<option disabled="disabled">{{ __('admin::app.promotion.select-attribtue', ['attrbibute' => 'Option']) }}</option>
|
||||
<option disabled="disabled">{{ __('admin::app.select-option') }}</option>
|
||||
<option v-for="(cart_ip, index1) in cart_input" :value="cart_ip.code" :key="index1">@{{ cart_ip.name }}</option>
|
||||
</select>
|
||||
|
||||
|
|
@ -199,7 +199,7 @@
|
|||
|
||||
<div v-if='conditions_list[index].attribute == "shipping_state"'>
|
||||
<select class="control" v-model="conditions_list[index].value">
|
||||
<option disabled="disabled">{{ __('admin::app.promotion.select-attribtue', ['attrbibute' => 'State']) }}</option>
|
||||
<option disabled="disabled">{{ __('admin::app.select-option') }}</option>
|
||||
<optgroup v-for='(state, code) in country_and_states.states' :label="code">
|
||||
<option v-for="(stateObj, index) in state" :value="stateObj.code">@{{ stateObj.default_name }}</option>
|
||||
</optgroup>
|
||||
|
|
@ -208,7 +208,7 @@
|
|||
|
||||
<div v-if='conditions_list[index].attribute == "shipping_country"'>
|
||||
<select class="control" v-model="conditions_list[index].value">
|
||||
<option disabled="disabled">{{ __('admin::app.promotion.select-attribtue', ['attrbibute' => 'Country']) }}</option>
|
||||
<option disabled="disabled">{{ __('admin::app.select-option']) }}</option>
|
||||
<option v-for="(country, index) in country_and_states.countries" :value="country.code">@{{ country.name }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -223,23 +223,18 @@
|
|||
starts_from: null,
|
||||
per_customer: 0,
|
||||
status: 1,
|
||||
use_coupon: null,
|
||||
auto_generation: false,
|
||||
usage_limit: 0,
|
||||
|
||||
action_type: null,
|
||||
apply: null,
|
||||
apply_amt: false,
|
||||
apply_prct: false,
|
||||
apply_to_shipping: 0,
|
||||
disc_amount: null,
|
||||
end_other_rules: 0,
|
||||
|
||||
all_conditions: [],
|
||||
|
||||
all_attributes: {
|
||||
'categories' : null,
|
||||
'attributes' : null
|
||||
'categories' : [],
|
||||
'attributes' : []
|
||||
},
|
||||
|
||||
criteria: 'cart',
|
||||
|
|
@ -377,13 +372,14 @@
|
|||
this.all_attributes.categories = this.category_values;
|
||||
}
|
||||
|
||||
this.all_attributes.attributes = this.attribute_values;
|
||||
if (this.attribute_values.length > 0) {
|
||||
this.all_attributes.attributes = this.attribute_values;
|
||||
}
|
||||
|
||||
this.all_conditions = JSON.stringify(this.all_attributes);
|
||||
} else {
|
||||
this.all_conditions = null;
|
||||
}
|
||||
|
||||
this.all_conditions = JSON.stringify(this.all_attributes);
|
||||
|
||||
// this.all_conditions = JSON.stringify(this.conditions_list);
|
||||
|
||||
// if (this.conditions_list.length != 0) {
|
||||
|
|
|
|||
|
|
@ -235,8 +235,8 @@
|
|||
all_conditions: [],
|
||||
|
||||
all_attributes: {
|
||||
'categories' : null,
|
||||
'attributes' : null
|
||||
'categories' : [],
|
||||
'attributes' : []
|
||||
},
|
||||
|
||||
criteria: 'cart',
|
||||
|
|
@ -365,22 +365,20 @@
|
|||
},
|
||||
|
||||
onSubmit: function (e) {
|
||||
if (this.attribute_values != null || this.category_values != null) {
|
||||
if (this.attribute_values.length > 0 || this.category_values.length > 0) {
|
||||
for (i in this.attribute_values) {
|
||||
delete this.attribute_values[i].options;
|
||||
}
|
||||
|
||||
if (this.category_values != null) {
|
||||
if (this.category_values.length > 0) {
|
||||
this.all_attributes.categories = this.category_values;
|
||||
}
|
||||
|
||||
this.all_attributes.attributes = this.attribute_values;
|
||||
|
||||
this.all_conditions = JSON.stringify(this.all_attributes);
|
||||
} else {
|
||||
this.all_conditions = null;
|
||||
}
|
||||
|
||||
this.all_conditions = JSON.stringify(this.all_attributes);
|
||||
|
||||
// this.all_conditions = JSON.stringify(this.conditions_list);
|
||||
|
||||
// if (this.conditions_list.length != 0) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class CartItem extends Model implements CartItemContract
|
|||
*/
|
||||
public function child()
|
||||
{
|
||||
return $this->belongsTo(self::class, 'id', 'parent_id');
|
||||
return $this->belongsTo(static::class, 'id', 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Helpers;
|
||||
|
||||
use Webkul\Customer\Repositories\WishlistRepository;
|
||||
|
||||
class Wishlist
|
||||
{
|
||||
/**
|
||||
* WishlistRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $wishlistRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Customer\Repositories\WishlistRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(WishlistRepository $wishlistRepository)
|
||||
{
|
||||
$this->wishlistRepository = $wishlistRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns wishlist products for current customer.
|
||||
*
|
||||
* @param Product $product
|
||||
* @return boolean
|
||||
*/
|
||||
public function getWishlistProduct($product)
|
||||
{
|
||||
$wishlist = false;
|
||||
|
||||
if (auth()->guard('customer')->user()) {
|
||||
$wishlist = $this->wishlistRepository->findOneWhere([
|
||||
'channel_id' => core()->getCurrentChannel()->id,
|
||||
'product_id' => $product->product_id,
|
||||
'customer_id' => auth()->guard('customer')->user()->id
|
||||
]);
|
||||
}
|
||||
|
||||
if ($wishlist)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -781,7 +781,7 @@ abstract class Discount
|
|||
foreach ($conditions as $condition) {
|
||||
$result = true;
|
||||
|
||||
if (! isset($condition->attribute) || ! isset($condition->condition) || ! isset($condition->value) || ! isset($condition->type) || $condition->value != []) {
|
||||
if (! isset($condition->attribute) || ! isset($condition->condition) || ! isset($condition->value) || ! isset($condition->type) || ! $condition->value != []) {
|
||||
$result = false;
|
||||
|
||||
continue;
|
||||
|
|
@ -911,7 +911,7 @@ abstract class Discount
|
|||
}
|
||||
|
||||
foreach ($conditions as $condition) {
|
||||
if (!isset($condition->attribute) || ! isset($condition->condition) || !isset($condition->value)) {
|
||||
if (! isset($condition->attribute) || ! isset($condition->condition) || ! isset($condition->value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,5 +9,6 @@ class ProductTableSeeder extends Seeder
|
|||
{
|
||||
public function run()
|
||||
{
|
||||
dd('running');
|
||||
}
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ class Review extends AbstractProduct
|
|||
public function getReviews($product)
|
||||
{
|
||||
static $reviews = [];
|
||||
|
||||
|
||||
if(array_key_exists($product->id, $reviews))
|
||||
return $reviews[$product->id];
|
||||
|
||||
|
|
|
|||
|
|
@ -108,4 +108,16 @@ class ProductForm extends FormRequest
|
|||
|
||||
return $this->rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom message for validation
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'variants.*.sku.unique' => 'The sku has already been taken.',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -284,13 +284,15 @@ class ProductFlat
|
|||
$productFlat->save();
|
||||
}
|
||||
} else {
|
||||
$productFlat = $this->productFlatRepository->findOneWhere([
|
||||
'product_id' => $product->id,
|
||||
'channel' => $channel->code,
|
||||
]);
|
||||
if (request()->route()->getName() == 'admin.catalog.products.update') {
|
||||
$productFlat = $this->productFlatRepository->findOneWhere([
|
||||
'product_id' => $product->id,
|
||||
'channel' => $channel->code,
|
||||
]);
|
||||
|
||||
if ($productFlat) {
|
||||
$this->productFlatRepository->delete($productFlat->id);
|
||||
if ($productFlat) {
|
||||
$this->productFlatRepository->delete($productFlat->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class Product extends Model implements ProductContract
|
|||
*/
|
||||
public function variants()
|
||||
{
|
||||
return $this->hasMany(self::class, 'parent_id');
|
||||
return $this->hasMany(static::class, 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -56,7 +56,7 @@ class Product extends Model implements ProductContract
|
|||
*/
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(self::class, 'parent_id');
|
||||
return $this->belongsTo(static::class, 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -122,7 +122,7 @@ class Product extends Model implements ProductContract
|
|||
*/
|
||||
public function related_products()
|
||||
{
|
||||
return $this->belongsToMany(self::class, 'product_relations', 'parent_id', 'child_id')->limit(4);
|
||||
return $this->belongsToMany(static::class, 'product_relations', 'parent_id', 'child_id')->limit(4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -130,7 +130,7 @@ class Product extends Model implements ProductContract
|
|||
*/
|
||||
public function up_sells()
|
||||
{
|
||||
return $this->belongsToMany(self::class, 'product_up_sells', 'parent_id', 'child_id')->limit(4);
|
||||
return $this->belongsToMany(static::class, 'product_up_sells', 'parent_id', 'child_id')->limit(4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -138,7 +138,7 @@ class Product extends Model implements ProductContract
|
|||
*/
|
||||
public function cross_sells()
|
||||
{
|
||||
return $this->belongsToMany(self::class, 'product_cross_sells', 'parent_id', 'child_id')->limit(4);
|
||||
return $this->belongsToMany(static::class, 'product_cross_sells', 'parent_id', 'child_id')->limit(4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -258,7 +258,7 @@ class Product extends Model implements ProductContract
|
|||
*/
|
||||
public function getAttribute($key)
|
||||
{
|
||||
if (! method_exists(self::class, $key) && ! in_array($key, ['parent_id', 'attribute_family_id']) && ! isset($this->attributes[$key])) {
|
||||
if (! method_exists(static::class, $key) && ! in_array($key, ['parent_id', 'attribute_family_id']) && ! isset($this->attributes[$key])) {
|
||||
if (isset($this->id)) {
|
||||
$this->attributes[$key] = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class ProductFlat extends Model implements ProductFlatContract
|
|||
*/
|
||||
public function variants()
|
||||
{
|
||||
return $this->hasMany(self::class, 'parent_id');
|
||||
return $this->hasMany(static::class, 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -201,6 +201,14 @@ input {
|
|||
}
|
||||
}
|
||||
|
||||
.add-to-wishlist.already {
|
||||
pointer-events: none;
|
||||
|
||||
.wishlist-icon {
|
||||
background-image: url('../images/wishlist-added.svg') !important;
|
||||
}
|
||||
}
|
||||
|
||||
//product page price styles
|
||||
.product-price {
|
||||
margin-bottom: 14px;
|
||||
|
|
@ -1727,6 +1735,9 @@ section.product-detail {
|
|||
}
|
||||
}
|
||||
|
||||
.add-to-wishlist.already {
|
||||
background-image: url('../images/wishlist-added.svg') !important;
|
||||
}
|
||||
|
||||
.share {
|
||||
position: absolute;
|
||||
|
|
|
|||
|
|
@ -526,7 +526,27 @@ return [
|
|||
'grand-total' => 'Grand Total',
|
||||
'final-summary' => 'Thanks for showing your interest in our store we will send you tracking number once it shipped',
|
||||
'help' => 'If you need any kind of help please contact us at :support_email',
|
||||
'thanks' => 'Thanks!'
|
||||
'thanks' => 'Thanks!',
|
||||
'cancel' => [
|
||||
'subject' => 'Order Cancel Confirmation',
|
||||
'heading' => 'Order Cancelled',
|
||||
'dear' => 'Dear :customer_name',
|
||||
'greeting' => 'You Order with order id #:order_id placed on :created_at has been cancelled',
|
||||
'summary' => 'Summary of Order',
|
||||
'shipping-address' => 'Shipping Address',
|
||||
'billing-address' => 'Billing Address',
|
||||
'contact' => 'Contact',
|
||||
'shipping' => 'Shipping Method',
|
||||
'payment' => 'Payment Method',
|
||||
'subtotal' => 'Subtotal',
|
||||
'shipping-handling' => 'Shipping & Handling',
|
||||
'tax' => 'Tax',
|
||||
'discount' => 'Discount',
|
||||
'grand-total' => 'Grand Total',
|
||||
'final-summary' => 'Thanks for showing your interest in our store',
|
||||
'help' => 'If you need any kind of help please contact us at :support_email',
|
||||
'thanks' => 'Thanks!',
|
||||
]
|
||||
],
|
||||
'invoice' => [
|
||||
'heading' => 'Your invoice #:invoice_id for Order #:order_id',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,193 @@
|
|||
@component('shop::emails.layouts.master')
|
||||
<div style="text-align: center;">
|
||||
<a href="{{ config('app.url') }}">
|
||||
<img src="{{ bagisto_asset('images/logo.svg') }}">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div style="padding: 30px;">
|
||||
<div style="font-size: 20px;color: #242424;line-height: 30px;margin-bottom: 34px;">
|
||||
<span style="font-weight: bold;">
|
||||
{{ __('shop::app.mail.order.cancel.heading') }}
|
||||
</span> <br>
|
||||
|
||||
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
|
||||
{{ __('shop::app.mail.order.cancel.dear', ['customer_name' => $order->customer_full_name]) }},
|
||||
</p>
|
||||
|
||||
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
|
||||
{!! __('shop::app.mail.order.cancel.greeting', [
|
||||
'order_id' => '<a href="' . route('customer.orders.view', $order->id) . '" style="color: #0041FF; font-weight: bold;">#' . $order->id . '</a>',
|
||||
'created_at' => $order->created_at
|
||||
])
|
||||
!!}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div style="font-weight: bold;font-size: 20px;color: #242424;line-height: 30px;margin-bottom: 20px !important;">
|
||||
{{ __('shop::app.mail.order.cancel.summary') }}
|
||||
</div>
|
||||
|
||||
<div style="display: flex;flex-direction: row;margin-top: 20px;justify-content: space-between;margin-bottom: 40px;">
|
||||
<div style="line-height: 25px;">
|
||||
<div style="font-weight: bold;font-size: 16px;color: #242424;">
|
||||
{{ __('shop::app.mail.order.cancel.shipping-address') }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ $order->shipping_address->name }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ $order->shipping_address->address1 }}, {{ $order->shipping_address->state }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ core()->country_name($order->shipping_address->country) }} {{ $order->shipping_address->postcode }}
|
||||
</div>
|
||||
|
||||
<div>---</div>
|
||||
|
||||
<div style="margin-bottom: 40px;">
|
||||
{{ __('shop::app.mail.order.cancel.contact') }} : {{ $order->shipping_address->phone }}
|
||||
</div>
|
||||
|
||||
<div style="font-size: 16px;color: #242424; font-weight: bold">
|
||||
{{ __('shop::app.mail.order.cancel.shipping') }}
|
||||
</div>
|
||||
|
||||
<div style="font-size: 16px;color: #242424;">
|
||||
{{ $order->shipping_title }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="line-height: 25px;">
|
||||
<div style="font-weight: bold;font-size: 16px;color: #242424;">
|
||||
{{ __('shop::app.mail.order.cancel.billing-address') }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ $order->billing_address->name }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ $order->billing_address->address1 }}, {{ $order->billing_address->state }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ core()->country_name($order->billing_address->country) }} {{ $order->billing_address->postcode }}
|
||||
</div>
|
||||
|
||||
<div>---</div>
|
||||
|
||||
<div style="margin-bottom: 40px;">
|
||||
{{ __('shop::app.mail.order.cancel.contact') }} : {{ $order->billing_address->phone }}
|
||||
</div>
|
||||
|
||||
<div style="font-size: 16px; color: #242424; font-weight: bold">
|
||||
{{ __('shop::app.mail.order.cancel.payment') }}
|
||||
</div>
|
||||
|
||||
<div style="font-size: 16px; color: #242424;">
|
||||
{{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<div class="table mb-20">
|
||||
<table style="overflow-x: auto; border-collapse: collapse;
|
||||
border-spacing: 0;width: 100%">
|
||||
<thead>
|
||||
<tr style="background-color: #f2f2f2">
|
||||
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.SKU') }}</th>
|
||||
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.product-name') }}</th>
|
||||
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.price') }}</th>
|
||||
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.qty') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($order->items as $item)
|
||||
<tr>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}" style="text-align: left;padding: 8px">{{ $item->child ? $item->child->sku : $item->sku }}</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}" style="text-align: left;padding: 8px">{{ $item->name }}</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.price') }}" style="text-align: left;padding: 8px">{{ core()->formatPrice($item->price, $order->order_currency_code) }}
|
||||
</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}" style="text-align: left;padding: 8px">{{ $item->qty_canceled }}</td>
|
||||
|
||||
@if ($html = $item->getOptionDetailHtml())
|
||||
<div style="">
|
||||
<label style="margin-top: 10px; font-size: 16px;color: #5E5E5E; display: block;">
|
||||
{{ $html }}
|
||||
</label>
|
||||
</div>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="font-size: 16px;color: #242424;line-height: 30px;float: right;width: 40%;margin-top: 20px;">
|
||||
<div>
|
||||
<span>{{ __('shop::app.mail.order.cancel.subtotal') }}</span>
|
||||
<span style="float: right;">
|
||||
{{ core()->formatPrice($order->sub_total, $order->order_currency_code) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span>{{ __('shop::app.mail.order.cancel.shipping-handling') }}</span>
|
||||
<span style="float: right;">
|
||||
{{ core()->formatPrice($order->shipping_amount, $order->order_currency_code) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span>{{ __('shop::app.mail.order.cancel.tax') }}</span>
|
||||
<span style="float: right;">
|
||||
{{ core()->formatPrice($order->tax_amount, $order->order_currency_code) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if ($order->discount_amount > 0)
|
||||
<div>
|
||||
<span>{{ __('shop::app.mail.order.cancel.discount') }}</span>
|
||||
<span style="float: right;">
|
||||
{{ core()->formatPrice($order->discount_amount, $order->order_currency_code) }}
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div style="font-weight: bold">
|
||||
<span>{{ __('shop::app.mail.order.cancel.grand-total') }}</span>
|
||||
<span style="float: right;">
|
||||
{{ core()->formatPrice($order->grand_total, $order->order_currency_code) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 65px;font-size: 16px;color: #5E5E5E;line-height: 24px;display: inline-block">
|
||||
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
|
||||
{{ __('shop::app.mail.order.cancel.final-summary') }}
|
||||
</p>
|
||||
|
||||
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
|
||||
{!!
|
||||
__('shop::app.mail.order.cancel.help', [
|
||||
'support_email' => '<a style="color:#0041FF" href="mailto:' . config('mail.from.address') . '">' . config('mail.from.address'). '</a>'
|
||||
])
|
||||
!!}
|
||||
</p>
|
||||
|
||||
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
|
||||
{{ __('shop::app.mail.order.cancel.thanks') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endcomponent
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
@inject ('productImageHelper', 'Webkul\Product\Helpers\ProductImage')
|
||||
@inject ('wishListHelper', 'Webkul\Customer\Helpers\Wishlist')
|
||||
|
||||
<?php $images = $productImageHelper->getGalleryImages($product); ?>
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.view.gallery.before', ['product' => $product]) !!}
|
||||
|
|
@ -41,7 +43,7 @@
|
|||
<img :src="currentLargeImageUrl" id="pro-img" :data-image="currentOriginalImageUrl"/>
|
||||
|
||||
@auth('customer')
|
||||
<a class="add-to-wishlist" href="{{ route('customer.wishlist.add', $product->product_id) }}">
|
||||
<a @if ($wishListHelper->getWishlistProduct($product)) class="add-to-wishlist already" @else class="add-to-wishlist" @endif href="{{ route('customer.wishlist.add', $product->product_id) }}">
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
|
|
@ -158,8 +160,10 @@
|
|||
$('img#pro-img').data('zoom-image', $('img#pro-img').data('image')).ezPlus();
|
||||
}
|
||||
|
||||
var wishlist = " <?php echo $wishListHelper->getWishlistProduct($product); ?> ";
|
||||
|
||||
$(document).mousemove(function(event) {
|
||||
if ($('.add-to-wishlist').length) {
|
||||
if ($('.add-to-wishlist').length && wishlist != 1) {
|
||||
if (event.pageX > $('.add-to-wishlist').offset().left && event.pageX < $('.add-to-wishlist').offset().left+32 && event.pageY > $('.add-to-wishlist').offset().top && event.pageY < $('.add-to-wishlist').offset().top+32) {
|
||||
|
||||
$(".zoomContainer").addClass("show-wishlist");
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
@inject ('wishListHelper', 'Webkul\Customer\Helpers\Wishlist')
|
||||
|
||||
@auth('customer')
|
||||
{!! view_render_event('bagisto.shop.products.wishlist.before') !!}
|
||||
|
||||
<a class="add-to-wishlist" href="{{ route('customer.wishlist.add', $product->product_id) }}" id="wishlist-changer">
|
||||
<a @if ($wishListHelper->getWishlistProduct($product)) class="add-to-wishlist already" @else class="add-to-wishlist" @endif href="{{ route('customer.wishlist.add', $product->product_id) }}" id="wishlist-changer">
|
||||
<span class="icon wishlist-icon"></span>
|
||||
</a>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Webkul\Ui\DataGrid;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Event;
|
||||
|
||||
/**
|
||||
* DataGrid class
|
||||
|
|
@ -12,22 +12,87 @@ use Illuminate\Http\Request;
|
|||
*/
|
||||
abstract class DataGrid
|
||||
{
|
||||
/**
|
||||
* set index columns, ex: id.
|
||||
*/
|
||||
protected $index = null;
|
||||
|
||||
/**
|
||||
* To know the class of datagrid calling parent methods, to be set by the extending class.
|
||||
*/
|
||||
protected $invoker = null;
|
||||
|
||||
/**
|
||||
* Default sort order of datagrid
|
||||
*/
|
||||
protected $sortOrder = 'asc';
|
||||
|
||||
/**
|
||||
* Situation handling property when working with custom columns in datagrid, helps abstaining
|
||||
* aliases on custom column.
|
||||
*/
|
||||
protected $enableFilterMap = false;
|
||||
|
||||
/**
|
||||
* This is array where aliases and custom column's name are passed
|
||||
*/
|
||||
protected $filterMap = [];
|
||||
|
||||
/**
|
||||
* array to hold all the columns which will be displayed on frontend.
|
||||
*/
|
||||
protected $columns = [];
|
||||
|
||||
protected $completeColumnDetails = [];
|
||||
|
||||
/**
|
||||
* Hold query builder instance of the query prepared by executing datagrid
|
||||
* class method setQueryBuilder
|
||||
*/
|
||||
protected $queryBuilder = [];
|
||||
|
||||
/**
|
||||
* Final result of the datagrid program that is collection object.
|
||||
*/
|
||||
protected $collection = [];
|
||||
|
||||
/**
|
||||
* Set of handly click tools which you could be using for various operations.
|
||||
* ex: dyanmic and static redirects, deleting, etc.
|
||||
*/
|
||||
protected $actions = [];
|
||||
|
||||
/**
|
||||
* Works on selection of values index column as comma separated list as response
|
||||
* to your endpoint set as route.
|
||||
*/
|
||||
protected $massActions = [];
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Parsed value of the url parameters
|
||||
*/
|
||||
protected $parse;
|
||||
|
||||
/**
|
||||
* To show mass action or not.
|
||||
*/
|
||||
protected $enableMassAction = false;
|
||||
|
||||
/**
|
||||
* To enable actions or not.
|
||||
*/
|
||||
protected $enableAction = false;
|
||||
|
||||
/**
|
||||
* paginate the collection or not
|
||||
*/
|
||||
protected $paginate = true;
|
||||
|
||||
/**
|
||||
* If paginated then value of pagination.
|
||||
*/
|
||||
protected $itemsPerPage = 15;
|
||||
|
||||
protected $operators = [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
|
|
@ -105,9 +170,13 @@ abstract class DataGrid
|
|||
|
||||
public function addColumn($column)
|
||||
{
|
||||
$this->fireEvent('add.column.before.'.$column['index']);
|
||||
|
||||
array_push($this->columns, $column);
|
||||
|
||||
$this->setCompleteColumnDetails($column);
|
||||
|
||||
$this->fireEvent('add.column.after.'.$column['index']);
|
||||
}
|
||||
|
||||
public function setCompleteColumnDetails($column)
|
||||
|
|
@ -122,16 +191,40 @@ abstract class DataGrid
|
|||
|
||||
public function addAction($action)
|
||||
{
|
||||
if (isset($action['title'])) {
|
||||
$eventName = strtolower($action['title']);
|
||||
$eventName = explode(' ', $eventName);
|
||||
$eventName = implode('.', $eventName);
|
||||
} else {
|
||||
$eventName = null;
|
||||
}
|
||||
|
||||
$this->fireEvent('action.before.'.$eventName);
|
||||
|
||||
array_push($this->actions, $action);
|
||||
|
||||
$this->enableAction = true;
|
||||
|
||||
$this->fireEvent('action.after.' . $eventName);
|
||||
}
|
||||
|
||||
public function addMassAction($massAction)
|
||||
{
|
||||
if (isset($massAction['label'])) {
|
||||
$eventName = strtolower($massAction['label']);
|
||||
$eventName = explode(' ', $eventName);
|
||||
$eventName = implode('.', $eventName);
|
||||
} else {
|
||||
$eventName = null;
|
||||
}
|
||||
|
||||
$this->fireEvent('mass.action.before.' . $eventName);
|
||||
|
||||
array_push($this->massActions, $massAction);
|
||||
|
||||
$this->enableMassAction = true;
|
||||
|
||||
$this->fireEvent('mass.action.after.' . $eventName);
|
||||
}
|
||||
|
||||
public function getCollection()
|
||||
|
|
@ -306,12 +399,32 @@ abstract class DataGrid
|
|||
return $collection;
|
||||
}
|
||||
|
||||
protected function fireEvent($name)
|
||||
{
|
||||
if (isset($name)) {
|
||||
$className = get_class($this->invoker);
|
||||
|
||||
$className = last(explode("\\", $className));
|
||||
|
||||
$className = strtolower($className);
|
||||
|
||||
$eventName = $className . '.' . $name;
|
||||
|
||||
Event::fire($eventName, $this->invoker);
|
||||
}
|
||||
}
|
||||
|
||||
public function prepareMassActions() {
|
||||
}
|
||||
|
||||
public function prepareActions() {
|
||||
}
|
||||
|
||||
public function setInvoker($object)
|
||||
{
|
||||
$this->invoker = $object;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$this->addColumns();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
Event::listen('attributedatagrid.before.add.column.id', function($dataGridInstance) {
|
||||
$data = [
|
||||
'index' => 'is_required',
|
||||
'label' => 'trans',
|
||||
'type' => 'boolean',
|
||||
'sortable' => true,
|
||||
'searchable' => false,
|
||||
'wrapper' => function ($value) {
|
||||
if ($value->is_required == 1)
|
||||
return 'True';
|
||||
else
|
||||
return 'False';
|
||||
}
|
||||
];
|
||||
|
||||
$dataGridInstance->addColumn($data);
|
||||
});
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
@endforeach
|
||||
|
||||
@if ($enableActions)
|
||||
<td class="actions" style="width: 100px;" data-value=" {{ __('ui::app.datagrid.actions') }}">
|
||||
<td class="actions" style="width: 100px;" data-value="{{ __('ui::app.datagrid.actions') }}">
|
||||
<div class="action">
|
||||
@foreach ($actions as $action)
|
||||
<a
|
||||
|
|
|
|||
Loading…
Reference in New Issue