Merge branch 'master' into elektronika
# Conflicts: # composer.json # composer.lock # config/app.php # packages/Webkul/Core/src/Core.php
This commit is contained in:
commit
7dfb10b650
|
|
@ -18,7 +18,7 @@
|
|||
"barryvdh/laravel-dompdf": "^0.8.5|^0.9.0",
|
||||
"diglactic/laravel-breadcrumbs": "^7.0",
|
||||
"doctrine/dbal": "^2.9",
|
||||
"enshrined/svg-sanitize": "^0.14.0",
|
||||
"enshrined/svg-sanitize": "^0.15.0",
|
||||
"facade/ignition": "^2.3.6",
|
||||
"fakerphp/faker": "^1.14",
|
||||
"fideloper/proxy": "^4.2",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -10,12 +10,12 @@
|
|||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.21.0",
|
||||
"axios": "^0.21.4",
|
||||
"cross-env": "^6.0.3",
|
||||
"jquery": "^3.4.1",
|
||||
"laravel-mix": "^5.0.0",
|
||||
"laravel-mix-merge-manifest": "^0.1.2",
|
||||
"sass": "^1.24.4",
|
||||
"sass": "^1.49.7",
|
||||
"sass-loader": "^8.0.2",
|
||||
"vue": "^2.6.14",
|
||||
"vue-template-compiler": "^2.6.14"
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* Pusher JavaScript Library v7.0.3
|
||||
* Pusher JavaScript Library v7.0.6
|
||||
* https://pusher.com/
|
||||
*
|
||||
* Copyright 2020, Pusher
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/admin.js": "/js/admin.js?id=94da304c8b02ad3ba649",
|
||||
"/css/admin.css": "/css/admin.css?id=df6b15e0f1deaef7b05c"
|
||||
"/js/admin.js": "/js/admin.js?id=bc9c89ab87fa03d71ad2",
|
||||
"/css/admin.css": "/css/admin.css?id=f0c6aef8448b6f982264"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,9 @@ use Illuminate\Support\Facades\DB;
|
|||
use Webkul\Customer\Models\CustomerAddress;
|
||||
use Webkul\Customer\Repositories\CustomerRepository;
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
use Webkul\Ui\DataGrid\Traits\ProvideDataGridPlus;
|
||||
|
||||
class AddressDataGrid extends DataGrid
|
||||
{
|
||||
use ProvideDataGridPlus;
|
||||
|
||||
/**
|
||||
* Index.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -7,23 +7,39 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
|
||||
class CartRuleCouponDataGrid extends DataGrid
|
||||
{
|
||||
/**
|
||||
* Index.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $index = 'id';
|
||||
|
||||
/**
|
||||
* Sort order.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $sortOrder = 'desc';
|
||||
|
||||
/**
|
||||
* Prepare query builder.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$route = request()->route() ? request()->route()->getName() : "" ;
|
||||
|
||||
$cartRuleId = $route == 'admin.cart-rules.edit' ? collect(request()->segments())->last() : last(explode("/", url()->previous()));
|
||||
|
||||
$queryBuilder = DB::table('cart_rule_coupons')
|
||||
->addSelect('id', 'code', 'created_at', 'expired_at', 'times_used')
|
||||
->where('cart_rule_coupons.cart_rule_id', $cartRuleId);
|
||||
->addSelect('id', 'code', 'created_at', 'expired_at', 'times_used')
|
||||
->where('cart_rule_coupons.cart_rule_id', request('id'));
|
||||
|
||||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add columns.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
@ -72,6 +88,11 @@ class CartRuleCouponDataGrid extends DataGrid
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare mass actions.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function prepareMassActions()
|
||||
{
|
||||
$this->addMassAction([
|
||||
|
|
|
|||
|
|
@ -5,12 +5,9 @@ namespace Webkul\Admin\DataGrids;
|
|||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Sales\Models\OrderAddress;
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
use Webkul\Ui\DataGrid\Traits\ProvideDataGridPlus;
|
||||
|
||||
class CustomerOrderDataGrid extends DataGrid
|
||||
{
|
||||
use ProvideDataGridPlus;
|
||||
|
||||
/**
|
||||
* Index.
|
||||
*
|
||||
|
|
@ -113,20 +110,20 @@ class CustomerOrderDataGrid extends DataGrid
|
|||
'sortable' => true,
|
||||
'searchable' => true,
|
||||
'filterable' => true,
|
||||
'closure' => function ($value) {
|
||||
'closure' => function ($value) {
|
||||
if ($value->status == 'processing') {
|
||||
return '<span class="badge badge-md badge-success">' . trans('admin::app.sales.orders.order-status-processing') . '</span>';
|
||||
} elseif ($value->status == 'completed') {
|
||||
return '<span class="badge badge-md badge-success">' . trans('admin::app.sales.orders.order-status-success') . '</span>';
|
||||
} elseif ($value->status == "canceled") {
|
||||
} elseif ($value->status == 'canceled') {
|
||||
return '<span class="badge badge-md badge-danger">' . trans('admin::app.sales.orders.order-status-canceled') . '</span>';
|
||||
} elseif ($value->status == "closed") {
|
||||
} elseif ($value->status == 'closed') {
|
||||
return '<span class="badge badge-md badge-info">' . trans('admin::app.sales.orders.order-status-closed') . '</span>';
|
||||
} elseif ($value->status == "pending") {
|
||||
} elseif ($value->status == 'pending') {
|
||||
return '<span class="badge badge-md badge-warning">' . trans('admin::app.sales.orders.order-status-pending') . '</span>';
|
||||
} elseif ($value->status == "pending_payment") {
|
||||
} elseif ($value->status == 'pending_payment') {
|
||||
return '<span class="badge badge-md badge-warning">' . trans('admin::app.sales.orders.order-status-pending-payment') . '</span>';
|
||||
} elseif ($value->status == "fraud") {
|
||||
} elseif ($value->status == 'fraud') {
|
||||
return '<span class="badge badge-md badge-danger">' . trans('admin::app.sales.orders.order-status-fraud') . '</span>';
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,12 +4,9 @@ namespace Webkul\Admin\DataGrids;
|
|||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
use Webkul\Ui\DataGrid\Traits\ProvideDataGridPlus;
|
||||
|
||||
class CustomersInvoicesDataGrid extends DataGrid
|
||||
{
|
||||
use ProvideDataGridPlus;
|
||||
|
||||
/**
|
||||
* Index column.
|
||||
*
|
||||
|
|
@ -57,7 +54,7 @@ class CustomersInvoicesDataGrid extends DataGrid
|
|||
'type' => 'number',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'filterable' => true
|
||||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
|
|
@ -87,7 +84,7 @@ class CustomersInvoicesDataGrid extends DataGrid
|
|||
'filterable' => true,
|
||||
'closure' => function ($value) {
|
||||
return '<a href="' . route('admin.sales.orders.view', $value->order_id) . '">' . $value->order_id . '</a>';
|
||||
}
|
||||
},
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
|
|
@ -106,7 +103,7 @@ class CustomersInvoicesDataGrid extends DataGrid
|
|||
'sortable' => true,
|
||||
'searchable' => true,
|
||||
'filterable' => true,
|
||||
'closure' => function ($value) {
|
||||
'closure' => function ($value) {
|
||||
if ($value->state == 'paid') {
|
||||
return '<span class="badge badge-md badge-success">' . trans('admin::app.sales.invoices.status-paid') . '</span>';
|
||||
} elseif ($value->state == 'pending' || $value->state == 'pending_payment') {
|
||||
|
|
|
|||
|
|
@ -7,11 +7,25 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
|
||||
class InvoicesTransactionsDatagrid extends DataGrid
|
||||
{
|
||||
|
||||
/**
|
||||
* Index.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $index = 'id';
|
||||
|
||||
/**
|
||||
* Sort order.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $sortOrder = 'desc';
|
||||
|
||||
/**
|
||||
* Prepare query builder.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('order_transactions')
|
||||
|
|
@ -19,7 +33,6 @@ class InvoicesTransactionsDatagrid extends DataGrid
|
|||
->select('order_transactions.id as id', 'order_transactions.transaction_id as transaction_id', 'order_transactions.invoice_id as invoice_id', 'order_transactions.created_at as created_at')
|
||||
->where('order_transactions.invoice_id', request('id'));
|
||||
|
||||
|
||||
$this->addFilter('id', 'order_transactions.id');
|
||||
$this->addFilter('transaction_id', 'order_transactions.transaction_id');
|
||||
$this->addFilter('order_id', 'ors.increment_id');
|
||||
|
|
@ -28,6 +41,11 @@ class InvoicesTransactionsDatagrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add columns.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
@ -58,6 +76,11 @@ class InvoicesTransactionsDatagrid extends DataGrid
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare actions.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function prepareActions()
|
||||
{
|
||||
$this->addAction([
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@
|
|||
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Sales\Models\OrderAddress;
|
||||
use Webkul\Ui\DataGrid\Traits\ProvideDataGridPlus;
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
|
||||
class OrderDataGrid extends DataGrid
|
||||
{
|
||||
use ProvideDataGridPlus;
|
||||
|
||||
/**
|
||||
* Index.
|
||||
*
|
||||
|
|
@ -112,20 +109,20 @@ class OrderDataGrid extends DataGrid
|
|||
'sortable' => true,
|
||||
'searchable' => true,
|
||||
'filterable' => true,
|
||||
'closure' => function ($value) {
|
||||
'closure' => function ($value) {
|
||||
if ($value->status == 'processing') {
|
||||
return '<span class="badge badge-md badge-success">' . trans('admin::app.sales.orders.order-status-processing') . '</span>';
|
||||
} elseif ($value->status == 'completed') {
|
||||
return '<span class="badge badge-md badge-success">' . trans('admin::app.sales.orders.order-status-success') . '</span>';
|
||||
} elseif ($value->status == "canceled") {
|
||||
} elseif ($value->status == 'canceled') {
|
||||
return '<span class="badge badge-md badge-danger">' . trans('admin::app.sales.orders.order-status-canceled') . '</span>';
|
||||
} elseif ($value->status == "closed") {
|
||||
} elseif ($value->status == 'closed') {
|
||||
return '<span class="badge badge-md badge-info">' . trans('admin::app.sales.orders.order-status-closed') . '</span>';
|
||||
} elseif ($value->status == "pending") {
|
||||
} elseif ($value->status == 'pending') {
|
||||
return '<span class="badge badge-md badge-warning">' . trans('admin::app.sales.orders.order-status-pending') . '</span>';
|
||||
} elseif ($value->status == "pending_payment") {
|
||||
} elseif ($value->status == 'pending_payment') {
|
||||
return '<span class="badge badge-md badge-warning">' . trans('admin::app.sales.orders.order-status-pending-payment') . '</span>';
|
||||
} elseif ($value->status == "fraud") {
|
||||
} elseif ($value->status == 'fraud') {
|
||||
return '<span class="badge badge-md badge-danger">' . trans('admin::app.sales.orders.order-status-fraud') . '</span>';
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace Webkul\Admin\Http\Controllers\Customer;
|
||||
|
||||
use Mail;
|
||||
use Webkul\Admin\DataGrids\CustomerDataGrid;
|
||||
use Webkul\Admin\DataGrids\CustomerOrderDataGrid;
|
||||
use Webkul\Admin\DataGrids\CustomersInvoicesDataGrid;
|
||||
use Webkul\Admin\Http\Controllers\Controller;
|
||||
|
|
@ -83,6 +84,10 @@ class CustomerController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(CustomerDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -195,24 +200,16 @@ class CustomerController extends Controller
|
|||
$customer = $this->customerRepository->findorFail($id);
|
||||
|
||||
try {
|
||||
|
||||
if (! $this->customerRepository->checkIfCustomerHasOrderPendingOrProcessing($customer)) {
|
||||
|
||||
$this->customerRepository->delete($id);
|
||||
} else {
|
||||
|
||||
session()->flash('error', trans('admin::app.response.order-pending', ['name' => 'Customer']));
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-success', ['name' => 'Customer'])]);
|
||||
}
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Customer']));
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['message' => trans('admin::app.response.order-pending', ['name' => 'Customer'])], 400);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Customer']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Customer'])], 400);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Admin\Http\Controllers\Customer;
|
||||
|
||||
use Webkul\Admin\DataGrids\CustomerGroupDataGrid;
|
||||
use Webkul\Admin\Http\Controllers\Controller;
|
||||
use Webkul\Customer\Repositories\CustomerGroupRepository;
|
||||
|
||||
|
|
@ -43,6 +44,10 @@ class CustomerGroupController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(CustomerGroupDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -123,21 +128,23 @@ class CustomerGroupController extends Controller
|
|||
$customerGroup = $this->customerGroupRepository->findOrFail($id);
|
||||
|
||||
if ($customerGroup->is_user_defined == 0) {
|
||||
session()->flash('warning', trans('admin::app.customers.customers.group-default'));
|
||||
} elseif (count($customerGroup->customers) > 0) {
|
||||
session()->flash('warning', trans('admin::app.response.customer-associate', ['name' => 'Customer Group']));
|
||||
} else {
|
||||
try {
|
||||
$this->customerGroupRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Customer Group']));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Customer Group']));
|
||||
}
|
||||
return response()->json([
|
||||
'message' => trans('admin::app.customers.customers.group-default'),
|
||||
], 400);
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
if (count($customerGroup->customers) > 0) {
|
||||
return response()->json([
|
||||
'message' => trans('admin::app.response.customer-associate', ['name' => 'Customer Group']),
|
||||
], 400);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->customerGroupRepository->delete($id);
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-success', ['name' => 'Customer Group'])]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Customer Group'])], 500);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
namespace Webkul\Admin\Http\Controllers\Sales;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Webkul\Admin\DataGrids\InvoicesTransactionsDatagrid;
|
||||
use Webkul\Admin\DataGrids\OrderInvoicesDataGrid;
|
||||
use Webkul\Admin\Http\Controllers\Controller;
|
||||
use Webkul\Admin\Traits\Mails;
|
||||
use Webkul\Core\Traits\PDFHandler;
|
||||
|
|
@ -61,9 +63,24 @@ class InvoiceController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(OrderInvoicesDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function invoiceTransactions($id)
|
||||
{
|
||||
return app(InvoicesTransactionsDatagrid::class)->toJson();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Admin\Http\Controllers\Sales;
|
||||
|
||||
use Webkul\Admin\DataGrids\OrderRefundDataGrid;
|
||||
use Webkul\Admin\Http\Controllers\Controller;
|
||||
use Webkul\Sales\Repositories\OrderItemRepository;
|
||||
use Webkul\Sales\Repositories\OrderRepository;
|
||||
|
|
@ -68,6 +69,10 @@ class RefundController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(OrderRefundDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Admin\Http\Controllers\Sales;
|
||||
|
||||
use Webkul\Admin\DataGrids\OrderShipmentsDataGrid;
|
||||
use Webkul\Admin\Http\Controllers\Controller;
|
||||
use Webkul\Sales\Repositories\OrderItemRepository;
|
||||
use Webkul\Sales\Repositories\OrderRepository;
|
||||
|
|
@ -68,6 +69,10 @@ class ShipmentController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(OrderShipmentsDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,14 +3,12 @@
|
|||
namespace Webkul\Admin\Http\Controllers\Sales;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
use Webkul\Admin\DataGrids\OrderTransactionsDataGrid;
|
||||
use Webkul\Admin\Http\Controllers\Controller;
|
||||
use Webkul\Payment\Facades\Payment;
|
||||
|
||||
use Webkul\Sales\Repositories\InvoiceRepository;
|
||||
use Webkul\Sales\Repositories\OrderRepository;
|
||||
use Webkul\Sales\Repositories\OrderTransactionRepository;
|
||||
use Webkul\Sales\Repositories\InvoiceRepository;
|
||||
|
||||
class TransactionController extends Controller
|
||||
{
|
||||
|
|
@ -22,21 +20,21 @@ class TransactionController extends Controller
|
|||
protected $_config;
|
||||
|
||||
/**
|
||||
* OrderRepository object
|
||||
* Order repository instance.
|
||||
*
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* OrderRepository object
|
||||
* Order transaction repository instance.
|
||||
*
|
||||
* @var \Webkul\Sales\Repositories\OrderTransactionRepository
|
||||
*/
|
||||
protected $orderTransactionRepository;
|
||||
|
||||
/**
|
||||
* InvoiceRepository object
|
||||
* Invoice repository instance.
|
||||
*
|
||||
* @var \Webkul\Sales\Repositories\InvoiceRepository
|
||||
*/
|
||||
|
|
@ -53,8 +51,7 @@ class TransactionController extends Controller
|
|||
public function __construct(
|
||||
OrderRepository $orderRepository,
|
||||
OrderTransactionRepository $orderTransactionRepository,
|
||||
InvoiceRepository $invoiceRepository)
|
||||
{
|
||||
InvoiceRepository $invoiceRepository) {
|
||||
$this->middleware('admin');
|
||||
|
||||
$this->_config = request('_config');
|
||||
|
|
@ -73,6 +70,10 @@ class TransactionController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(OrderTransactionsDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -84,6 +85,7 @@ class TransactionController extends Controller
|
|||
public function create()
|
||||
{
|
||||
$payment_methods = Payment::getSupportedPaymentMethods();
|
||||
|
||||
return view($this->_config['view'], compact('payment_methods'));
|
||||
}
|
||||
|
||||
|
|
@ -94,40 +96,37 @@ class TransactionController extends Controller
|
|||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validate = $this->validate(request(), [
|
||||
$this->validate(request(), [
|
||||
'invoice_id' => 'required',
|
||||
'payment_method' => 'required',
|
||||
'amount' => 'required|numeric'
|
||||
'amount' => 'required|numeric',
|
||||
]);
|
||||
|
||||
$invoice = $this->invoiceRepository->where('increment_id', $request->invoice_id)->first();
|
||||
|
||||
if ($invoice) {
|
||||
|
||||
if ($invoice->state == 'paid') {
|
||||
session()->flash('info', trans('admin::app.sales.transactions.response.already-paid'));
|
||||
|
||||
return redirect(route('admin.sales.transactions.index'));
|
||||
}
|
||||
|
||||
$order = $this->orderRepository->find($invoice->order_id);
|
||||
|
||||
$data = [
|
||||
"paidAmount" => $request->amount
|
||||
];
|
||||
|
||||
$randomId = random_bytes(20);
|
||||
$transactionId = bin2hex($randomId);
|
||||
|
||||
$transactionData['transaction_id'] = $transactionId;
|
||||
$transactionData['type'] = $request->payment_method;
|
||||
$transactionData['payment_method'] = $request->payment_method;
|
||||
$transactionData['invoice_id'] = $invoice->id;
|
||||
$transactionData['order_id'] = $invoice->order_id;
|
||||
$transactionData['amount'] = $request->amount;
|
||||
$transactionData['status'] = 'paid';
|
||||
$transactionData['data'] = json_encode($data);
|
||||
|
||||
$this->orderTransactionRepository->create($transactionData);
|
||||
$this->orderTransactionRepository->create([
|
||||
'transaction_id' => bin2hex($randomId),
|
||||
'type' => $request->payment_method,
|
||||
'payment_method' => $request->payment_method,
|
||||
'invoice_id' => $invoice->id,
|
||||
'order_id' => $invoice->order_id,
|
||||
'amount' => $request->amount,
|
||||
'status' => 'paid',
|
||||
'data' => json_encode([
|
||||
'paidAmount' => $request->amount,
|
||||
]),
|
||||
]);
|
||||
|
||||
$transactionTotal = $this->orderTransactionRepository->where('invoice_id', $invoice->id)->sum('amount');
|
||||
|
||||
|
|
@ -140,16 +139,17 @@ class TransactionController extends Controller
|
|||
$this->orderRepository->updateOrderStatus($order, 'processing');
|
||||
}
|
||||
|
||||
$this->invoiceRepository->updateState($invoice, "paid");
|
||||
$this->invoiceRepository->updateState($invoice, 'paid');
|
||||
}
|
||||
|
||||
session()->flash('success', trans('admin::app.sales.transactions.response.transaction-saved'));
|
||||
return redirect(route('admin.sales.transactions.index'));
|
||||
|
||||
} else {
|
||||
session()->flash('error', trans('admin::app.sales.transactions.response.invoice-missing'));
|
||||
return redirect()->back();
|
||||
return redirect(route('admin.sales.transactions.index'));
|
||||
}
|
||||
|
||||
session()->flash('error', trans('admin::app.sales.transactions.response.invoice-missing'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -170,12 +170,13 @@ class TransactionController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert Transaction Details Data into single Dim Array.
|
||||
* Convert transaction details data into single dim array.
|
||||
*
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function convertIntoSingleDimArray($transData) {
|
||||
*/
|
||||
public function convertIntoSingleDimArray($transData)
|
||||
{
|
||||
static $detailsData = [];
|
||||
|
||||
foreach ($transData as $key => $data) {
|
||||
|
|
|
|||
|
|
@ -25,11 +25,10 @@ class Order
|
|||
|
||||
/* now refunding order on the basis of capture id and refund data */
|
||||
$smartButton->refundOrder($captureID, [
|
||||
'amount' =>
|
||||
[
|
||||
'value' => $refund->grand_total,
|
||||
'currency_code' => $refund->order_currency_code
|
||||
]
|
||||
'amount' => [
|
||||
'value' => $refund->grand_total,
|
||||
'currency_code' => $refund->order_currency_code,
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,11 +66,11 @@ Vue.component(
|
|||
Vue.component(
|
||||
'notification',
|
||||
require('./components/navigation/notification').default
|
||||
);
|
||||
);
|
||||
Vue.component(
|
||||
'notification-list',
|
||||
require('./components/navigation/notification-list').default
|
||||
);
|
||||
);
|
||||
Vue.component('pagination', pagination);
|
||||
|
||||
$(function() {
|
||||
|
|
@ -197,6 +197,8 @@ $(function() {
|
|||
flashMessages.forEach(function(flash) {
|
||||
flashes.addFlash(flash);
|
||||
}, this);
|
||||
|
||||
flashMessages = [];
|
||||
},
|
||||
|
||||
showModal: function(id) {
|
||||
|
|
@ -210,7 +212,7 @@ $(function() {
|
|||
},
|
||||
|
||||
checkMode(){
|
||||
|
||||
|
||||
this.isDarkMode = ! this.isDarkMode;
|
||||
|
||||
localStorage.setItem('dark-mode', this.isDarkMode);
|
||||
|
|
@ -223,7 +225,7 @@ $(function() {
|
|||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -175,16 +175,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
#calender-destop{
|
||||
#calender-destop {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#calender-mobile{
|
||||
#calender-mobile {
|
||||
position: relative;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#calender-mobile span{
|
||||
#calender-mobile span {
|
||||
background-image: url(../images/Icon-Calendar.svg);
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
@ -195,21 +195,31 @@
|
|||
right: 4px;
|
||||
}
|
||||
|
||||
#date-start{
|
||||
display:block;
|
||||
width: 337px;
|
||||
margin-top:40px;
|
||||
#date-start {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 40px;
|
||||
margin-left: -20px;
|
||||
|
||||
.control-group {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#date-end{
|
||||
display:block;
|
||||
width: 337px;
|
||||
#date-end {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-left: -20px;
|
||||
|
||||
.control-group {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#date-submit{
|
||||
display:block;
|
||||
width: 337px;
|
||||
margin-top:15px;
|
||||
#date-submit {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.rtl {
|
||||
|
|
@ -223,46 +233,58 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#calender-mobile span {
|
||||
right: unset;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
.start-date:after,
|
||||
.end-date:after {
|
||||
margin-left: 0px;
|
||||
top: 43%;
|
||||
left: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
// responsive css for modal
|
||||
@media only screen and (max-width: 770px) {
|
||||
|
||||
.dashboard {
|
||||
.dashboard {
|
||||
|
||||
.card {
|
||||
padding: 10px 0px 0px 15px;
|
||||
overflow: auto;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
.sale-stock {
|
||||
display: block;
|
||||
margin-top: 30px;
|
||||
margin-bottom:10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.graph-stats {
|
||||
|
||||
.graph-stats {
|
||||
.left-card-container {
|
||||
float: left;
|
||||
width: 100%;
|
||||
padding-right: 0px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.right-card-container {
|
||||
float: left;
|
||||
width: 100%;
|
||||
padding-left: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#calender-mobile{
|
||||
}
|
||||
}
|
||||
|
||||
#calender-mobile {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#calender-destop{
|
||||
#calender-destop {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
|
@ -820,7 +820,6 @@ body {
|
|||
}
|
||||
|
||||
.content-container {
|
||||
padding-left: 0px;
|
||||
position: absolute;
|
||||
margin-top: 60px;
|
||||
top: 0px;
|
||||
|
|
|
|||
|
|
@ -11,25 +11,28 @@ $toggleColor: #3c41ff;
|
|||
max-height: $toggleSize + $toggleMargin;
|
||||
overflow: visible;
|
||||
outline: none;
|
||||
|
||||
|
||||
&.is-active {
|
||||
.nav-toggle {
|
||||
&:before, &:after {
|
||||
|
||||
&:before,
|
||||
&:after {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-items,.nav-top {
|
||||
|
||||
.nav-items,
|
||||
.nav-top {
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
|
||||
.overlay{
|
||||
.overlay {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.overlay{
|
||||
background-color: rgba(0,0,0,0.8);
|
||||
.overlay {
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
|
@ -38,9 +41,9 @@ $toggleColor: #3c41ff;
|
|||
display: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
|
||||
.nav-toggle {
|
||||
background-image: url(./../images/hamburger.svg);
|
||||
background-image: url(./../images/hamburger.svg);
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
position: relative;
|
||||
|
|
@ -49,7 +52,7 @@ $toggleColor: #3c41ff;
|
|||
height: $toggleSize;
|
||||
margin: $toggleMargin;
|
||||
z-index: 1;
|
||||
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
@ -86,7 +89,7 @@ $toggleColor: #3c41ff;
|
|||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.nav-top {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
|
@ -103,41 +106,41 @@ $toggleColor: #3c41ff;
|
|||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
align-content: start;
|
||||
box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
|
||||
text-decoration: none;
|
||||
|
||||
.pro-info{
|
||||
.pro-info {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
position: absolute;
|
||||
|
||||
.profile-info-icon{
|
||||
position:absolute;
|
||||
display:inline-block;
|
||||
.profile-info-icon {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
background: #3c41ff;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
|
||||
> span{
|
||||
display:block;
|
||||
margin:6px;
|
||||
>span {
|
||||
display: block;
|
||||
margin: 6px;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.profile-info-desc{
|
||||
display:inline-block;
|
||||
.profile-info-desc {
|
||||
display: inline-block;
|
||||
margin-left: 40px;
|
||||
|
||||
.name{
|
||||
.name {
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.role{
|
||||
.role {
|
||||
font-size: 10px;
|
||||
color: #000;
|
||||
}
|
||||
|
|
@ -145,8 +148,8 @@ $toggleColor: #3c41ff;
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
.nav-items{
|
||||
|
||||
.nav-items {
|
||||
position: fixed;
|
||||
top: 60px;
|
||||
left: 0;
|
||||
|
|
@ -163,7 +166,7 @@ $toggleColor: #3c41ff;
|
|||
grid-template-columns: 1fr;
|
||||
align-content: start;
|
||||
box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
|
||||
overflow-y: scroll ;
|
||||
overflow-y: scroll;
|
||||
text-decoration: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
|
|
@ -175,131 +178,154 @@ $toggleColor: #3c41ff;
|
|||
font-size: 16px;
|
||||
text-transform: capitalize;
|
||||
text-decoration: none;
|
||||
|
||||
a{
|
||||
color:#000;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
|
||||
.arrow-icon{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
a {
|
||||
color: #000;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
|
||||
.arrow-icon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
ul{
|
||||
display: none;
|
||||
|
||||
.navbar-child{
|
||||
text-transform: capitalize;
|
||||
padding: 15px;
|
||||
&.active,&:hover {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
}
|
||||
}
|
||||
ul {
|
||||
display: none;
|
||||
|
||||
.display-block{
|
||||
display: block !important;
|
||||
}
|
||||
.navbar-child {
|
||||
text-transform: capitalize;
|
||||
padding: 15px;
|
||||
|
||||
&.active {
|
||||
background-color: #e6e6e6;
|
||||
> a{
|
||||
background-color: #ddd;
|
||||
&.active,
|
||||
&:hover {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
> a{
|
||||
background-color: #ddd;
|
||||
}
|
||||
}
|
||||
.display-block {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: #e6e6e6;
|
||||
|
||||
>a {
|
||||
background-color: #ddd;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
>a {
|
||||
background-color: #ddd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rtl{
|
||||
.nav-container{
|
||||
.rtl {
|
||||
.nav-container {
|
||||
|
||||
.close{
|
||||
left:13px;
|
||||
.close {
|
||||
left: 13px;
|
||||
right: auto !important;
|
||||
}
|
||||
|
||||
|
||||
&.is-active {
|
||||
.nav-toggle {
|
||||
&:before, &:after {
|
||||
|
||||
&:before,
|
||||
&:after {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-items,.nav-top {
|
||||
|
||||
.nav-items,
|
||||
.nav-top {
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
|
||||
.overlay{
|
||||
|
||||
.overlay {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-top{
|
||||
.nav-top {
|
||||
right: 0;
|
||||
left: 100%;
|
||||
transform: translate(calc(100% + 50px), 0);
|
||||
|
||||
.pro-info{
|
||||
.profile-info-desc{
|
||||
.pro-info {
|
||||
.profile-info-desc {
|
||||
margin-left: 0px;
|
||||
margin-right: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.nav-items{
|
||||
|
||||
.nav-items {
|
||||
right: 0;
|
||||
left: 100%;
|
||||
transform: translate(calc(100% + 50px), 0);
|
||||
|
||||
|
||||
a{
|
||||
.arrow-icon{
|
||||
position: absolute;
|
||||
right: auto;
|
||||
left: 20px;
|
||||
}
|
||||
a {
|
||||
.arrow-icon {
|
||||
position: absolute;
|
||||
right: auto;
|
||||
left: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px){
|
||||
.nav-container {
|
||||
display: inline-block;
|
||||
}
|
||||
@media only screen and (max-width: 768px) {
|
||||
.nav-container {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.destop-logo {
|
||||
display: none;
|
||||
}
|
||||
.destop-logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-container{
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
.content-container {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
|
||||
.padding-container-navbar-not-expand {
|
||||
padding-left: 0 !important;
|
||||
.padding-container-navbar-not-expand {
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
.padding-container-navbar-expand {
|
||||
padding-left: 0 !important;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
.rtl {
|
||||
.padding-container-navbar-not-expand {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
.content-container {
|
||||
padding-left: 0px !important;
|
||||
padding-right: 0px !important;
|
||||
}
|
||||
|
||||
.padding-container-navbar-expand {
|
||||
padding-right: 0 !important;
|
||||
.padding-container-navbar-not-expand {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
.padding-container-navbar-expand {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.control-group {
|
||||
|
||||
&.date,
|
||||
&.datetime {
|
||||
|
||||
&::after {
|
||||
margin-right: -34px;
|
||||
right: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
.content-container {
|
||||
padding-left: 0px;
|
||||
padding-right: 56px;
|
||||
|
||||
.content .page-header {
|
||||
.page-title {
|
||||
|
|
|
|||
|
|
@ -1414,12 +1414,12 @@ return [
|
|||
'registration' => 'Send a confirmation e-mail after customer registration',
|
||||
'customer-registration-confirmation-mail-to-admin' => 'Send a confirmation e-mail to admin after customer registration',
|
||||
'customer' => 'Send the customer account credentials after registration',
|
||||
'new-order' => 'Send a confirmation email to the customer after placing a new order',
|
||||
'new-admin' => 'Send a confirmation email to the admin after placing a new order',
|
||||
'new-invoice' => 'Send a notification e-mail after creating a new invoice',
|
||||
'new-refund' => 'Send a notification e-mail after creating a refund',
|
||||
'new-shipment' => 'Send a notification e-mail after creating a shipment',
|
||||
'new-inventory-source' => 'Send a notification e-email after creating a new inventory source',
|
||||
'new-order' => 'Send a confirmation e-mail to the customer after placing a new order',
|
||||
'new-admin' => 'Send a confirmation e-mail to the admin after placing a new order',
|
||||
'new-invoice' => 'Send a notification e-mail to the customer after creating a new invoice',
|
||||
'new-refund' => 'Send a notification e-mail to the customer after creating a refund',
|
||||
'new-shipment' => 'Send a notification e-mail to the customer after creating a shipment',
|
||||
'new-inventory-source' => 'Send a notification e-mail to the inventory source after creating a shipment',
|
||||
'cancel-order' => 'Send a notification after canceling an order',
|
||||
],
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -12,7 +12,10 @@
|
|||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<a href="{{ route('admin.catalog.attributes.create') }}" class="btn btn-lg btn-primary">
|
||||
<a
|
||||
href="{{ route('admin.catalog.attributes.create') }}"
|
||||
class="btn btn-lg btn-primary"
|
||||
>
|
||||
{{ __('admin::app.catalog.attributes.add-title') }}
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -21,9 +24,7 @@
|
|||
{!! view_render_event('bagisto.admin.catalog.attributes.list.before') !!}
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\AttributeDataGrid')->render() !!}
|
||||
|
||||
<datagrid-plus src="{{ route('admin.catalog.attributes.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.admin.catalog.attributes.list.after') !!}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
@php($locale = core()->getRequestedLocaleCode())
|
||||
@php
|
||||
$locale = core()->getRequestedLocaleCode();
|
||||
@endphp
|
||||
|
||||
@extends('admin::layouts.content')
|
||||
|
||||
|
|
@ -13,15 +15,20 @@
|
|||
<h1>{{ __('admin::app.catalog.categories.title') }}</h1>
|
||||
|
||||
<div class="control-group">
|
||||
|
||||
<select class="control" id="locale-switcher" name="locale"
|
||||
onchange="reloadPage('locale', this.value)">
|
||||
<select
|
||||
class="control"
|
||||
id="locale-switcher"
|
||||
name="locale"
|
||||
onchange="reloadPage('locale', this.value)"
|
||||
>
|
||||
<option value="all" {{ ! isset($locale) ? 'selected' : '' }}>
|
||||
{{ __('admin::app.admin.system.all-locales') }}
|
||||
</option>
|
||||
|
||||
@foreach (core()->getAllLocales() as $localeModel)
|
||||
<option
|
||||
value="{{ $localeModel->code }}" {{ (isset($locale) && ($localeModel->code) == $locale) ? 'selected' : '' }}>
|
||||
value="{{ $localeModel->code }}" {{ (isset($locale) && ($localeModel->code) == $locale) ? 'selected' : '' }}
|
||||
>
|
||||
{{ $localeModel->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
|
@ -33,15 +40,13 @@
|
|||
<a href="{{ route('admin.catalog.categories.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.catalog.categories.add-title') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.admin.catalog.categories.list.before') !!}
|
||||
|
||||
<div class="page-content">
|
||||
@inject('categories', 'Webkul\Admin\DataGrids\CategoryDataGrid')
|
||||
|
||||
{!! $categories->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.catalog.categories.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.admin.catalog.categories.list.after') !!}
|
||||
|
|
|
|||
|
|
@ -21,12 +21,10 @@
|
|||
{!! view_render_event('bagisto.admin.catalog.families.list.before') !!}
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\AttributeFamilyDataGrid')->render() !!}
|
||||
|
||||
<datagrid-plus src="{{ route('admin.catalog.families.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.admin.catalog.families.list.after') !!}
|
||||
|
||||
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@
|
|||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span >
|
||||
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
</div>
|
||||
|
|
@ -28,9 +29,7 @@
|
|||
{!! view_render_event('bagisto.admin.catalog.products.list.before') !!}
|
||||
|
||||
<div class="page-content">
|
||||
@inject('products', 'Webkul\Admin\DataGrids\ProductDataGrid')
|
||||
|
||||
{!! $products->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.catalog.products.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.admin.catalog.products.list.after') !!}
|
||||
|
|
@ -38,6 +37,7 @@
|
|||
|
||||
<modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
@stop
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $products])
|
||||
@include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\ProductDataGrid')])
|
||||
|
||||
<script>
|
||||
function reloadPage(getVar, getVal) {
|
||||
|
|
@ -84,4 +84,4 @@
|
|||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -5,16 +5,17 @@
|
|||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.cms.pages.pages') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span >
|
||||
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
</div>
|
||||
|
|
@ -26,14 +27,13 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('cmsGrid', 'Webkul\Admin\DataGrids\CMSPageDataGrid')
|
||||
|
||||
{!! $cmsGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.cms.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
|
|
@ -41,6 +41,5 @@
|
|||
@stop
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $cmsGrid])
|
||||
@include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\CMSPageDataGrid')])
|
||||
@endpush
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = '{{ route('admin.customer.edit', ['id' => $customer->id]) }}'"></i>
|
||||
|
||||
|
||||
{{ __('admin::app.customers.addresses.title', ['customer_name' => $customer->first_name . ' ' . $customer->last_name]) }}
|
||||
</h1>
|
||||
</div>
|
||||
|
|
@ -25,9 +25,7 @@
|
|||
{!! view_render_event('bagisto.admin.customer.addresses.list.before') !!}
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\AddressDataGrid')->render() !!}
|
||||
|
||||
<datagrid-plus src="{{ route('admin.customer.addresses.index', $customer->id) }}"></datagrid-plus>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.admin.customer.addresses.list.after') !!}
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('address::app.admin.addresses.title-orders', ['customer_name' => $customer->first_name . ' ' . $customer->last_name]) }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = '{{ route('admin.customer.index') }}'"></i>
|
||||
|
||||
{{ __('address::app.admin.addresses.title-orders', ['customer_name' => $customer->first_name . ' ' . $customer->last_name]) }}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><a href="{{ route('admin.address.addresses.index', ['id' => $customer->id]) }}">{{ __('address::app.admin.addresses.address-list') }}</a></li>
|
||||
|
||||
<li class="active"><a href="{{ route('admin.address.orders.index', ['id' => $customer->id]) }}">{{ __('address::app.admin.addresses.order-list') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{!! app('Webkul\Address\DataGrids\Admin\OrderDataGrid')->render() !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
|
@ -5,12 +5,12 @@
|
|||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.customers.groups.title') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<a href="{{ route('admin.groups.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.customers.groups.add-title') }}
|
||||
|
|
@ -19,9 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('customerGroup','Webkul\Admin\DataGrids\CustomerGroupDataGrid')
|
||||
{!! $customerGroup->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.groups.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -5,16 +5,17 @@
|
|||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.customers.customers.title') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span >
|
||||
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
</div>
|
||||
|
|
@ -26,22 +27,19 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('customerGrid','Webkul\Admin\DataGrids\CustomerDataGrid')
|
||||
|
||||
{!! $customerGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.customer.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
</modal>
|
||||
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $customerGrid])
|
||||
@include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\CustomerDataGrid')])
|
||||
@endpush
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.customers.orders.list', ['customer_name' => $customer->first_name . ' ' . $customer->last_name]) }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
|
||||
|
||||
{{ __('admin::app.customers.orders.list', ['customer_name' => $customer->first_name . ' ' . $customer->last_name]) }}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('customerOrderGrid','Webkul\Admin\DataGrids\CustomerOrderDataGrid')
|
||||
|
||||
{!! $customerOrderGrid->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
|
@ -5,23 +5,17 @@
|
|||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.customers.reviews.title') }}</h1>
|
||||
</div>
|
||||
<div class="page-action">
|
||||
{{-- <a href="{{ route('admin.users.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('Add Customer') }}
|
||||
</a> --}}
|
||||
</div>
|
||||
|
||||
<div class="page-action"></div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('review','Webkul\Admin\DataGrids\CustomerReviewDataGrid')
|
||||
{!! $review->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.customer.review.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<script type="text/x-template" id="export-form-template">
|
||||
<form method="POST" action="{{ route('admin.datagrid.export', ['locale' => core()->getRequestedLocaleCode()]) }}" @submit.prevent="onSubmit">
|
||||
|
||||
<div class="page-content">
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
|
|
@ -23,7 +22,6 @@
|
|||
<button type="submit" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.export.export') }}
|
||||
</button>
|
||||
|
||||
</form>
|
||||
</script>
|
||||
|
||||
|
|
@ -33,13 +31,14 @@
|
|||
|
||||
methods: {
|
||||
onSubmit: function(e) {
|
||||
var this_this = this;
|
||||
var self = this;
|
||||
|
||||
e.target.submit();
|
||||
|
||||
setTimeout(function() {
|
||||
this_this.$root.$set(this_this.$root.modalIds, 'downloadDataGrid', false);
|
||||
self.$root.$set(self.$root.modalIds, 'downloadDataGrid', false);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
{!! view_render_event('bagisto.admin.layout.nav-left.after') !!}
|
||||
|
||||
<div :class="isMenuOpen ? 'content-container padding-container-navbar-expand' : 'content-container padding-container-navbar-not-expand'">
|
||||
<div class="content-container" :class="isMenuOpen ? 'padding-container-navbar-expand' : 'padding-container-navbar-not-expand'">
|
||||
|
||||
{!! view_render_event('bagisto.admin.layout.content.before') !!}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\CampaignDataGrid')->render() !!}
|
||||
|
||||
<datagrid-plus src="{{ route('admin.campaigns.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\EventDataGrid')->render() !!}
|
||||
|
||||
<datagrid-plus src="{{ route('admin.events.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -5,24 +5,15 @@
|
|||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.customers.subscribers.title') }}</h1>
|
||||
</div>
|
||||
|
||||
{{-- <div class="page-action">
|
||||
<a href="{{ route('admin.subscribers.store') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.customers.subscribers.add-title') }}
|
||||
</a>
|
||||
</div> --}}
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('subscribers','Webkul\Admin\DataGrids\NewsLetterDataGrid')
|
||||
{!! $subscribers->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.customers.subscribers.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\EmailTemplateDataGrid')->render() !!}
|
||||
|
||||
<datagrid-plus src="{{ route('admin.email-templates.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
|
||||
<accordian :title="'{{ __('admin::app.promotions.cart-rules.rule-information') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
||||
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||
<label for="name" class="required">{{ __('admin::app.promotions.cart-rules.name') }}</label>
|
||||
|
||||
|
|
@ -172,13 +171,11 @@
|
|||
|
||||
<input type="text" class="control" id="sort_order" name="sort_order" value="{{ $cartRule->sort_order }}" {{ $cartRule->sort_order ? 'checked' : '' }}/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.promotions.cart-rules.conditions') }}'" :active="false">
|
||||
<div slot="body">
|
||||
|
||||
<div class="control-group">
|
||||
<label for="condition_type">{{ __('admin::app.promotions.cart-rules.condition-type') }}</label>
|
||||
|
||||
|
|
@ -194,18 +191,16 @@
|
|||
:key="index"
|
||||
:index="index"
|
||||
@onRemoveCondition="removeCondition($event)">
|
||||
</cart-rule-condition-item>
|
||||
</cart-rule-condition-item>
|
||||
|
||||
<button type="button" class="btn btn-lg btn-primary" style="margin-top: 20px;" @click="addCondition">
|
||||
{{ __('admin::app.promotions.cart-rules.add-condition') }}
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.promotions.cart-rules.actions') }}'" :active="false">
|
||||
<div slot="body">
|
||||
|
||||
<div class="control-group" :class="[errors.has('action_type') ? 'has-error' : '']">
|
||||
<label for="action_type" class="required">{{ __('admin::app.promotions.cart-rules.action-type') }}</label>
|
||||
|
||||
|
|
@ -307,20 +302,19 @@
|
|||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
{!! view_render_event('bagisto.admin.promotions.cart-rules.create.after') !!}
|
||||
|
||||
<accordian :title="'{{ __('admin::app.promotions.cart-rules.coupon-codes') }}'" :active="false" v-if="coupon_type && use_auto_generation">
|
||||
<div slot="body">
|
||||
<create-coupon-form></create-coupon-form>
|
||||
</div>
|
||||
</accordian>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.promotions.cart-rules.coupon-codes') }}'" :active="false" v-if="coupon_type && use_auto_generation">
|
||||
<div slot="body">
|
||||
<create-coupon-form></create-coupon-form>
|
||||
</div>
|
||||
</accordian>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
|
@ -416,29 +410,28 @@
|
|||
|
||||
<script type="text/x-template" id="create-coupon-form-template">
|
||||
<div class="">
|
||||
<form method="POST" data-vv-scope="create-coupun-form" @submit.prevent="generateCopuns('create-coupun-form')">
|
||||
|
||||
<div class="control-group" :class="[errors.has('create-coupun-form.coupon_qty') ? 'has-error' : '']">
|
||||
<form method="POST" data-vv-scope="create-coupon-form" @submit.prevent="generateCoupons('create-coupon-form')">
|
||||
<div class="control-group" :class="[errors.has('create-coupon-form.coupon_qty') ? 'has-error' : '']">
|
||||
<label for="coupon_qty" class="required">{{ __('admin::app.promotions.cart-rules.coupon-qty') }}</label>
|
||||
|
||||
<input v-validate="'required|min_value:1'" class="control" id="coupon_qty" name="coupon_qty" v-model="coupon_format.coupon_qty" data-vv-as=""{{ __('admin::app.promotions.cart-rules.coupon-qty') }}""/>
|
||||
|
||||
<span class="control-error" v-if="errors.has('create-coupun-form.coupon_qty')">
|
||||
@{{ errors.first('create-coupun-form.coupon_qty') }}
|
||||
<span class="control-error" v-if="errors.has('create-coupon-form.coupon_qty')">
|
||||
@{{ errors.first('create-coupon-form.coupon_qty') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('create-coupun-form.code_length') ? 'has-error' : '']">
|
||||
<div class="control-group" :class="[errors.has('create-coupon-form.code_length') ? 'has-error' : '']">
|
||||
<label for="code_length" class="required">{{ __('admin::app.promotions.cart-rules.code-length') }}</label>
|
||||
|
||||
<input v-validate="'required|min_value:10'" class="control" id="code_length" name="code_length" v-model="coupon_format.code_length" data-vv-as=""{{ __('admin::app.promotions.cart-rules.code-length') }}""/>
|
||||
|
||||
<span class="control-error" v-if="errors.has('create-coupun-form.code_length')">
|
||||
@{{ errors.first('create-coupun-form.code_length') }}
|
||||
<span class="control-error" v-if="errors.has('create-coupon-form.code_length')">
|
||||
@{{ errors.first('create-coupon-form.code_length') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('create-coupun-form.code_format') ? 'has-error' : '']">
|
||||
<div class="control-group" :class="[errors.has('create-coupon-form.code_format') ? 'has-error' : '']">
|
||||
<label for="code_format" class="required">{{ __('admin::app.promotions.cart-rules.code-format') }}</label>
|
||||
|
||||
<select class="control" id="code_format" name="code_format" v-model="coupon_format.code_format" v-validate="'required'" data-vv-as=""{{ __('admin::app.promotions.cart-rules.code-format') }}"">
|
||||
|
|
@ -447,8 +440,8 @@
|
|||
<option value="numeric">{{ __('admin::app.promotions.cart-rules.numeric') }}</option>
|
||||
</select>
|
||||
|
||||
<span class="control-error" v-if="errors.has('create-coupun-form.code_format')">
|
||||
@{{ errors.first('create-coupun-form.code_format') }}
|
||||
<span class="control-error" v-if="errors.has('create-coupon-form.code_format')">
|
||||
@{{ errors.first('create-coupon-form.code_format') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
@ -465,7 +458,6 @@
|
|||
<div class="button-group">
|
||||
<button class="btn btn-xl btn-primary">{{ __('admin::app.promotions.cart-rules.generate') }}</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="content">
|
||||
|
|
@ -483,19 +475,18 @@
|
|||
|
||||
<modal id="downloadDataGrid" :is-open="this.$root.modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
</modal>
|
||||
|
||||
@inject('cartRuleCouponGrid','Webkul\Admin\DataGrids\CartRuleCouponDataGrid')
|
||||
|
||||
{!! $cartRuleCouponGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.cart-rules-coupons.index', $cartRule->id) }}"></datagrid-plus>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $cartRuleCouponGrid])
|
||||
@include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\CartRuleCouponDataGrid')])
|
||||
@endpush
|
||||
|
||||
<script>
|
||||
|
|
@ -762,19 +753,19 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
generateCopuns: function(formScope) {
|
||||
generateCoupons: function(formScope) {
|
||||
let self = this;
|
||||
|
||||
this.$validator.validateAll(formScope).then(function (result) {
|
||||
if (result) {
|
||||
self.$http.post("{{ route('admin.cart-rules.generate-coupons', $cartRule->id) }}", self.coupon_format)
|
||||
self.$http.post("{{ route('admin.cart-rules-coupons.store', $cartRule->id) }}", self.coupon_format)
|
||||
.then(function(response) {
|
||||
window.flashMessages = [{
|
||||
'type': 'alert-success',
|
||||
'message': response.data.message
|
||||
}];
|
||||
|
||||
self.$root.addFlashMessages()
|
||||
self.$root.addFlashMessages();
|
||||
})
|
||||
.catch(function (error) {
|
||||
window.flashMessages = [{
|
||||
|
|
@ -782,8 +773,8 @@
|
|||
'message': error.response.data.message
|
||||
}];
|
||||
|
||||
self.$root.addFlashMessages()
|
||||
})
|
||||
self.$root.addFlashMessages();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -794,4 +785,4 @@
|
|||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<div class="content">
|
||||
@php
|
||||
$customer_group = core()->getRequestedCustomerGroupCode();
|
||||
|
||||
$channel = core()->getRequestedChannelCode(false);
|
||||
@endphp
|
||||
|
||||
|
|
@ -24,8 +25,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('cartRuleGrid','Webkul\Admin\DataGrids\CartRuleDataGrid')
|
||||
{!! $cartRuleGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.cart-rules.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -34,6 +34,7 @@
|
|||
<script>
|
||||
function reloadPage(getVar, getVal) {
|
||||
let url = new URL(window.location.href);
|
||||
|
||||
url.searchParams.set(getVar, getVal);
|
||||
|
||||
window.location.href = url.href;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
|
|
@ -20,8 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('catalogRuleGrid','Webkul\Admin\DataGrids\CatalogRuleDataGrid')
|
||||
{!! $catalogRuleGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.catalog-rules.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
|
|
@ -22,20 +23,19 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('orderInvoicesGrid', 'Webkul\Admin\DataGrids\OrderInvoicesDataGrid')
|
||||
{!! $orderInvoicesGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.sales.invoices.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
</modal>
|
||||
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $orderInvoicesGrid])
|
||||
@endpush
|
||||
@include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\OrderInvoicesDataGrid')])
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -274,8 +274,7 @@
|
|||
|
||||
<tab name="{{ __('admin::app.sales.transactions.title') }}" :selected="false">
|
||||
<div class="sale-container">
|
||||
@inject('InvoicesTransactionsDatagrid', 'Webkul\Admin\DataGrids\InvoicesTransactionsDatagrid')
|
||||
{!! $InvoicesTransactionsDatagrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.sales.invoices.transactions', $invoice->id) }}"></datagrid-plus>
|
||||
</div>
|
||||
</tab>
|
||||
</tabs>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
|
|
@ -22,21 +23,19 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('refundGrid', 'Webkul\Admin\DataGrids\OrderRefundDataGrid')
|
||||
|
||||
{!! $refundGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.sales.refunds.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
</modal>
|
||||
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $refundGrid])
|
||||
@endpush
|
||||
@include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\OrderRefundDataGrid')])
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
|
|
@ -22,20 +23,19 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('orderShipmentsGrid', 'Webkul\Admin\DataGrids\OrderShipmentsDataGrid')
|
||||
{!! $orderShipmentsGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.sales.shipments.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
</modal>
|
||||
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $orderShipmentsGrid])
|
||||
@endpush
|
||||
@include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\OrderShipmentsDataGrid')])
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
|
|
@ -24,13 +25,13 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('orderTransactionsDataGrid', 'Webkul\Admin\DataGrids\OrderTransactionsDataGrid')
|
||||
{!! $orderTransactionsDataGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.sales.transactions.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
|
|
@ -38,5 +39,5 @@
|
|||
@stop
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $orderTransactionsDataGrid])
|
||||
@endpush
|
||||
@include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\OrderTransactionsDataGrid')])
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('channels','Webkul\Admin\DataGrids\ChannelDataGrid')
|
||||
{!! $channels->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.channels.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('currencies','Webkul\Admin\DataGrids\CurrencyDataGrid')
|
||||
{!! $currencies->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.currencies.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\ExchangeRatesDataGrid')->render() !!}
|
||||
|
||||
<datagrid-plus src="{{ route('admin.exchange_rates.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('inventory_sources','Webkul\Admin\DataGrids\InventorySourcesDataGrid')
|
||||
{!! $inventory_sources->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.inventory_sources.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
@inject('locales','Webkul\Admin\DataGrids\LocalesDataGrid')
|
||||
{!! $locales->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.locales.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -5,11 +5,10 @@
|
|||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
|
||||
@php
|
||||
$locale = core()->getRequestedLocaleCode('locale', false);
|
||||
|
||||
$channel = core()->getRequestedChannelCode(false);
|
||||
@endphp
|
||||
|
||||
|
|
@ -26,22 +25,19 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('sliders','Webkul\Admin\DataGrids\SliderDataGrid')
|
||||
{!! $sliders->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.sliders.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
|
||||
function reloadPage(getVar, getVal) {
|
||||
let url = new URL(window.location.href);
|
||||
|
||||
url.searchParams.set(getVar, getVal);
|
||||
|
||||
window.location.href = url.href;
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('taxCategories','Webkul\Admin\DataGrids\TaxCategoryDataGrid')
|
||||
{!! $taxCategories->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.tax-categories.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -5,23 +5,22 @@
|
|||
@stop
|
||||
|
||||
@push('css')
|
||||
<style>
|
||||
@media only screen and (max-width: 450px){
|
||||
.content-container .content .page-header .page-title{
|
||||
width: 100% !important;
|
||||
}
|
||||
<style>
|
||||
@media only screen and (max-width: 450px){
|
||||
.content-container .content .page-header .page-title{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.content-container .content .page-header .page-action {
|
||||
margin-top: 0px !important;
|
||||
float: left;
|
||||
}
|
||||
.content-container .content .page-header .page-action {
|
||||
margin-top: 0px !important;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.export-import {
|
||||
margin-top: 0px !important;
|
||||
.export-import {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
|
@ -34,12 +33,15 @@
|
|||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('uploadDataGrid')" style="margin-right: 20px;">
|
||||
<i class="import-icon"></i>
|
||||
|
||||
<span>
|
||||
{{ __('admin::app.export.import') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
|
|
@ -52,13 +54,13 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('taxRateGrid', 'Webkul\Admin\DataGrids\TaxRateDataGrid')
|
||||
{!! $taxRateGrid->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.tax-rates.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
|
|
@ -66,15 +68,20 @@
|
|||
|
||||
<modal id="uploadDataGrid" :is-open="modalIds.uploadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.upload') }}</h3>
|
||||
<div slot="body">
|
||||
|
||||
<div slot="body">
|
||||
<form method="POST" action="{{ route('admin.tax-rates.import') }}" enctype="multipart/form-data" @submit.prevent="onSubmit">
|
||||
@csrf()
|
||||
|
||||
<div class="control-group" :class="[errors.has('file') ? 'has-error' : '']">
|
||||
<label for="file" class="required">{{ __('admin::app.export.file') }}</label>
|
||||
|
||||
<input v-validate="'required'" type="file" class="control" id="file" name="file" data-vv-as=""{{ __('admin::app.export.file') }}"" value="{{ old('file') }}"/ style="padding-top: 5px">
|
||||
|
||||
<span>{{ __('admin::app.export.allowed-type') }}</span>
|
||||
|
||||
<span><b>{{ __('admin::app.export.file-type') }}</b></span>
|
||||
|
||||
<span class="control-error" v-if="errors.has('file')">@{{ errors.first('file') }}</span>
|
||||
</div>
|
||||
|
||||
|
|
@ -82,12 +89,10 @@
|
|||
{{ __('admin::app.export.import') }}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</modal>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $taxRateGrid])
|
||||
@endpush
|
||||
@include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\TaxRateDataGrid')])
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('roles','Webkul\Admin\DataGrids\RolesDataGrid')
|
||||
{!! $roles->render() !!}
|
||||
<datagrid-plus src="{{ route('admin.roles.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.users.users.title') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<a href="{{ route('admin.users.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.users.users.add-user-title') }}
|
||||
|
|
@ -19,11 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
@inject('datagrid','Webkul\Admin\DataGrids\UserDataGrid')
|
||||
{!! $datagrid->render() !!}
|
||||
{{-- <datetime></datetime> --}}
|
||||
<datagrid-plus src="{{ route('admin.users.index') }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -43,9 +43,14 @@ Route::group(['middleware' => ['web', 'admin', 'admin_locale'], 'prefix' => conf
|
|||
|
||||
Route::post('cart-rules/delete/{id}', [CartRuleController::class, 'destroy'])->name('admin.cart-rules.delete');
|
||||
|
||||
Route::post('cart-rules/generate-coupons/{id?}', [CartRuleController::class, 'generateCoupons'])->name('admin.cart-rules.generate-coupons');
|
||||
/**
|
||||
* Cart rule coupons routes.
|
||||
*/
|
||||
Route::get('cart-rule-coupons/{id}', [CartRuleCouponController::class, 'index'])->name('admin.cart-rules-coupons.index');
|
||||
|
||||
Route::post('/massdelete', [CartRuleCouponController::class, 'massDelete'])->name('admin.cart-rule-coupons.mass-delete');
|
||||
Route::post('cart-rule-coupons/{id}', [CartRuleCouponController::class, 'store'])->name('admin.cart-rules-coupons.store');
|
||||
|
||||
Route::post('cart-rule-coupons/mass-delete', [CartRuleCouponController::class, 'massDelete'])->name('admin.cart-rule-coupons.mass-delete');
|
||||
|
||||
/**
|
||||
* Catalog rules routes.
|
||||
|
|
@ -167,4 +172,4 @@ Route::group(['middleware' => ['web', 'admin', 'admin_locale'], 'prefix' => conf
|
|||
'redirect' => 'admin.customers.subscribers.index',
|
||||
])->name('admin.customers.subscribers.update');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ Route::group(['middleware' => ['web', 'admin', 'admin_locale'], 'prefix' => conf
|
|||
'view' => 'admin::sales.invoices.print',
|
||||
])->name('admin.sales.invoices.print');
|
||||
|
||||
Route::get('/invoices/{id}/transactions', [InvoiceController::class, 'invoiceTransactions'])
|
||||
->name('admin.sales.invoices.transactions');
|
||||
|
||||
/**
|
||||
* Shipments routes.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Attribute\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\AttributeDataGrid;
|
||||
use Webkul\Attribute\Repositories\AttributeRepository;
|
||||
|
||||
class AttributeController extends Controller
|
||||
|
|
@ -40,6 +41,10 @@ class AttributeController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(AttributeDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -135,20 +140,18 @@ class AttributeController extends Controller
|
|||
$attribute = $this->attributeRepository->findOrFail($id);
|
||||
|
||||
if (! $attribute->is_user_defined) {
|
||||
session()->flash('error', trans('admin::app.response.user-define-error', ['name' => 'Attribute']));
|
||||
} else {
|
||||
try {
|
||||
$this->attributeRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Attribute']));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Attribute']));
|
||||
}
|
||||
return response()->json([
|
||||
'message' => trans('admin::app.response.user-define-error', ['name' => 'Attribute']),
|
||||
], 400);
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
try {
|
||||
$this->attributeRepository->delete($id);
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-success', ['name' => 'Attribute'])]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Attribute'])], 500);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,27 +2,28 @@
|
|||
|
||||
namespace Webkul\Attribute\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\AttributeFamilyDataGrid;
|
||||
use Webkul\Attribute\Repositories\AttributeFamilyRepository;
|
||||
use Webkul\Attribute\Repositories\AttributeRepository;
|
||||
|
||||
class AttributeFamilyController extends Controller
|
||||
{
|
||||
/**
|
||||
* Contains route related configuration
|
||||
* Contains route related configuration.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* AttributeFamilyRepository object
|
||||
* Attribute family repository instance.
|
||||
*
|
||||
* @var \Webkul\Attribute\Repositories\AttributeFamilyRepository
|
||||
*/
|
||||
protected $attributeFamilyRepository;
|
||||
|
||||
/**
|
||||
* AttributeRepository object
|
||||
* Attribute repository instance.
|
||||
*
|
||||
* @var \Webkul\Attribute\Repositories\AttributeRepository
|
||||
*/
|
||||
|
|
@ -38,8 +39,7 @@ class AttributeFamilyController extends Controller
|
|||
public function __construct(
|
||||
AttributeFamilyRepository $attributeFamilyRepository,
|
||||
AttributeRepository $attributeRepository
|
||||
)
|
||||
{
|
||||
) {
|
||||
$this->attributeFamilyRepository = $attributeFamilyRepository;
|
||||
|
||||
$this->attributeRepository = $attributeRepository;
|
||||
|
|
@ -54,6 +54,10 @@ class AttributeFamilyController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(AttributeFamilyDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -136,28 +140,34 @@ class AttributeFamilyController extends Controller
|
|||
$attributeFamily = $this->attributeFamilyRepository->findOrFail($id);
|
||||
|
||||
if ($this->attributeFamilyRepository->count() == 1) {
|
||||
session()->flash('error', trans('admin::app.response.last-delete-error', ['name' => 'Family']));
|
||||
|
||||
} elseif ($attributeFamily->products()->count()) {
|
||||
session()->flash('error', trans('admin::app.response.attribute-product-error', ['name' => 'Attribute family']));
|
||||
} else {
|
||||
try {
|
||||
$this->attributeFamilyRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Family']));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Family']));
|
||||
}
|
||||
return response()->json([
|
||||
'message' => trans('admin::app.response.last-delete-error', ['name' => 'Family']),
|
||||
], 400);
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
if ($attributeFamily->products()->count()) {
|
||||
return response()->json([
|
||||
'message' => trans('admin::app.response.attribute-product-error', ['name' => 'Attribute family']),
|
||||
], 400);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->attributeFamilyRepository->delete($id);
|
||||
|
||||
return response()->json([
|
||||
'message' => trans('admin::app.response.delete-success', ['name' => 'Family']),
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'message' => trans('admin::app.response.delete-failed', ['name' => 'Family']),
|
||||
], 500);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resources from database
|
||||
* Remove the specified resources from database.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
|
|
@ -192,4 +202,4 @@ class AttributeFamilyController extends Controller
|
|||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,129 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'catalog' => [
|
||||
'products' => [
|
||||
'booking' => '预订信息',
|
||||
'booking-type' => '预订类型',
|
||||
'default' => '默认',
|
||||
'appointment-booking' => '预约',
|
||||
'event-booking' => '活动预订',
|
||||
'rental-booking' => '租赁预订',
|
||||
'table-booking' => '订座电话',
|
||||
'slot-duration' => '插入持续时间 (分钟)',
|
||||
'break-time' => '休息时间黑白插槽 (分钟)',
|
||||
'available-every-week' => '每周可用',
|
||||
'yes' => 'Yes',
|
||||
'no' => 'No',
|
||||
'available-from' => '可用从',
|
||||
'available-to' => '可用到',
|
||||
'same-slot-all-days' => '同一时段全天',
|
||||
'slot-has-quantity' => '插槽有数量',
|
||||
'slots' => '插槽',
|
||||
'from' => '从',
|
||||
'to' => '到',
|
||||
'qty' => '数量',
|
||||
'add-slot' => '添加插槽',
|
||||
'sunday' => '星期天',
|
||||
'monday' => '星期一',
|
||||
'tuesday' => '星期二',
|
||||
'wednesday' => '星期三',
|
||||
'thursday' => '星期四',
|
||||
'friday' => '星期五',
|
||||
'saturday' => '星期六',
|
||||
'renting-type' => '租赁类型',
|
||||
'daily' => '每日基础',
|
||||
'hourly' => '每小时基础',
|
||||
'daily-hourly' => '两者(每日和每小时)',
|
||||
'daily-price' => '每日价格',
|
||||
'hourly-price' => '每小时价格',
|
||||
'location' => '位置',
|
||||
'show-location' => '显示位置',
|
||||
'event-start-date' => '事件开始日期',
|
||||
'event-end-date' => '事件结束日期',
|
||||
'tickets' => '门票',
|
||||
'add-ticket' => '添加票证',
|
||||
'name' => '名称',
|
||||
'price' => '价格',
|
||||
'quantity' => '数量',
|
||||
'description' => '描述',
|
||||
'special-price' => '特殊价格',
|
||||
'special-price-from' => '有效期从',
|
||||
'special-price-to' => '有效期至',
|
||||
'charged-per' => '每次收费',
|
||||
'guest' => '访客',
|
||||
'table' => '桌',
|
||||
'prevent-scheduling-before' => '阻止之前的调度',
|
||||
'guest-limit' => '每桌客人限制',
|
||||
'guest-capacity' => '客人容量',
|
||||
'type' => '类型',
|
||||
'many-bookings-for-one-day' => '一日多预订',
|
||||
'one-booking-for-many-days' => '一票多日',
|
||||
'day' => '日',
|
||||
'status' => '状态',
|
||||
'open' => '开门',
|
||||
'close' => '关门',
|
||||
'time-error' => '这个时间必须大于开始时间.'
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
'shop' => [
|
||||
'products' => [
|
||||
'location' => '位置',
|
||||
'contact' => '联系',
|
||||
'email' => '电子邮件',
|
||||
'slot-duration' => '插槽周期',
|
||||
'slot-duration-in-minutes' => ':minutes 分钟',
|
||||
'today-availability' => '今天的可用性',
|
||||
'slots-for-all-days' => '全天显示',
|
||||
'sunday' => '星期天',
|
||||
'monday' => '星期一',
|
||||
'tuesday' => '星期二',
|
||||
'wednesday' => '星期三',
|
||||
'thursday' => '星期四',
|
||||
'friday' => '星期五',
|
||||
'saturday' => '星期六',
|
||||
'closed' => '已关门',
|
||||
'book-an-appointment' => '预约',
|
||||
'date' => '日期',
|
||||
'slot' => '插槽',
|
||||
'rent-an-item' => '租一个项目',
|
||||
'choose-rent-option' => '选择租金选项',
|
||||
'daily-basis' => '每日基础',
|
||||
'hourly-basis' => '每小时基础',
|
||||
'select-time-slot'=> '选择时间段',
|
||||
'select-slot' => '选择插槽',
|
||||
'select-date' => '选择日期',
|
||||
'select-rent-time' => '选择租用时间',
|
||||
'from' => '从',
|
||||
'to' => '到',
|
||||
'book-a-table' => '预订座位',
|
||||
'special-notes' => '特殊要求/注意事项',
|
||||
'event-on' => '活动开启',
|
||||
'book-your-ticket' => '订票',
|
||||
'per-ticket-price' => '每张票 :price',
|
||||
'number-of-tickets' => '票数',
|
||||
'total-tickets' => '总票数',
|
||||
'base-price' => '基本价格',
|
||||
'total-price' => '总价',
|
||||
'base-price-info' => '(这将适用于每种数量的每种类型的票)'
|
||||
],
|
||||
|
||||
'cart' => [
|
||||
'renting_type' => '租金类型',
|
||||
'daily' => '每日',
|
||||
'hourly' => '每小时',
|
||||
'event-ticket' => '活动门票',
|
||||
'event-from' => '事件从',
|
||||
'event-till' => '活动截止日期',
|
||||
'rent-type' => '租金类型',
|
||||
'rent-from' => '租自',
|
||||
'rent-till' => '租到',
|
||||
'booking-from' => '预订从',
|
||||
'booking-till' => '预订截止',
|
||||
'special-note' => '特殊要求/注意事项',
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -2,20 +2,21 @@
|
|||
|
||||
namespace Webkul\CMS\Http\Controllers\Admin;
|
||||
|
||||
use Webkul\Admin\DataGrids\CMSPageDataGrid;
|
||||
use Webkul\CMS\Http\Controllers\Controller;
|
||||
use Webkul\CMS\Repositories\CmsRepository;
|
||||
|
||||
class PageController extends Controller
|
||||
class PageController extends Controller
|
||||
{
|
||||
/**
|
||||
* To hold the request variables from route file
|
||||
* To hold the request variables from route file.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* To hold the CMSRepository instance
|
||||
* To hold the CMS repository instance.
|
||||
*
|
||||
* @var \Webkul\CMS\Repositories\CmsRepository
|
||||
*/
|
||||
|
|
@ -37,17 +38,21 @@ use Webkul\CMS\Repositories\CmsRepository;
|
|||
}
|
||||
|
||||
/**
|
||||
* Loads the index page showing the static pages resources
|
||||
* Loads the index page showing the static pages resources.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(CMSPageDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* To create a new CMS page
|
||||
* To create a new CMS page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
|
|
@ -57,7 +62,7 @@ use Webkul\CMS\Repositories\CmsRepository;
|
|||
}
|
||||
|
||||
/**
|
||||
* To store a new CMS page in storage
|
||||
* To store a new CMS page in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
|
|
@ -80,7 +85,7 @@ use Webkul\CMS\Repositories\CmsRepository;
|
|||
}
|
||||
|
||||
/**
|
||||
* To edit a previously created CMS page
|
||||
* To edit a previously created CMS page.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
|
|
@ -93,7 +98,7 @@ use Webkul\CMS\Repositories\CmsRepository;
|
|||
}
|
||||
|
||||
/**
|
||||
* To update the previously created CMS page in storage
|
||||
* To update the previously created CMS page in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
|
|
@ -121,7 +126,7 @@ use Webkul\CMS\Repositories\CmsRepository;
|
|||
}
|
||||
|
||||
/**
|
||||
* To delete the previously create CMS page
|
||||
* To delete the previously create CMS page.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
|
|
@ -131,18 +136,14 @@ use Webkul\CMS\Repositories\CmsRepository;
|
|||
$page = $this->cmsRepository->findOrFail($id);
|
||||
|
||||
if ($page->delete()) {
|
||||
session()->flash('success', trans('admin::app.cms.pages.delete-success'));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} else {
|
||||
session()->flash('success', trans('admin::app.cms.pages.delete-failure'));
|
||||
|
||||
return response()->json(['message' => false], 200);
|
||||
return response()->json(['message' => trans('admin::app.cms.pages.delete-success')]);
|
||||
}
|
||||
|
||||
return response()->json(['message' => trans('admin::app.cms.pages.delete-failure')], 500);
|
||||
}
|
||||
|
||||
/**
|
||||
* To mass delete the CMS resource from storage
|
||||
* To mass delete the CMS resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
|
|
@ -180,4 +181,4 @@ use Webkul\CMS\Repositories\CmsRepository;
|
|||
|
||||
return redirect()->route('admin.cms.index');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use Exception;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\View\View;
|
||||
use Webkul\CartRule\Repositories\CartRuleCouponRepository;
|
||||
use Webkul\Admin\DataGrids\CartRuleDataGrid;
|
||||
use Webkul\CartRule\Repositories\CartRuleRepository;
|
||||
|
||||
class CartRuleController extends Controller
|
||||
|
|
@ -25,30 +25,18 @@ class CartRuleController extends Controller
|
|||
*/
|
||||
protected $cartRuleRepository;
|
||||
|
||||
/**
|
||||
* To hold cart rule coupon repository repository instance.
|
||||
*
|
||||
* @var \Webkul\CartRule\Repositories\CartRuleCouponRepository
|
||||
*/
|
||||
protected $cartRuleCouponRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\CartRule\Repositories\CartRuleRepository $cartRuleRepository
|
||||
* @param \Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
CartRuleRepository $cartRuleRepository,
|
||||
CartRuleCouponRepository $cartRuleCouponRepository
|
||||
CartRuleRepository $cartRuleRepository
|
||||
) {
|
||||
$this->_config = request('_config');
|
||||
|
||||
$this->cartRuleRepository = $cartRuleRepository;
|
||||
|
||||
$this->cartRuleCouponRepository = $cartRuleCouponRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -58,6 +46,10 @@ class CartRuleController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(CartRuleDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -220,35 +212,9 @@ class CartRuleController extends Controller
|
|||
try {
|
||||
$this->cartRuleRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Cart Rule']));
|
||||
return response()->json(['message' => trans('admin::app.response.delete-success', ['name' => 'Cart Rule'])]);
|
||||
} catch (Exception $e) {}
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Cart Rule']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate coupon code for cart rule.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function generateCoupons()
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'coupon_qty' => 'required|integer|min:1',
|
||||
'code_length' => 'required|integer|min:10',
|
||||
'code_format' => 'required',
|
||||
]);
|
||||
|
||||
if (! request('id')) {
|
||||
return response()->json(['message' => trans('admin::app.promotions.cart-rules.cart-rule-not-defind-error')], 400);
|
||||
}
|
||||
|
||||
$this->cartRuleCouponRepository->generateCoupons(request()->all(), request('id'));
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.create-success', ['name' => 'Cart rule coupons'])]);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Cart Rule'])], 400);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
namespace Webkul\CartRule\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Webkul\Admin\DataGrids\CartRuleCouponDataGrid;
|
||||
use Webkul\CartRule\Repositories\CartRuleCouponRepository;
|
||||
|
||||
class CartRuleCouponController extends Controller
|
||||
{
|
||||
/**
|
||||
* To hold CartRuleCouponRepository repository instance
|
||||
*
|
||||
* To hold cart rule coupon repository instance.
|
||||
*
|
||||
* @var \Webkul\CartRule\Repositories\CartRuleCouponRepository
|
||||
*/
|
||||
protected $cartRuleCouponRepository;
|
||||
|
|
@ -26,7 +26,40 @@ class CartRuleCouponController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Mass Delete the coupons
|
||||
* Index.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index($id)
|
||||
{
|
||||
return app(CartRuleCouponDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate coupon code for cart rule.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function store($id)
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'coupon_qty' => 'required|integer|min:1',
|
||||
'code_length' => 'required|integer|min:10',
|
||||
'code_format' => 'required',
|
||||
]);
|
||||
|
||||
if (! request('id')) {
|
||||
return response()->json(['message' => trans('admin::app.promotions.cart-rules.cart-rule-not-defind-error')], 400);
|
||||
}
|
||||
|
||||
$this->cartRuleCouponRepository->generateCoupons(request()->all(), request('id'));
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.create-success', ['name' => 'Cart rule coupons'])]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mass delete the coupons.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
|
|
@ -47,4 +80,4 @@ class CartRuleCouponController extends Controller
|
|||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace Webkul\CatalogRule\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Webkul\Admin\DataGrids\CatalogRuleDataGrid;
|
||||
use Webkul\CatalogRule\Helpers\CatalogRuleIndex;
|
||||
use Webkul\CatalogRule\Repositories\CatalogRuleRepository;
|
||||
|
||||
|
|
@ -54,6 +55,10 @@ class CatalogRuleController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(CatalogRuleDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -151,13 +156,9 @@ class CatalogRuleController extends Controller
|
|||
try {
|
||||
$this->catalogRuleRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Catalog Rule']));
|
||||
return response()->json(['message' => trans('admin::app.response.delete-success', ['name' => 'Catalog Rule'])]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Catalog Rule']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Catalog Rule'])], 400);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Category\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\CategoryDataGrid;
|
||||
use Webkul\Attribute\Repositories\AttributeRepository;
|
||||
use Webkul\Category\Http\Requests\CategoryRequest;
|
||||
use Webkul\Category\Repositories\CategoryRepository;
|
||||
|
|
@ -55,6 +56,10 @@ class CategoryController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(CategoryDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -131,20 +136,16 @@ class CategoryController extends Controller
|
|||
$category = $this->categoryRepository->findOrFail($id);
|
||||
|
||||
if ($this->isCategoryDeletable($category)) {
|
||||
session()->flash('warning', trans('admin::app.response.delete-category-root', ['name' => 'Category']));
|
||||
} else {
|
||||
try {
|
||||
$this->categoryRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Category']));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Category']));
|
||||
}
|
||||
return response()->json(['message' => trans('admin::app.response.delete-category-root', ['name' => 'Category'])], 400);
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
try {
|
||||
$this->categoryRepository->delete($id);
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-success', ['name' => 'Category'])]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Category'])], 500);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -199,7 +200,7 @@ class CategoryController extends Controller
|
|||
$product_count += $category->products->count();
|
||||
}
|
||||
|
||||
return response()->json(['product_count' => $product_count], 200);
|
||||
return response()->json(['product_count' => $product_count]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,29 +3,34 @@
|
|||
namespace Webkul\Category\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Webkul\Core\Eloquent\TranslatableModel;
|
||||
use Kalnoy\Nestedset\NodeTrait;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Webkul\Category\Database\Factories\CategoryFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Kalnoy\Nestedset\NodeTrait;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Webkul\Category\Contracts\Category as CategoryContract;
|
||||
use Webkul\Attribute\Models\AttributeProxy;
|
||||
use Webkul\Category\Contracts\Category as CategoryContract;
|
||||
use Webkul\Category\Database\Factories\CategoryFactory;
|
||||
use Webkul\Category\Repositories\CategoryRepository;
|
||||
use Webkul\Core\Eloquent\TranslatableModel;
|
||||
use Webkul\Product\Models\ProductProxy;
|
||||
|
||||
/**
|
||||
* Class Category
|
||||
* Category class.
|
||||
*
|
||||
* @package Webkul\Category\Models
|
||||
*
|
||||
* @property-read string $url_path maintained by database triggers
|
||||
* @property-read string (`$url_path` maintained by database triggers.)
|
||||
*/
|
||||
class Category extends TranslatableModel implements CategoryContract
|
||||
{
|
||||
use NodeTrait, HasFactory;
|
||||
|
||||
/**
|
||||
* Translated attributes.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $translatedAttributes = [
|
||||
'name',
|
||||
'description',
|
||||
|
|
@ -36,6 +41,11 @@ class Category extends TranslatableModel implements CategoryContract
|
|||
'meta_keywords',
|
||||
];
|
||||
|
||||
/**
|
||||
* Fillables.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'position',
|
||||
'status',
|
||||
|
|
@ -44,106 +54,64 @@ class Category extends TranslatableModel implements CategoryContract
|
|||
'additional',
|
||||
];
|
||||
|
||||
/**
|
||||
* Eager loading.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $with = ['translations'];
|
||||
|
||||
/**
|
||||
* Get image url for the category image.
|
||||
* Appends.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public function image_url()
|
||||
{
|
||||
if (! $this->image) {
|
||||
return;
|
||||
}
|
||||
|
||||
return Storage::url($this->image);
|
||||
}
|
||||
protected $appends = ['image_url', 'category_icon_url'];
|
||||
|
||||
/**
|
||||
* Get image url for the category image.
|
||||
* The products that belong to the category.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function getImageUrlAttribute()
|
||||
public function products(): BelongsToMany
|
||||
{
|
||||
return $this->image_url();
|
||||
return $this->belongsToMany(ProductProxy::modelClass(), 'product_categories');
|
||||
}
|
||||
|
||||
/**
|
||||
* The filterable attributes that belong to the category.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function filterableAttributes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(AttributeProxy::modelClass(), 'category_filterable_attributes')
|
||||
->with([
|
||||
'options' => function ($query) {
|
||||
$query->orderBy('sort_order');
|
||||
},
|
||||
]);
|
||||
->with([
|
||||
'options' => function ($query) {
|
||||
$query->orderBy('sort_order');
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getting the root category of a category
|
||||
* Finds and returns the category within a nested category tree.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object
|
||||
*/
|
||||
public function getRootCategory()
|
||||
{
|
||||
return self::query()
|
||||
->where([
|
||||
[
|
||||
'parent_id',
|
||||
'=',
|
||||
null,
|
||||
],
|
||||
[
|
||||
'_lft',
|
||||
'<=',
|
||||
$this->_lft,
|
||||
],
|
||||
[
|
||||
'_rgt',
|
||||
'>=',
|
||||
$this->_rgt,
|
||||
],
|
||||
])
|
||||
->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all categories within the category's path
|
||||
* Will search in root category by default.
|
||||
*
|
||||
* @return Category[]
|
||||
*/
|
||||
public function getPathCategories(): array
|
||||
{
|
||||
$category = $this->findInTree();
|
||||
|
||||
$categories = [$category];
|
||||
|
||||
while (isset($category->parent)) {
|
||||
$category = $category->parent;
|
||||
$categories[] = $category;
|
||||
}
|
||||
|
||||
return array_reverse($categories);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and returns the category within a nested category tree
|
||||
* will search in root category by default
|
||||
* is used to minimize the numbers of sql queries for it only uses the already cached tree
|
||||
* Is used to minimize the numbers of sql queries for it only uses the already cached tree.
|
||||
*
|
||||
* @param Category[] $categoryTree
|
||||
*
|
||||
* @return Category
|
||||
* @param \Webkul\Velocity\Contracts\Category[] $categoryTree
|
||||
* @return \Webkul\Velocity\Contracts\Category
|
||||
*/
|
||||
public function findInTree($categoryTree = null): Category
|
||||
{
|
||||
if (!$categoryTree) {
|
||||
if (! $categoryTree) {
|
||||
$categoryTree = app(CategoryRepository::class)->getVisibleCategoryTree($this->getRootCategory()->id);
|
||||
}
|
||||
|
||||
$category = $categoryTree->first();
|
||||
|
||||
if (!$category) {
|
||||
if (! $category) {
|
||||
throw new NotFoundHttpException('category not found in tree');
|
||||
}
|
||||
|
||||
|
|
@ -155,20 +123,87 @@ class Category extends TranslatableModel implements CategoryContract
|
|||
}
|
||||
|
||||
/**
|
||||
* The products that belong to the category.
|
||||
* Getting the root category of a category.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object
|
||||
*/
|
||||
public function products(): BelongsToMany
|
||||
public function getRootCategory()
|
||||
{
|
||||
return $this->belongsToMany(ProductProxy::modelClass(), 'product_categories');
|
||||
return self::query()
|
||||
->where([
|
||||
[
|
||||
'parent_id',
|
||||
'=',
|
||||
null,
|
||||
],
|
||||
[
|
||||
'_lft',
|
||||
'<=',
|
||||
$this->_lft,
|
||||
],
|
||||
[
|
||||
'_rgt',
|
||||
'>=',
|
||||
$this->_rgt,
|
||||
],
|
||||
])
|
||||
->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all categories within the category's path.
|
||||
*
|
||||
* @return \Webkul\Velocity\Contracts\Category[]
|
||||
*/
|
||||
public function getPathCategories(): array
|
||||
{
|
||||
$category = $this->findInTree();
|
||||
|
||||
$categories = [$category];
|
||||
|
||||
while (isset($category->parent)) {
|
||||
$category = $category->parent;
|
||||
$categories[] = $category;
|
||||
}
|
||||
|
||||
return array_reverse($categories);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get image url for the category image.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getImageUrlAttribute()
|
||||
{
|
||||
if (! $this->image) {
|
||||
return;
|
||||
}
|
||||
|
||||
return Storage::url($this->image);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get category icon url for the category icon image.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCategoryIconUrlAttribute()
|
||||
{
|
||||
if (! $this->category_icon_path) {
|
||||
return;
|
||||
}
|
||||
|
||||
return Storage::url($this->category_icon_path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new factory instance for the model.
|
||||
*
|
||||
* @return Factory
|
||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
protected static function newFactory(): Factory
|
||||
{
|
||||
return CategoryFactory::new();
|
||||
return CategoryFactory::new ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace Webkul\Checkout;
|
|||
use Exception;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Checkout\Models\Cart as CartModel;
|
||||
use Webkul\Checkout\Models\CartAddress;
|
||||
use Webkul\Checkout\Models\Cart as CartModel;
|
||||
use Webkul\Checkout\Models\CartPayment;
|
||||
use Webkul\Checkout\Repositories\CartAddressRepository;
|
||||
use Webkul\Checkout\Repositories\CartItemRepository;
|
||||
|
|
@ -205,13 +205,9 @@ class Cart
|
|||
} else {
|
||||
if (isset($cartProduct['parent_id']) && $cartItem->parent_id !== $parentCartItem->id) {
|
||||
$cartItem = $this->cartItemRepository->create(array_merge($cartProduct, [
|
||||
'cart_id' => $cart->id
|
||||
'cart_id' => $cart->id,
|
||||
]));
|
||||
} else {
|
||||
// if ($cartItem->product->getTypeInstance()->isMultipleQtyAllowed() === false) {
|
||||
// return ['warning' => __('shop::app.checkout.cart.integrity.qty_impossible')];
|
||||
// }
|
||||
|
||||
$cartItem = $this->cartItemRepository->update($cartProduct, $cartItem->id);
|
||||
}
|
||||
}
|
||||
|
|
@ -498,8 +494,8 @@ class Cart
|
|||
$cart->discount_amount += $item->discount_amount;
|
||||
$cart->base_discount_amount += $item->base_discount_amount;
|
||||
|
||||
$cart->sub_total = (float)$cart->sub_total + $item->total;
|
||||
$cart->base_sub_total = (float)$cart->base_sub_total + $item->base_total;
|
||||
$cart->sub_total = (float) $cart->sub_total + $item->total;
|
||||
$cart->base_sub_total = (float) $cart->base_sub_total + $item->base_total;
|
||||
}
|
||||
|
||||
$cart->tax_total = Tax::getTaxTotal($cart, false);
|
||||
|
|
@ -573,22 +569,11 @@ class Cart
|
|||
$item = $this->setItemTaxToZero($item);
|
||||
|
||||
Tax::isTaxApplicableInCurrentAddress($taxCategory, $address, function ($rate) use ($cart, $item) {
|
||||
/* assigning tax percent */
|
||||
$item->tax_percent = $rate->tax_rate;
|
||||
|
||||
/* getting shipping rate for tax calculation */
|
||||
$shippingPrice = $shippingBasePrice = 0;
|
||||
$item->tax_amount = round(($item->total * $rate->tax_rate) / 100, 4);
|
||||
|
||||
if ($shipping = $cart->selected_shipping_rate) {
|
||||
if ($shipping->is_calculate_tax) {
|
||||
$shippingPrice = $shipping->price - $shipping->discount_amount;
|
||||
$shippingBasePrice = $shipping->base_price - $shipping->base_discount_amount;
|
||||
}
|
||||
}
|
||||
|
||||
/* now assigning shipping prices for tax calculation */
|
||||
$item->tax_amount = round((($item->total + $shippingPrice) * $rate->tax_rate) / 100, 4);
|
||||
$item->base_tax_amount = round((($item->base_total + $shippingBasePrice) * $rate->tax_rate) / 100, 4);
|
||||
$item->base_tax_amount = round(($item->base_total * $rate->tax_rate) / 100, 4);
|
||||
});
|
||||
|
||||
$item->save();
|
||||
|
|
@ -736,7 +721,14 @@ class Cart
|
|||
|
||||
if (isset($data['children']) && $data['children']) {
|
||||
foreach ($data['children'] as $child) {
|
||||
$child['quantity'] = $child['quantity'] ? $child['quantity'] * $data['quantity'] : $child['quantity'];
|
||||
/**
|
||||
* - For bundle, child quantity will not be zero.
|
||||
*
|
||||
* - For configurable, parent one will be added as child one is zero.
|
||||
*
|
||||
* - In testing phase.
|
||||
*/
|
||||
$child['quantity'] = $child['quantity'] ? $child['quantity'] * $data['quantity'] : $data['quantity'];
|
||||
|
||||
$finalData['children'][] = $this->prepareDataForOrderItem($child);
|
||||
}
|
||||
|
|
@ -913,7 +905,7 @@ class Cart
|
|||
array $billingAddress,
|
||||
array $shippingAddress
|
||||
): void {
|
||||
$shippingAddress['cart_id'] = $billingAddress['cart_id'] = NULL;
|
||||
$shippingAddress['cart_id'] = $billingAddress['cart_id'] = null;
|
||||
|
||||
if (isset($data['billing']['save_as_address']) && $data['billing']['save_as_address']) {
|
||||
$this->customerAddressRepository->create($billingAddress);
|
||||
|
|
|
|||
|
|
@ -662,7 +662,7 @@ class Core
|
|||
$amount = 0;
|
||||
}
|
||||
|
||||
return $this->formatPrice($this->convertPrice($amount), $this->getCurrentCurrency()->code);
|
||||
return $this->formatPrice($this->convertPrice($amount));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -678,23 +678,6 @@ class Core
|
|||
return $formatter->getSymbol(\NumberFormatter::CURRENCY_SYMBOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format and convert price with currency symbol.
|
||||
*
|
||||
* @param float $price
|
||||
* @return string
|
||||
*/
|
||||
public function formatPrice($price, $currencyCode)
|
||||
{
|
||||
if (is_null($price)) {
|
||||
$price = 0;
|
||||
}
|
||||
|
||||
$formatter = new \NumberFormatter('ru_RU', \NumberFormatter::CURRENCY);
|
||||
|
||||
return $formatter->formatCurrency($price, $currencyCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format and convert price with currency symbol.
|
||||
*
|
||||
|
|
@ -717,6 +700,38 @@ class Core
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Format and convert price with currency symbol.
|
||||
*
|
||||
* @param float $price
|
||||
* @param string (optional) $currencyCode
|
||||
* @return string
|
||||
*/
|
||||
public function formatPrice($price, $currencyCode = null)
|
||||
{
|
||||
if (is_null($price)) {
|
||||
$price = 0;
|
||||
}
|
||||
|
||||
$currency = $currencyCode
|
||||
? $this->getAllCurrencies()->where('code', $currencyCode)->first()
|
||||
: $this->getCurrentCurrency();
|
||||
|
||||
$formatter = new \NumberFormatter('ru_RU', \NumberFormatter::CURRENCY);
|
||||
|
||||
if ($symbol = $currency->symbol) {
|
||||
if ($this->currencySymbol($currency) == $symbol) {
|
||||
return $formatter->formatCurrency($price, $currency->code);
|
||||
}
|
||||
|
||||
$formatter->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, $symbol);
|
||||
|
||||
return $formatter->format($this->convertPrice($price));
|
||||
}
|
||||
|
||||
return $formatter->formatCurrency($price, $currency->code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format price with base currency symbol. This method also give ability to encode
|
||||
* the base currency symbol and its optional.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Core\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\ChannelDataGrid;
|
||||
use Webkul\Core\Repositories\ChannelRepository;
|
||||
|
||||
class ChannelController extends Controller
|
||||
|
|
@ -40,6 +41,10 @@ class ChannelController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(ChannelDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -182,20 +187,16 @@ class ChannelController extends Controller
|
|||
$channel = $this->channelRepository->findOrFail($id);
|
||||
|
||||
if ($channel->code == config('app.channel')) {
|
||||
session()->flash('error', trans('admin::app.settings.channels.last-delete-error'));
|
||||
} else {
|
||||
try {
|
||||
$this->channelRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.settings.channels.delete-success'));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Channel']));
|
||||
}
|
||||
return response()->json(['message' => trans('admin::app.settings.channels.last-delete-error')], 400);
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
try {
|
||||
$this->channelRepository->delete($id);
|
||||
|
||||
return response()->json(['message' => trans('admin::app.settings.channels.delete-success')]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Channel'])], 400);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Core\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\CurrencyDataGrid;
|
||||
use Webkul\Core\Repositories\CurrencyRepository;
|
||||
|
||||
class CurrencyController extends Controller
|
||||
|
|
@ -40,6 +41,10 @@ class CurrencyController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(CurrencyDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -116,21 +121,18 @@ class CurrencyController extends Controller
|
|||
$this->currencyRepository->findOrFail($id);
|
||||
|
||||
if ($this->currencyRepository->count() == 1) {
|
||||
session()->flash('warning', trans('admin::app.settings.currencies.last-delete-error'));
|
||||
} else {
|
||||
try {
|
||||
$this->currencyRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.settings.currencies.delete-success'));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Currency']));
|
||||
}
|
||||
return response()->json(['message' => trans('admin::app.settings.currencies.last-delete-error')], 400);
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
try {
|
||||
$this->currencyRepository->delete($id);
|
||||
|
||||
return response()->json(['message' => trans('admin::app.settings.currencies.delete-success')]);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Currency'])], 500);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Core\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\ExchangeRatesDataGrid;
|
||||
use Webkul\Core\Repositories\CurrencyRepository;
|
||||
use Webkul\Core\Repositories\ExchangeRateRepository;
|
||||
|
||||
|
|
@ -53,6 +54,10 @@ class ExchangeRateController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(ExchangeRatesDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -153,15 +158,11 @@ class ExchangeRateController extends Controller
|
|||
try {
|
||||
$this->exchangeRateRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.settings.exchange_rates.delete-success'));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
return response()->json(['message' => trans('admin::app.settings.exchange_rates.delete-success')]);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
||||
session()->flash('error', trans('admin::app.response.delete-error', ['name' => 'Exchange rate']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-error', ['name' => 'Exchange rate'])], 500);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Core\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\LocalesDataGrid;
|
||||
use Webkul\Core\Repositories\LocaleRepository;
|
||||
|
||||
class LocaleController extends Controller
|
||||
|
|
@ -40,6 +41,10 @@ class LocaleController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(LocalesDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -118,19 +123,15 @@ class LocaleController extends Controller
|
|||
$this->localeRepository->findOrFail($id);
|
||||
|
||||
if ($this->localeRepository->count() == 1) {
|
||||
session()->flash('warning', trans('admin::app.settings.locales.last-delete-error'));
|
||||
} else {
|
||||
try {
|
||||
$this->localeRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.settings.locales.delete-success'));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Locale']));
|
||||
}
|
||||
return response()->json(['message' => trans('admin::app.settings.locales.last-delete-error')], 400);
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
try {
|
||||
$this->localeRepository->delete($id);
|
||||
|
||||
return response()->json(['message' => trans('admin::app.settings.locales.delete-success')]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Locale'])], 500);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Core\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\SliderDataGrid;
|
||||
use Webkul\Core\Repositories\SliderRepository;
|
||||
|
||||
class SliderController extends Controller
|
||||
|
|
@ -47,6 +48,10 @@ class SliderController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(SliderDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +64,7 @@ class SliderController extends Controller
|
|||
{
|
||||
$locale = core()->getRequestedLocaleCode();
|
||||
|
||||
return view($this->_config['view'])->with("locale", $locale);
|
||||
return view($this->_config['view'])->with('locale', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -123,7 +128,7 @@ class SliderController extends Controller
|
|||
]);
|
||||
|
||||
$data = request()->all();
|
||||
|
||||
|
||||
$data['expired_at'] = $data['expired_at'] ?: null;
|
||||
|
||||
if (isset($data['locale'])) {
|
||||
|
|
@ -148,7 +153,7 @@ class SliderController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Delete the slider item and preserve the last one from deleting.
|
||||
* Delete the slider item.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
|
|
@ -160,13 +165,11 @@ class SliderController extends Controller
|
|||
try {
|
||||
$this->sliderRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Slider']));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-success', ['name' => 'Slider'])]);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Slider']));
|
||||
report($e);
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Slider'])], 500);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,21 +2,20 @@
|
|||
|
||||
namespace Webkul\Core\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Webkul\Admin\DataGrids\NewsLetterDataGrid;
|
||||
use Webkul\Core\Repositories\SubscribersListRepository;
|
||||
|
||||
class SubscriptionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Contains route related configuration
|
||||
* Contains route related configuration.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* SubscribersListRepository
|
||||
* Subscribers list repository.
|
||||
*
|
||||
* @var \Webkul\Core\Repositories\SubscribersListRepository
|
||||
*/
|
||||
|
|
@ -42,11 +41,15 @@ class SubscriptionController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(NewsLetterDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* To unsubscribe the user without deleting the resource of the subscribed user
|
||||
* To unsubscribe the user without deleting the resource of the subscribed user.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
|
|
@ -59,7 +62,7 @@ class SubscriptionController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* To unsubscribe the user without deleting the resource of the subscribed user
|
||||
* To unsubscribe the user without deleting the resource of the subscribed user.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
|
|
@ -101,15 +104,11 @@ class SubscriptionController extends Controller
|
|||
try {
|
||||
$this->subscribersListRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Subscriber']));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-success', ['name' => 'Subscriber'])]);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Subscriber']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Subscriber'])], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,8 +100,10 @@ class LocaleRepository extends Repository
|
|||
Storage::delete($locale->locale_image);
|
||||
}
|
||||
|
||||
$locale->locale_image = request()->file($file)->store($dir);
|
||||
$locale->save();
|
||||
if (request()->hasFile($file)) {
|
||||
$locale->locale_image = request()->file($file)->store($dir);
|
||||
$locale->save();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($locale->locale_image) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'path-hint' => [
|
||||
'template' => '模板',
|
||||
'parents' => '父母',
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'address' => '这个 :attribute 只能接受字母、数字、空格、逗号和破折号.',
|
||||
'alpha-numeric-space' => '这个 :attribute 只能接受字母、数字和空格.',
|
||||
'code' => '这个 :attribute 必须有效.',
|
||||
'decimal' => '这个 :attribute 必须有效.',
|
||||
'phone-number' => '这个 :attribute 必须是有效的电话号码.',
|
||||
'slug' => '这个 :attribute 必须有效Slug.',
|
||||
'comma-seperated-integer' => '这个 :attribute 字段必须是数字并且可以包含逗号',
|
||||
];
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'wishlist' => [
|
||||
'success' => '项目成功添加到愿望清单',
|
||||
'failure' => '项目无法添加到愿望清单',
|
||||
'already' => '物品已经出现在您的愿望清单中',
|
||||
'removed' => '项目已成功从愿望清单中删除',
|
||||
'remove-fail' => '无法从愿望清单中删除项目',
|
||||
'empty' => '您的愿望清单中没有任何商品',
|
||||
'select-options' => '在添加到愿望清单之前需要选择选项',
|
||||
'remove-all-success' => '您的愿望清单中的所有项目都已被删除',
|
||||
],
|
||||
|
||||
'reviews' => [
|
||||
'empty' => '您还没有评论任何产品',
|
||||
],
|
||||
|
||||
'forget_password' => [
|
||||
'reset_link_sent' => '我们已通过电子邮件发送您的重置密码链接.',
|
||||
'email_not_exist' => "我们找不到具有该电子邮件地址的用户",
|
||||
],
|
||||
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'captcha' => [
|
||||
'title' => '验证码',
|
||||
'credentials' => '证书',
|
||||
'site-key' => '站点密钥',
|
||||
'secret-key' => '密钥',
|
||||
'status' => '状态',
|
||||
|
||||
'validations' => [
|
||||
'required' => '请选择验证码',
|
||||
'captcha' => '出问题了! 请再试一次.',
|
||||
]
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Inventory\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\InventorySourcesDataGrid;
|
||||
use Webkul\Inventory\Http\Requests\InventorySourceRequest;
|
||||
use Webkul\Inventory\Repositories\InventorySourceRepository;
|
||||
|
||||
|
|
@ -41,6 +42,10 @@ class InventorySourceController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(InventorySourcesDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -115,21 +120,17 @@ class InventorySourceController extends Controller
|
|||
$this->inventorySourceRepository->findOrFail($id);
|
||||
|
||||
if ($this->inventorySourceRepository->count() == 1) {
|
||||
session()->flash('error', trans('admin::app.settings.inventory_sources.last-delete-error'));
|
||||
} else {
|
||||
try {
|
||||
$this->inventorySourceRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.settings.inventory_sources.delete-success'));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Inventory source']));
|
||||
}
|
||||
return response()->json(['message' => trans('admin::app.settings.inventory_sources.last-delete-error')], 400);
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
try {
|
||||
$this->inventorySourceRepository->delete($id);
|
||||
|
||||
return response()->json(['message' => trans('admin::app.settings.inventory_sources.delete-success')]);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Inventory source'])], 500);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Marketing\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\CampaignDataGrid;
|
||||
use Webkul\Marketing\Repositories\CampaignRepository;
|
||||
|
||||
class CampaignController extends Controller
|
||||
|
|
@ -40,6 +41,10 @@ class CampaignController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(CampaignDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -124,13 +129,9 @@ class CampaignController extends Controller
|
|||
try {
|
||||
$this->campaignRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.campaigns.delete-success'));
|
||||
return response()->json(['message' => trans('admin::app.marketing.campaigns.delete-success')]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Email Campaign']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Email Campaign'])], 500);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Marketing\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\EventDataGrid;
|
||||
use Webkul\Marketing\Repositories\EventRepository;
|
||||
|
||||
class EventController extends Controller
|
||||
|
|
@ -40,6 +41,10 @@ class EventController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(EventDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -126,13 +131,9 @@ class EventController extends Controller
|
|||
try {
|
||||
$this->eventRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.events.delete-success'));
|
||||
return response()->json(['message' => trans('admin::app.marketing.events.delete-success')]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Event']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Event'])], 500);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\Marketing\Http\Controllers;
|
||||
|
||||
use Webkul\Admin\DataGrids\EmailTemplateDataGrid;
|
||||
use Webkul\Marketing\Repositories\TemplateRepository;
|
||||
|
||||
class TemplateController extends Controller
|
||||
|
|
@ -40,6 +41,10 @@ class TemplateController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(EmailTemplateDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -120,13 +125,9 @@ class TemplateController extends Controller
|
|||
try {
|
||||
$this->templateRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.templates.delete-success'));
|
||||
return response()->json(['message' => trans('admin::app.marketing.templates.delete-success')]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Email Template']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Email Template'])], 400);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'error' => [
|
||||
'universal-error' => '出问题了!',
|
||||
'sdk-validation-error' => '无法识别生产或沙盒的客户端 ID!',
|
||||
'authorization-error' => '客户端ID和客户端密码应该是有效的!'
|
||||
]
|
||||
];
|
||||
|
|
@ -5,6 +5,7 @@ namespace Webkul\Product\Http\Controllers;
|
|||
use Exception;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Webkul\Admin\DataGrids\ProductDataGrid;
|
||||
use Webkul\Attribute\Repositories\AttributeFamilyRepository;
|
||||
use Webkul\Category\Repositories\CategoryRepository;
|
||||
use Webkul\Core\Contracts\Validations\Slug;
|
||||
|
|
@ -131,6 +132,10 @@ class ProductController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(ProductDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -347,20 +352,20 @@ class ProductController extends Controller
|
|||
try {
|
||||
$this->productRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Product']));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
return response()->json([
|
||||
'message' => trans('admin::app.response.delete-success', ['name' => 'Product']),
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
report($e);
|
||||
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Product']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json([
|
||||
'message' => trans('admin::app.response.delete-failed', ['name' => 'Product']),
|
||||
], 500);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mass Delete the products.
|
||||
* Mass delete the products.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
|
|
@ -382,7 +387,7 @@ class ProductController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Mass updates the products.
|
||||
* Mass update the products.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace Webkul\Product\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Admin\DataGrids\CustomerReviewDataGrid;
|
||||
use Webkul\Product\Repositories\ProductReviewRepository;
|
||||
|
||||
class ReviewController extends Controller
|
||||
|
|
@ -41,6 +42,10 @@ class ReviewController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->ajax()) {
|
||||
return app(CustomerReviewDataGrid::class)->toJson();
|
||||
}
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
|
|
@ -85,16 +90,12 @@ class ReviewController extends Controller
|
|||
try {
|
||||
$this->productReviewRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Review']));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-success', ['name' => 'Review'])]);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-failed', ['name' => 'Review']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Review'])], 500);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -52,21 +52,11 @@ class ProductImage extends AbstractProduct
|
|||
continue;
|
||||
}
|
||||
|
||||
$images[] = [
|
||||
'small_image_url' => url('cache/small/' . $image->path),
|
||||
'medium_image_url' => url('cache/medium/' . $image->path),
|
||||
'large_image_url' => url('cache/large/' . $image->path),
|
||||
'original_image_url' => url('cache/original/' . $image->path),
|
||||
];
|
||||
$images[] = $this->getCachedImageUrls($image->path);
|
||||
}
|
||||
|
||||
if (! $product->parent_id && ! count($images) && ! count($product->videos)) {
|
||||
$images[] = [
|
||||
'small_image_url' => asset('vendor/webkul/ui/assets/images/product/small-product-placeholder.webp'),
|
||||
'medium_image_url' => asset('vendor/webkul/ui/assets/images/product/meduim-product-placeholder.webp'),
|
||||
'large_image_url' => asset('vendor/webkul/ui/assets/images/product/large-product-placeholder.webp'),
|
||||
'original_image_url' => asset('vendor/webkul/ui/assets/images/product/large-product-placeholder.webp'),
|
||||
];
|
||||
$images[] = $this->getFallbackImageUrls();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -81,6 +71,27 @@ class ProductImage extends AbstractProduct
|
|||
return $loadedGalleryImages[$product->id] = $images;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product varient image if available otherwise product base image.
|
||||
*
|
||||
* @param \Webkul\Customer\Contracts\Wishlist $item
|
||||
* @return array
|
||||
*/
|
||||
public function getProductImage($item)
|
||||
{
|
||||
if ($item instanceof \Webkul\Customer\Contracts\Wishlist) {
|
||||
if (isset($item->additional['selected_configurable_option'])) {
|
||||
$product = $this->productRepository->find($item->additional['selected_configurable_option']);
|
||||
} else {
|
||||
$product = $item->product;
|
||||
}
|
||||
} else {
|
||||
$product = $item->product;
|
||||
}
|
||||
|
||||
return $this->getProductBaseImage($product);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will first check whether the gallery images are already
|
||||
* present or not. If not then it will load from the product.
|
||||
|
|
@ -104,27 +115,6 @@ class ProductImage extends AbstractProduct
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product varient image if available otherwise product base image.
|
||||
*
|
||||
* @param \Webkul\Customer\Contracts\Wishlist $item
|
||||
* @return array
|
||||
*/
|
||||
public function getProductImage($item)
|
||||
{
|
||||
if ($item instanceof \Webkul\Customer\Contracts\Wishlist) {
|
||||
if (isset($item->additional['selected_configurable_option'])) {
|
||||
$product = $this->productRepository->find($item->additional['selected_configurable_option']);
|
||||
} else {
|
||||
$product = $item->product;
|
||||
}
|
||||
} else {
|
||||
$product = $item->product;
|
||||
}
|
||||
|
||||
return $this->getProductBaseImage($product);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load product's base image.
|
||||
*
|
||||
|
|
@ -135,22 +125,58 @@ class ProductImage extends AbstractProduct
|
|||
{
|
||||
$images = $product ? $product->images : null;
|
||||
|
||||
if ($images && $images->count()) {
|
||||
$image = [
|
||||
'small_image_url' => url('cache/small/' . $images[0]->path),
|
||||
'medium_image_url' => url('cache/medium/' . $images[0]->path),
|
||||
'large_image_url' => url('cache/large/' . $images[0]->path),
|
||||
'original_image_url' => url('cache/original/' . $images[0]->path),
|
||||
];
|
||||
} else {
|
||||
$image = [
|
||||
'small_image_url' => asset('vendor/webkul/ui/assets/images/product/small-product-placeholder.webp'),
|
||||
'medium_image_url' => asset('vendor/webkul/ui/assets/images/product/meduim-product-placeholder.webp'),
|
||||
'large_image_url' => asset('vendor/webkul/ui/assets/images/product/large-product-placeholder.webp'),
|
||||
'original_image_url' => asset('vendor/webkul/ui/assets/images/product/large-product-placeholder.webp'),
|
||||
return $images && $images->count()
|
||||
? $this->getCachedImageUrls($images[0]->path)
|
||||
: $this->getFallbackImageUrls();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cached urls configured for intervention package.
|
||||
*
|
||||
* @param string $path
|
||||
* @return array
|
||||
*/
|
||||
private function getCachedImageUrls($path): array
|
||||
{
|
||||
if (! $this->isDriverLocal()) {
|
||||
return [
|
||||
'small_image_url' => Storage::url($path),
|
||||
'medium_image_url' => Storage::url($path),
|
||||
'large_image_url' => Storage::url($path),
|
||||
'original_image_url' => Storage::url($path),
|
||||
];
|
||||
}
|
||||
|
||||
return $image;
|
||||
return [
|
||||
'small_image_url' => url('cache/small/' . $path),
|
||||
'medium_image_url' => url('cache/medium/' . $path),
|
||||
'large_image_url' => url('cache/large/' . $path),
|
||||
'original_image_url' => url('cache/original/' . $path),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fallback urls.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getFallbackImageUrls(): array
|
||||
{
|
||||
return [
|
||||
'small_image_url' => asset('vendor/webkul/ui/assets/images/product/small-product-placeholder.webp'),
|
||||
'medium_image_url' => asset('vendor/webkul/ui/assets/images/product/meduim-product-placeholder.webp'),
|
||||
'large_image_url' => asset('vendor/webkul/ui/assets/images/product/large-product-placeholder.webp'),
|
||||
'original_image_url' => asset('vendor/webkul/ui/assets/images/product/large-product-placeholder.webp'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Is driver local.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isDriverLocal(): bool
|
||||
{
|
||||
return Storage::getAdapter() instanceof \League\Flysystem\Adapter\Local;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ class FlatRate extends AbstractShipping
|
|||
$cartShippingRate->method = $this->getMethod();
|
||||
$cartShippingRate->method_title = $this->getConfigData('title');
|
||||
$cartShippingRate->method_description = $this->getConfigData('description');
|
||||
$cartShippingRate->is_calculate_tax = $this->getConfigData('is_calculate_tax');
|
||||
$cartShippingRate->price = 0;
|
||||
$cartShippingRate->base_price = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ class Free extends AbstractShipping
|
|||
$cartShippingRate->method = $this->getMethod();
|
||||
$cartShippingRate->method_title = $this->getConfigData('title');
|
||||
$cartShippingRate->method_description = $this->getConfigData('description');
|
||||
$cartShippingRate->is_calculate_tax = $this->getConfigData('is_calculate_tax');
|
||||
$cartShippingRate->price = 0;
|
||||
$cartShippingRate->base_price = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,23 +2,21 @@
|
|||
|
||||
return [
|
||||
'flatrate' => [
|
||||
'code' => 'flatrate',
|
||||
'title' => 'Flat Rate',
|
||||
'description' => 'Flat Rate Shipping',
|
||||
'active' => true,
|
||||
'is_calculate_tax' => true,
|
||||
'default_rate' => '10',
|
||||
'type' => 'per_unit',
|
||||
'class' => 'Webkul\Shipping\Carriers\FlatRate',
|
||||
'code' => 'flatrate',
|
||||
'title' => 'Flat Rate',
|
||||
'description' => 'Flat Rate Shipping',
|
||||
'active' => true,
|
||||
'default_rate' => '10',
|
||||
'type' => 'per_unit',
|
||||
'class' => 'Webkul\Shipping\Carriers\FlatRate',
|
||||
],
|
||||
|
||||
'free' => [
|
||||
'code' => 'free',
|
||||
'title' => 'Free Shipping',
|
||||
'description' => 'Free Shipping',
|
||||
'active' => true,
|
||||
'is_calculate_tax' => true,
|
||||
'default_rate' => '0',
|
||||
'class' => 'Webkul\Shipping\Carriers\Free',
|
||||
]
|
||||
'free' => [
|
||||
'code' => 'free',
|
||||
'title' => 'Free Shipping',
|
||||
'description' => 'Free Shipping',
|
||||
'active' => true,
|
||||
'default_rate' => '0',
|
||||
'class' => 'Webkul\Shipping\Carriers\Free',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -109,13 +109,6 @@ return [
|
|||
'validation' => 'required',
|
||||
'channel_based' => false,
|
||||
'locale_based' => true,
|
||||
], [
|
||||
'name' => 'is_calculate_tax',
|
||||
'title' => 'admin::app.admin.system.calculate-tax',
|
||||
'type' => 'boolean',
|
||||
'validation' => 'required',
|
||||
'channel_based' => false,
|
||||
'locale_based' => false,
|
||||
],
|
||||
],
|
||||
], [
|
||||
|
|
@ -165,13 +158,6 @@ return [
|
|||
'validation' => 'required',
|
||||
'channel_based' => false,
|
||||
'locale_based' => true,
|
||||
], [
|
||||
'name' => 'is_calculate_tax',
|
||||
'title' => 'admin::app.admin.system.calculate-tax',
|
||||
'type' => 'boolean',
|
||||
'validation' => 'required',
|
||||
'channel_based' => false,
|
||||
'locale_based' => false,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -10,8 +10,8 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
* Vue.js v2.6.14
|
||||
* (c) 2014-2021 Evan You
|
||||
* Vue.js v2.6.12
|
||||
* (c) 2014-2020 Evan You
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue