Merged with master
This commit is contained in:
parent
44181411bd
commit
37e7c4c834
|
|
@ -4,6 +4,7 @@ APP_VERSION=1.1.2
|
|||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
APP_ADMIN_URL=admin
|
||||
APP_TIMEZONE=Asia/Kolkata
|
||||
APP_LOCALE=en
|
||||
LOG_CHANNEL=stack
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ APP_VERSION=1.1.2
|
|||
APP_KEY=base64:G4KY3tUsTaY9ONo1n/QyJvVLQZdJDgbIkSJswFK01HE=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
APP_ADMIN_URL=admin
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
"algolia/algoliasearch-client-php": "^2.2",
|
||||
"astrotomic/laravel-translatable": "^11.0.0",
|
||||
"babenkoivan/elastic-scout-driver": "^1.1",
|
||||
"bagistobrasil/bagisto-product-social-share": "^0.1.2",
|
||||
"barryvdh/laravel-debugbar": "^3.1",
|
||||
"barryvdh/laravel-dompdf": "0.8.6",
|
||||
"doctrine/dbal": "2.9.2",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "fdf74de7a5b3178ce60852ca512a6f21",
|
||||
"content-hash": "3332479a65fc6c67057c2946a27fe95e",
|
||||
"packages": [
|
||||
{
|
||||
"name": "algolia/algoliasearch-client-php",
|
||||
|
|
@ -302,6 +302,46 @@
|
|||
],
|
||||
"time": "2020-06-22T14:14:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "bagistobrasil/bagisto-product-social-share",
|
||||
"version": "0.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bagistobrasil/bagisto-product-social-share.git",
|
||||
"reference": "a81c4f29a3e79ce911a9e419cc83ccf513c0ab38"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/bagistobrasil/bagisto-product-social-share/zipball/a81c4f29a3e79ce911a9e419cc83ccf513c0ab38",
|
||||
"reference": "a81c4f29a3e79ce911a9e419cc83ccf513c0ab38",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"BagistoBrasil\\ProductSocialShare\\Providers\\ProductSocialShareProvider"
|
||||
],
|
||||
"aliases": []
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"BagistoBrasil\\ProductSocialShare\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Carlos Gartner",
|
||||
"email": "contato@carlosgartner.com.br"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-04T12:36:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "barryvdh/laravel-debugbar",
|
||||
"version": "v3.3.3",
|
||||
|
|
|
|||
|
|
@ -54,6 +54,18 @@ return [
|
|||
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Admin URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL suffix is used to define the admin url for example
|
||||
| admin/ or backend/
|
||||
|
|
||||
*/
|
||||
|
||||
'admin_url' => env('APP_ADMIN_URL', 'admin'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
"cross-env": "^5.1",
|
||||
"jquery": "^3.2",
|
||||
"laravel-mix": "^5.0.1",
|
||||
"lodash": "^4.17.4",
|
||||
"lodash": "^4.17.19",
|
||||
"popper.js": "^1.12",
|
||||
"resolve-url-loader": "^3.1.0",
|
||||
"sass": "^1.24.5",
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\API\\AdminServiceProvider"
|
||||
"Webkul\\API\\Providers\\APIServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Admin\\AdminServiceProvider"
|
||||
"Webkul\\Admin\\Providers\\AdminServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ return [
|
|||
'value' => 'kgs',
|
||||
],
|
||||
],
|
||||
'channel_based' => true,
|
||||
'channel_based' => true
|
||||
],
|
||||
],
|
||||
], [
|
||||
|
|
@ -41,24 +41,28 @@ return [
|
|||
'type' => 'text',
|
||||
'validation' => 'required|max:50',
|
||||
'channel_based' => true,
|
||||
'default_value' => config('mail.from.name'),
|
||||
], [
|
||||
'name' => 'shop_email_from',
|
||||
'title' => 'admin::app.admin.system.shop-email-from',
|
||||
'type' => 'text',
|
||||
'validation' => 'required|email',
|
||||
'channel_based' => true,
|
||||
'default_value' => config('mail.from.address'),
|
||||
], [
|
||||
'name' => 'admin_name',
|
||||
'title' => 'admin::app.admin.system.admin-name',
|
||||
'type' => 'text',
|
||||
'validation' => 'required|max:50',
|
||||
'channel_based' => true,
|
||||
'default_value' => config('mail.admin.name'),
|
||||
], [
|
||||
'name' => 'admin_email',
|
||||
'title' => 'admin::app.admin.system.admin-email',
|
||||
'type' => 'text',
|
||||
'validation' => 'required|email',
|
||||
'channel_based' => true,
|
||||
'default_value' => config('mail.admin.address'),
|
||||
],
|
||||
],
|
||||
], [
|
||||
|
|
|
|||
|
|
@ -15,6 +15,12 @@ class CartRuleDataGrid extends DataGrid
|
|||
|
||||
protected $channel = 'all';
|
||||
|
||||
/** @var string[] contains the keys for which extra filters to show */
|
||||
protected $extraFilters = [
|
||||
'channels',
|
||||
'customer_groups',
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
|
|
|||
|
|
@ -45,6 +45,19 @@ class OrderInvoicesDataGrid extends DataGrid
|
|||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'created_at',
|
||||
'label' => trans('admin::app.datagrid.invoice-date'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
'closure' => true,
|
||||
'wrapper' => function ($value) {
|
||||
return \Carbon\Carbon::parse($value->created_at)->format('d-m-Y');
|
||||
}
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'base_grand_total',
|
||||
'label' => trans('admin::app.datagrid.grand-total'),
|
||||
|
|
@ -55,12 +68,22 @@ class OrderInvoicesDataGrid extends DataGrid
|
|||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'created_at',
|
||||
'label' => trans('admin::app.datagrid.invoice-date'),
|
||||
'type' => 'datetime',
|
||||
'index' => 'state',
|
||||
'label' => trans('admin::app.datagrid.state'),
|
||||
'type' => 'string',
|
||||
'closure' => true,
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if ($value->state == 'paid') {
|
||||
return '<span class="badge badge-md badge-success">'. trans('admin::app.sales.orders.invoice-status-paid') .'</span>';
|
||||
} elseif ($value->state == "pending") {
|
||||
return '<span class="badge badge-md badge-warning">'. trans('admin::app.sales.orders.invoice-status-pending') .'</span>';
|
||||
} elseif ($value->state == "overdue") {
|
||||
return '<span class="badge badge-md badge-danger">'. trans('admin::app.sales.orders.invoice-status-overdue') . '</span>';
|
||||
}
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ namespace Webkul\Admin\DataGrids;
|
|||
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Core\Models\Channel;
|
||||
|
||||
class ProductDataGrid extends DataGrid
|
||||
{
|
||||
|
|
@ -17,22 +18,39 @@ class ProductDataGrid extends DataGrid
|
|||
|
||||
protected $channel = 'all';
|
||||
|
||||
/** @var string[] contains the keys for which extra filters to render */
|
||||
protected $extraFilters = [
|
||||
'channels',
|
||||
'locales',
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
/* locale */
|
||||
$this->locale = request()->get('locale') ?? 'all';
|
||||
|
||||
/* channel */
|
||||
$this->channel = request()->get('channel') ?? 'all';
|
||||
|
||||
/* finding channel name */
|
||||
if ($this->channel !== 'all') {
|
||||
$this->channel = Channel::find($this->channel);
|
||||
$this->channel = $this->channel ? $this->channel->code : 'all';
|
||||
}
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
/* query builder */
|
||||
$queryBuilder = DB::table('product_flat')
|
||||
->leftJoin('products', 'product_flat.product_id', '=', 'products.id')
|
||||
->leftJoin('attribute_families', 'products.attribute_family_id', '=', 'attribute_families.id')
|
||||
->leftJoin('product_inventories', 'product_flat.product_id', '=', 'product_inventories.product_id')
|
||||
->select(
|
||||
'product_flat.locale',
|
||||
'product_flat.channel',
|
||||
'product_flat.product_id as product_id',
|
||||
'products.sku as product_sku',
|
||||
'product_flat.name as product_name',
|
||||
|
|
@ -44,18 +62,16 @@ class ProductDataGrid extends DataGrid
|
|||
);
|
||||
|
||||
if ($this->locale !== 'all') {
|
||||
$queryBuilder->where('locale', $this->locale);
|
||||
$queryBuilder->where('product_flat.locale', $this->locale);
|
||||
}
|
||||
|
||||
if ($this->channel !== 'all') {
|
||||
$queryBuilder->where('channel', $this->channel);
|
||||
}
|
||||
|
||||
if ($currentLocale = app()->getLocale()) {
|
||||
$queryBuilder->where('product_flat.locale', $currentLocale);
|
||||
$queryBuilder->where('product_flat.channel', $this->channel);
|
||||
}
|
||||
|
||||
$queryBuilder->groupBy('product_flat.product_id');
|
||||
$queryBuilder->having('locale', $this->locale !== 'all' ? $this->locale : 'en');
|
||||
$queryBuilder->having('channel', $this->channel !== 'all' ? $this->channel : 'default');
|
||||
|
||||
$this->addFilter('product_id', 'product_flat.product_id');
|
||||
$this->addFilter('product_name', 'product_flat.name');
|
||||
|
|
|
|||
|
|
@ -15,6 +15,12 @@ class SliderDataGrid extends DataGrid
|
|||
|
||||
protected $channel = 'all';
|
||||
|
||||
/** @var string[] contains the keys for which extra filters to render */
|
||||
protected $extraFilters = [
|
||||
'channels',
|
||||
'locales',
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use Webkul\User\Database\Seeders\DatabaseSeeder as UserSeeder;
|
|||
use Webkul\Customer\Database\Seeders\DatabaseSeeder as CustomerSeeder;
|
||||
use Webkul\Inventory\Database\Seeders\DatabaseSeeder as InventorySeeder;
|
||||
use Webkul\CMS\Database\Seeders\DatabaseSeeder as CMSSeeder;
|
||||
use Webkul\SocialLogin\Database\Seeders\DatabaseSeeder as SocialLoginSeeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
|
|
@ -27,5 +28,6 @@ class DatabaseSeeder extends Seeder
|
|||
$this->call(UserSeeder::class);
|
||||
$this->call(CustomerSeeder::class);
|
||||
$this->call(CMSSeeder::class);
|
||||
$this->call(SocialLoginSeeder::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,12 +64,12 @@ class CustomerController extends Controller
|
|||
CustomerGroupRepository $customerGroupRepository,
|
||||
ChannelRepository $channelRepository
|
||||
)
|
||||
|
||||
|
||||
{
|
||||
$this->_config = request('_config');
|
||||
$this->middleware('admin');
|
||||
$this->customerRepository = $customerRepository;
|
||||
|
||||
|
||||
$this->customerAddressRepository = $customerAddressRepository;
|
||||
$this->customerGroupRepository = $customerGroupRepository;
|
||||
$this->channelRepository = $channelRepository;
|
||||
|
|
@ -200,12 +200,19 @@ class CustomerController extends Controller
|
|||
$customer = $this->customerRepository->findorFail($id);
|
||||
|
||||
try {
|
||||
$this->customerRepository->delete($id);
|
||||
|
||||
if (! $this->customerRepository->checkIfCustomerHasOrderPendingOrProcessing($customer)) {
|
||||
|
||||
$this->customerRepository->delete($id);
|
||||
} else {
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
}
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Customer']));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Customer']));
|
||||
}
|
||||
|
||||
|
|
@ -279,12 +286,18 @@ class CustomerController extends Controller
|
|||
{
|
||||
$customerIds = explode(',', request()->input('indexes'));
|
||||
|
||||
foreach ($customerIds as $customerId) {
|
||||
$this->customerRepository->deleteWhere(['id' => $customerId]);
|
||||
if (!$this->customerRepository->checkBulkCustomerIfTheyHaveOrderPendingOrProcessing($customerIds)) {
|
||||
|
||||
foreach ($customerIds as $customerId) {
|
||||
$this->customerRepository->deleteWhere(['id' => $customerId]);
|
||||
}
|
||||
|
||||
session()->flash('success', trans('admin::app.customers.customers.mass-destroy-success'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
session()->flash('success', trans('admin::app.customers.customers.mass-destroy-success'));
|
||||
|
||||
session()->flash('error', trans('admin::app.response.order-pending', ['name' => 'Customers']));
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
|
@ -241,6 +241,8 @@ class DashboardController extends Controller
|
|||
->addSelect('id', 'customer_id', 'customer_email', 'customer_first_name', 'customer_last_name')
|
||||
->where('orders.created_at', '>=', $this->startDate)
|
||||
->where('orders.created_at', '<=', $this->endDate)
|
||||
->where('orders.status', '<>', 'closed')
|
||||
->where('orders.status', '<>', 'canceled')
|
||||
->groupBy('customer_email')
|
||||
->orderBy('total_base_grand_total', 'DESC')
|
||||
->limit(5)
|
||||
|
|
|
|||
|
|
@ -2,9 +2,12 @@
|
|||
|
||||
namespace Webkul\Admin\Http\Controllers\Sales;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Webkul\Admin\Http\Controllers\Controller;
|
||||
use Webkul\Sales\Repositories\OrderRepository;
|
||||
use Webkul\Sales\Repositories\InvoiceRepository;
|
||||
|
||||
use PDF;
|
||||
|
||||
class InvoiceController extends Controller
|
||||
|
|
@ -97,7 +100,7 @@ class InvoiceController extends Controller
|
|||
$data = request()->all();
|
||||
|
||||
$haveProductToInvoice = false;
|
||||
|
||||
|
||||
foreach ($data['invoice']['items'] as $itemId => $qty) {
|
||||
if ($qty) {
|
||||
$haveProductToInvoice = true;
|
||||
|
|
@ -145,4 +148,29 @@ class InvoiceController extends Controller
|
|||
|
||||
return $pdf->download('invoice-' . $invoice->created_at->format('d-m-Y') . '.pdf');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the invoice state.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function updateState($id, Request $request)
|
||||
{
|
||||
$invoice = $this->invoiceRepository->findOrFail($id);
|
||||
$task = $this->invoiceRepository->updateInvoiceState($invoice, $request->state);
|
||||
|
||||
if($request->state == 'paid'){
|
||||
$order = $this->orderRepository->findOrFail($invoice->order->id);
|
||||
$this->orderRepository->updateOrderStatus($order);
|
||||
}
|
||||
|
||||
if ($task){
|
||||
session()->flash('success', trans('admin::app.sales.orders.invoice-status-confirmed'));
|
||||
} else {
|
||||
session()->flash('success', trans('admin::app.sales.orders.invoice-status-error'));
|
||||
}
|
||||
|
||||
return back();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,30 @@
|
|||
namespace Webkul\Admin\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Validation\Factory as ValidationFactory;
|
||||
|
||||
class ConfigurationForm extends FormRequest
|
||||
{
|
||||
/*
|
||||
Added custom validator.
|
||||
*/
|
||||
public function __construct(ValidationFactory $validationFactory)
|
||||
{
|
||||
/* added custom comma seperated integer validator */
|
||||
$validationFactory->extend(
|
||||
'comma_seperated_integer',
|
||||
function ($attribute, $value, $parameters) {
|
||||
$pages = explode(',', $value);
|
||||
foreach($pages as $page){
|
||||
if (! is_numeric($page)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the Configuraion is authorized to make this request.
|
||||
*
|
||||
|
|
@ -26,12 +46,28 @@ class ConfigurationForm extends FormRequest
|
|||
{
|
||||
$this->rules = [];
|
||||
|
||||
if (request()->has('catalog.products.storefront.products_per_page')
|
||||
&& ! empty(request()->input('catalog.products.storefront.products_per_page'))
|
||||
) {
|
||||
$this->rules = [
|
||||
'catalog.products.storefront.products_per_page' => 'comma_seperated_integer',
|
||||
];
|
||||
}
|
||||
|
||||
if (request()->has('general.design.admin_logo.logo_image')
|
||||
&& ! request()->input('general.design.admin_logo.logo_image.delete')
|
||||
) {
|
||||
$this->rules = [
|
||||
'general.design.admin_logo.logo_image' => 'required|mimes:jpeg,bmp,png,jpg',
|
||||
];
|
||||
$this->rules = array_merge($this->rules, [
|
||||
'general.design.admin_logo.logo_image' => 'required|mimes:jpeg,bmp,png,jpg|max:5000',
|
||||
]);
|
||||
}
|
||||
|
||||
if (request()->has('general.design.admin_logo.favicon')
|
||||
&& ! request()->input('general.design.admin_logo.favicon.delete')
|
||||
) {
|
||||
$this->rules = array_merge($this->rules, [
|
||||
'general.design.admin_logo.favicon' => 'required|mimes:jpeg,bmp,png,jpg|max:5000',
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->rules;
|
||||
|
|
@ -46,6 +82,18 @@ class ConfigurationForm extends FormRequest
|
|||
{
|
||||
return [
|
||||
'general.design.admin_logo.logo_image.mimes' => 'Invalid file format. Use only jpeg, bmp, png, jpg.',
|
||||
'catalog.products.storefront.products_per_page.comma_seperated_integer' => 'The "Product Per Page" field must be numeric and may contain comma.'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the attribute name.
|
||||
*/
|
||||
public function attributes()
|
||||
{
|
||||
return [
|
||||
'general.design.admin_logo.logo_image' => 'Logo Image',
|
||||
'general.design.admin_logo.favicon' => 'Favicon Image'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
Route::group(['middleware' => ['web']], function () {
|
||||
Route::prefix('admin')->group(function () {
|
||||
Route::prefix(config('app.admin_url'))->group(function () {
|
||||
|
||||
Route::get('/', 'Webkul\Admin\Http\Controllers\Controller@redirectToLogin');
|
||||
|
||||
|
|
@ -211,6 +211,10 @@ Route::group(['middleware' => ['web']], function () {
|
|||
'view' => 'admin::sales.invoices.print',
|
||||
])->name('admin.sales.invoices.print');
|
||||
|
||||
Route::post('/invoices/update/state/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@updateState')->defaults('_config', [
|
||||
'redirect' => 'admin.sales.orders.view',
|
||||
])->name('admin.sales.invoices.update.state');
|
||||
|
||||
|
||||
// Sales Shipments Routes
|
||||
Route::get('/shipments', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@index')->defaults('_config', [
|
||||
|
|
@ -673,7 +677,7 @@ Route::group(['middleware' => ['web']], function () {
|
|||
//tax rate ends
|
||||
|
||||
//DataGrid Export
|
||||
Route::post('admin/export', 'Webkul\Admin\Http\Controllers\ExportController@export')->name('admin.datagrid.export');
|
||||
Route::post(config('app.admin_url') . '/export', 'Webkul\Admin\Http\Controllers\ExportController@export')->name('admin.datagrid.export');
|
||||
|
||||
Route::prefix('promotions')->group(function () {
|
||||
Route::get('cart-rules', 'Webkul\CartRule\Http\Controllers\CartRuleController@index')->defaults('_config', [
|
||||
|
|
|
|||
|
|
@ -3,36 +3,39 @@
|
|||
namespace Webkul\Admin\Listeners;
|
||||
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Webkul\Admin\Mail\NewOrderNotification;
|
||||
use Webkul\Admin\Mail\NewAdminNotification;
|
||||
use Webkul\Admin\Mail\NewInvoiceNotification;
|
||||
use Webkul\Admin\Mail\NewShipmentNotification;
|
||||
use Webkul\Admin\Mail\NewInventorySourceNotification;
|
||||
use Webkul\Admin\Mail\CancelOrderNotification;
|
||||
use Webkul\Admin\Mail\NewOrderNotification;
|
||||
use Webkul\Admin\Mail\NewRefundNotification;
|
||||
use Webkul\Admin\Mail\NewInvoiceNotification;
|
||||
use Webkul\Admin\Mail\CancelOrderNotification;
|
||||
use Webkul\Admin\Mail\NewShipmentNotification;
|
||||
use Webkul\Admin\Mail\OrderCommentNotification;
|
||||
use Webkul\Admin\Mail\CancelOrderAdminNotification;
|
||||
use Webkul\Admin\Mail\NewInventorySourceNotification;
|
||||
|
||||
class Order
|
||||
{
|
||||
/**
|
||||
* Send new order Mail to the customer and admin
|
||||
*
|
||||
*
|
||||
* @param \Webkul\Sales\Contracts\Order $order
|
||||
* @return void
|
||||
*/
|
||||
public function sendNewOrderMail($order)
|
||||
{
|
||||
try {
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-order';
|
||||
$customerLocale = $this->getLocale($order);
|
||||
|
||||
try {
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-order';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewOrderNotification($order));
|
||||
$this->prepareMail($customerLocale, new NewOrderNotification($order));
|
||||
}
|
||||
|
||||
/* email to admin */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-admin';
|
||||
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewAdminNotification($order));
|
||||
$this->prepareMail(env('APP_LOCALE'), new NewAdminNotification($order));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -41,21 +44,23 @@ class Order
|
|||
|
||||
/**
|
||||
* Send new invoice mail to the customer
|
||||
*
|
||||
*
|
||||
* @param \Webkul\Sales\Contracts\Invoice $invoice
|
||||
* @return void
|
||||
*/
|
||||
public function sendNewInvoiceMail($invoice)
|
||||
{
|
||||
$customerLocale = $this->getLocale($invoice);
|
||||
|
||||
try {
|
||||
if ($invoice->email_sent) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-invoice';
|
||||
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewInvoiceNotification($invoice));
|
||||
$this->prepareMail($customerLocale, new NewInvoiceNotification($invoice));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -64,17 +69,19 @@ class Order
|
|||
|
||||
/**
|
||||
* Send new refund mail to the customer
|
||||
*
|
||||
*
|
||||
* @param \Webkul\Sales\Contracts\Refund $refund
|
||||
* @return void
|
||||
*/
|
||||
public function sendNewRefundMail($refund)
|
||||
{
|
||||
try {
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-refund';
|
||||
$customerLocale = $this->getLocale($refund);
|
||||
|
||||
try {
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-refund';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewRefundNotification($refund));
|
||||
$this->prepareMail($customerLocale, new NewRefundNotification($refund));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -83,27 +90,29 @@ class Order
|
|||
|
||||
/**
|
||||
* Send new shipment mail to the customer
|
||||
*
|
||||
*
|
||||
* @param \Webkul\Sales\Contracts\Shipment $shipment
|
||||
* @return void
|
||||
*/
|
||||
public function sendNewShipmentMail($shipment)
|
||||
{
|
||||
$customerLocale = $this->getLocale($shipment);
|
||||
|
||||
try {
|
||||
if ($shipment->email_sent) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-shipment';
|
||||
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewShipmentNotification($shipment));
|
||||
$this->prepareMail($customerLocale, new NewShipmentNotification($shipment));
|
||||
}
|
||||
|
||||
/* email to admin */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-inventory-source';
|
||||
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewInventorySourceNotification($shipment));
|
||||
$this->prepareMail(env('APP_LOCALE'), new NewInventorySourceNotification($shipment));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -116,10 +125,19 @@ class Order
|
|||
*/
|
||||
public function sendCancelOrderMail($order)
|
||||
{
|
||||
$customerLocale = $this->getLocale($order);
|
||||
|
||||
try {
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.cancel-order';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new CancelOrderNotification($order));
|
||||
$this->prepareMail($customerLocale, new CancelOrderNotification($order));
|
||||
}
|
||||
|
||||
/* email to admin */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-admin';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
$this->prepareMail(env('APP_LOCALE'), new CancelOrderAdminNotification($order));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -132,14 +150,43 @@ class Order
|
|||
*/
|
||||
public function sendOrderCommentMail($comment)
|
||||
{
|
||||
$customerLocale = $this->getLocale($comment);
|
||||
|
||||
if (! $comment->customer_notified) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Mail::queue(new OrderCommentNotification($comment));
|
||||
/* email to customer */
|
||||
$this->prepareMail($customerLocale, new OrderCommentNotification($comment));
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the locale of the customer if somehow item name changes then the english locale will pe provided.
|
||||
*
|
||||
* @param object \Webkul\Sales\Contracts\Order|\Webkul\Sales\Contracts\Invoice|\Webkul\Sales\Contracts\Refund|\Webkul\Sales\Contracts\Shipment|\Webkul\Sales\Contracts\OrderComment
|
||||
* @return string
|
||||
*/
|
||||
private function getLocale($object)
|
||||
{
|
||||
if ($object instanceof \Webkul\Sales\Contracts\OrderComment) {
|
||||
$object = $object->order;
|
||||
}
|
||||
|
||||
$objectFirstItem = $object->items->first();
|
||||
return isset($objectFirstItem->additional['locale']) ? $objectFirstItem->additional['locale'] : 'en';
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare Mail.
|
||||
* @return void
|
||||
*/
|
||||
private function prepareMail($locale, $notification)
|
||||
{
|
||||
app()->setLocale($locale);
|
||||
Mail::queue($notification);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Listeners;
|
||||
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Webkul\User\Notifications\AdminUpdatePassword;
|
||||
use Webkul\Customer\Notifications\CustomerUpdatePassword;
|
||||
|
||||
class PasswordChange
|
||||
{
|
||||
/**
|
||||
* Send mail on updating password.
|
||||
*
|
||||
* @param \Webkul\Customer\Models\Customer|\Webkul\User\Models\Admin $adminOrCustomer
|
||||
* @return void
|
||||
*/
|
||||
public function sendUpdatePasswordMail($adminOrCustomer)
|
||||
{
|
||||
try {
|
||||
if ($adminOrCustomer instanceof \Webkul\Customer\Models\Customer) {
|
||||
Mail::queue(new CustomerUpdatePassword($adminOrCustomer));
|
||||
}
|
||||
|
||||
if ($adminOrCustomer instanceof \Webkul\User\Models\Admin) {
|
||||
Mail::queue(new AdminUpdatePassword($adminOrCustomer));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CancelOrderAdminNotification extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* @var \Webkul\Sales\Contracts\Order
|
||||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* @param \Webkul\Sales\Contracts\Order $order
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($order)
|
||||
{
|
||||
$this->order = $order;
|
||||
}
|
||||
|
||||
public function build()
|
||||
{
|
||||
return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name'])
|
||||
->to(core()->getAdminEmailDetails()['email'])
|
||||
->subject(trans('shop::app.mail.order.cancel.subject'))
|
||||
->view('shop::emails.sales.order-cancel-admin');
|
||||
}
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ class OrderCommentNotification extends Mailable
|
|||
{
|
||||
return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name'])
|
||||
->to($this->comment->order->customer_email, $this->comment->order->customer_full_name)
|
||||
->subject(trans('shop::app.mail.order.comment.subject'))
|
||||
->subject(trans('shop::app.mail.order.comment.subject', ['order_id' => $this->comment->order->increment_id]))
|
||||
->view('shop::emails.sales.new-order-comment');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ class EventServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
Event::listen('user.admin.update-password', 'Webkul\Admin\Listeners\PasswordChange@sendUpdatePasswordMail');
|
||||
|
||||
Event::listen('checkout.order.save.after', 'Webkul\Admin\Listeners\Order@sendNewOrderMail');
|
||||
|
||||
Event::listen('sales.invoice.save.after', 'Webkul\Admin\Listeners\Order@sendNewInvoiceMail');
|
||||
|
|
|
|||
|
|
@ -320,6 +320,14 @@ return array (
|
|||
'invoice-btn-title' => 'Rechnung',
|
||||
'info' => 'Informationen',
|
||||
'invoices' => 'Rechnungen',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Sendungen',
|
||||
'order-and-account' => 'Bestellung und Rechnung',
|
||||
'order-info' => 'Bestellinformationen',
|
||||
|
|
|
|||
|
|
@ -319,6 +319,14 @@ return [
|
|||
'invoice-btn-title' => 'Invoice',
|
||||
'info' => 'Information',
|
||||
'invoices' => 'Invoices',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Shipments',
|
||||
'order-and-account' => 'Order and Account',
|
||||
'order-info' => 'Order Information',
|
||||
|
|
@ -1219,7 +1227,7 @@ return [
|
|||
'cancel-success' => ':name canceled successfully.',
|
||||
'cancel-error' => ':name can not be canceled.',
|
||||
'already-taken' => 'The :name has already been taken.',
|
||||
'order-pending' => 'Cannot delete account because some Order(s) are pending or processing state.'
|
||||
'order-pending' => 'Cannot delete :name account because some Order(s) are pending or processing state.'
|
||||
],
|
||||
|
||||
'footer' => [
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -318,6 +318,14 @@ return [
|
|||
'invoice-btn-title' => 'صورت حساب',
|
||||
'info' => 'اطلاعات',
|
||||
'invoices' => 'صورت حساب ها',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'حمل و نقل ها',
|
||||
'order-and-account' => 'سفارش و حساب',
|
||||
'order-info' => 'اطلاعات سفارش',
|
||||
|
|
|
|||
|
|
@ -318,6 +318,14 @@ return [
|
|||
'invoice-btn-title' => 'Fattura',
|
||||
'info' => 'Informazoni',
|
||||
'invoices' => 'Fatture',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Spedizioni',
|
||||
'order-and-account' => 'Ordine e Account',
|
||||
'order-info' => 'informazioni Ordine',
|
||||
|
|
|
|||
|
|
@ -318,6 +318,14 @@ return [
|
|||
'invoice-btn-title' => 'Factuur',
|
||||
'info' => 'Informatie',
|
||||
'invoices' => 'Facturen',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Verzendingen',
|
||||
'order-and-account' => 'Order and Account',
|
||||
'order-info' => 'Order Information',
|
||||
|
|
|
|||
|
|
@ -317,6 +317,14 @@ return [
|
|||
'invoice-btn-title' => 'Faktura',
|
||||
'info' => 'Informacje',
|
||||
'invoices' => 'Faktury',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Przesyłki',
|
||||
'order-and-account' => 'Zamówienie i konto',
|
||||
'order-info' => 'Informacje o zamówieniu',
|
||||
|
|
|
|||
|
|
@ -318,6 +318,14 @@ return [
|
|||
'invoice-btn-title' => 'Faturar',
|
||||
'info' => 'Informação',
|
||||
'invoices' => 'Faturas',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Envios',
|
||||
'order-and-account' => 'Pedido e Conta',
|
||||
'order-info' => 'Informação do Pedido',
|
||||
|
|
|
|||
|
|
@ -316,6 +316,14 @@ return [
|
|||
'invoice-btn-title' => 'Fatura',
|
||||
'info' => 'Bilgi',
|
||||
'invoices' => 'Faturalar',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Kargo',
|
||||
'order-and-account' => 'Sipariş ve Hesap',
|
||||
'order-info' => 'Sipariş Bilgisi',
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.catalog.attributes.add-title') }}
|
||||
</h1>
|
||||
|
|
@ -296,7 +296,10 @@
|
|||
</td>
|
||||
|
||||
<td v-if="show_swatch && swatch_type == 'image'">
|
||||
<input type="file" accept="image/*" :name="'options[' + row.id + '][swatch_value]'"/>
|
||||
<div class="control-group" :class="[errors.has('options[' + row.id + '][swatch_value]') ? 'has-error' : '']">
|
||||
<input type="file" v-validate="'size:600'" accept="image/*" :name="'options[' + row.id + '][swatch_value]'"/>
|
||||
<span class="control-error" v-if="errors.has('options[' + row.id + '][swatch_value]')">The image size must be less than 600 KB</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.catalog.attributes.edit-title') }}
|
||||
</h1>
|
||||
|
|
@ -365,8 +365,11 @@
|
|||
</td>
|
||||
|
||||
<td style="white-space: nowrap;" v-if="show_swatch && swatch_type == 'image'">
|
||||
<img style="width: 36px;height: 36px;vertical-align: middle;background: #F2F2F2;border-radius: 2px;margin-right: 10px;" v-if="row.swatch_value_url" :src="row.swatch_value_url"/>
|
||||
<input type="file" accept="image/*" :name="'options[' + row.id + '][swatch_value]'"/>
|
||||
<div class="control-group" :class="[errors.has('options[' + row.id + '][swatch_value]') ? 'has-error' : '']">
|
||||
<img style="width: 36px;height: 36px;vertical-align: middle;background: #F2F2F2;border-radius: 2px;margin-right: 10px;" v-if="row.swatch_value_url" :src="row.swatch_value_url"/>
|
||||
<input type="file" v-validate="'size:600'" accept="image/*" :name="'options[' + row.id + '][swatch_value]'"/>
|
||||
<span class="control-error" v-if="errors.has('options[' + row.id + '][swatch_value]')">The image size must be less than 600 KB</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
|
@ -418,7 +421,7 @@
|
|||
optionRowCount: 0,
|
||||
optionRows: [],
|
||||
show_swatch: "{{ $attribute->type == 'select' ? true : false }}",
|
||||
swatch_type: "{{ $attribute->swatch_type }}",
|
||||
swatch_type: "{{ $attribute->swatch_type == '' ? 'dropdown' : $attribute->swatch_type }}",
|
||||
isNullOptionChecked: false,
|
||||
idNullOption: null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.catalog.categories.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.catalog.categories.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.catalog.families.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.catalog.families.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.catalog.products.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<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>
|
||||
onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.catalog.products.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code] }}" {{ in_array($attribute->code, ['sku', 'url_key']) ? 'v-slugify' : '' }} data-vv-as=""{{ $attribute->admin_name }}"" {{ $attribute->code == 'name' ? 'v-slugify-target=\'url_key\'' : '' }} />
|
||||
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code] }}" {{ in_array($attribute->code, ['sku', 'url_key']) ? 'v-slugify' : '' }} data-vv-as=""{{ $attribute->admin_name }}"" {{ $attribute->code == 'name' && ! $product[$attribute->code] ? 'v-slugify-target=\'url_key\'' : '' }} />
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,39 +11,6 @@
|
|||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.catalog.products.title') }}</h1>
|
||||
|
||||
<div class="control-group">
|
||||
<select class="control" id="channel-switcher" name="channel" onchange="reloadPage('channel', this.value)" >
|
||||
<option value="all" {{ ! isset($channel) ? 'selected' : '' }}>
|
||||
{{ __('admin::app.admin.system.all-channels') }}
|
||||
</option>
|
||||
|
||||
@foreach (core()->getAllChannels() as $channelModel)
|
||||
<option
|
||||
value="{{ $channelModel->code }}" {{ (isset($channel) && ($channelModel->code) == $channel) ? 'selected' : '' }}>
|
||||
{{ $channelModel->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<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' : '' }}>
|
||||
{{ $localeModel->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.cms.pages.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.cms.pages.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
@if ($field['type'] == 'text')
|
||||
|
||||
<input type="text" v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="{{ old($name) ?: core()->getConfigData($name) }}" data-vv-as=""{{ trans($field['title']) }}"">
|
||||
<input type="text" v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="{{ old($name) ?: (core()->getConfigData($name) ? core()->getConfigData($name) : (isset($field['default_value']) ? $field['default_value'] : '')) }}" data-vv-as=""{{ trans($field['title']) }}"">
|
||||
|
||||
@elseif ($field['type'] == 'password')
|
||||
|
||||
|
|
@ -212,7 +212,7 @@
|
|||
@elseif ($field['type'] == 'boolean')
|
||||
|
||||
<?php $selectedOption = core()->getConfigData($name) ?? ''; ?>
|
||||
|
||||
|
||||
<label class="switch">
|
||||
<input type="hidden" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="0" />
|
||||
<input type="checkbox" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="1" {{ $selectedOption ? 'checked' : '' }}>
|
||||
|
|
@ -408,12 +408,12 @@
|
|||
<span class="locale"> [@{{ channel_locale }}] </span>
|
||||
</label>
|
||||
|
||||
<select v-if="this.options.length" v-validate= "validations" class="control" :id = "name" :name = "name" v-model="this.result"
|
||||
<select v-if="this.options.length" v-validate= "validations" class="control" :id = "name" :name = "name" v-model="savedValue"
|
||||
:data-vv-as="field_name">
|
||||
<option v-for='(option, index) in this.options' :value="option.value"> @{{ option.title }} </option>
|
||||
</select>
|
||||
|
||||
<input v-else type="text" class="control" v-validate= "validations" :id = "name" :name = "name" v-model="this.result"
|
||||
<input v-else type="text" class="control" v-validate= "validations" :id = "name" :name = "name" v-model="savedValue"
|
||||
:data-vv-as="field_name">
|
||||
|
||||
<span class="control-error" v-if="errors.has(name)">
|
||||
|
|
@ -436,12 +436,15 @@
|
|||
return {
|
||||
isRequire: false,
|
||||
isVisible: false,
|
||||
savedValue: "",
|
||||
}
|
||||
},
|
||||
|
||||
mounted: function () {
|
||||
var this_this = this;
|
||||
|
||||
this_this.savedValue = this_this.result;
|
||||
|
||||
if (this_this.validations || (this_this.validations.indexOf("required") != -1)) {
|
||||
this_this.isRequire = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,16 +5,16 @@
|
|||
@stop
|
||||
|
||||
|
||||
@section('content-wrapper')
|
||||
@section('content')
|
||||
|
||||
<div class="content full-page">
|
||||
<div class="content">
|
||||
{!! view_render_event('admin.customer.addresses.create.before') !!}
|
||||
|
||||
<form method="POST" action="{{ route('admin.customer.addresses.store', ['id' => $customer->id]) }}" @submit.prevent="onSubmit">
|
||||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.customers.addresses.create-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
@stop
|
||||
|
||||
|
||||
@section('content-wrapper')
|
||||
@section('content')
|
||||
|
||||
<div class="content full-page">
|
||||
<div class="content">
|
||||
{!! view_render_event('admin.customer.addresses.edit.before', ['address' => $address]) !!}
|
||||
|
||||
<form method="post" action="{{ route('admin.customer.addresses.update', $address->id) }}" @submit.prevent="onSubmit">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('address::app.admin.addresses.title-orders', ['customer_name' => $customer->first_name . ' ' . $customer->last_name]) }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
{{ __('admin::app.users.users.confirm-delete-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.customers.customers.title') }}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
{{ $customer->first_name . " " . $customer->last_name }}
|
||||
</h1>
|
||||
</div>
|
||||
|
|
@ -25,11 +25,11 @@
|
|||
|
||||
<tab name="{{ __('admin::app.customers.customers.addresses') }}" :selected="false">
|
||||
<div class="style:overflow: auto;"> </div>
|
||||
{!! view_render_event('bagisto.admin.customer.addresses.list.before') !!}
|
||||
{!! view_render_event('bagisto.admin.customer.addresses.list.before') !!}
|
||||
{!! app('Webkul\Admin\DataGrids\AddressDataGrid')->render() !!}
|
||||
{!! view_render_event('bagisto.admin.customer.addresses.list.after') !!}
|
||||
</div>
|
||||
</tab>
|
||||
</tab>
|
||||
{!! view_render_event('bagisto.admin.customer.edit.after', ['customer' => $customer]) !!}
|
||||
</tabs>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
<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>
|
||||
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.customers.groups.add-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.customers.groups.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.customers.note.title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.customers.reviews.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.customers.subscribers.title-edit') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@
|
|||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" @click="redirectBack('{{ url('/admin/dashboard') }}')"></i>
|
||||
<i class="icon angle-left-icon back-link"
|
||||
onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.promotions.cart-rules.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@
|
|||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" @click="redirectBack('{{ url('/admin/dashboard') }}')"></i>
|
||||
<i class="icon angle-left-icon back-link"
|
||||
onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.promotions.cart-rules.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -14,38 +14,6 @@
|
|||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<div class="control-group">
|
||||
<select class="control" id="channel-switcher" name="channel" onchange="reloadPage('channel', this.value)" >
|
||||
<option value="all" {{ ! isset($channel) ? 'selected' : '' }}>
|
||||
{{ __('admin::app.admin.system.all-channels') }}
|
||||
</option>
|
||||
|
||||
@foreach (core()->getAllChannels() as $channelModel)
|
||||
<option
|
||||
value="{{ $channelModel->id }}" {{ (isset($channel) && ($channelModel->id) == $channel) ? 'selected' : '' }}>
|
||||
{{ $channelModel->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<select class="control" id="customer-group-switcher" name="customer_group" onchange="reloadPage('customer_group', this.value)" >
|
||||
<option value="all" {{ ! isset($locale) ? 'selected' : '' }}>
|
||||
{{ __('admin::app.admin.system.all-customer-groups') }}
|
||||
</option>
|
||||
|
||||
@foreach (core()->getAllCustomerGroups() as $customerGroupModel)
|
||||
<option
|
||||
value="{{ $customerGroupModel->id }}" {{ (isset($customerGroupModel) && ($customerGroupModel->id) == $customer_group) ? 'selected' : '' }}>
|
||||
{{ $customerGroupModel->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('admin.cart-rules.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.promotions.cart-rules.add-title') }}
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@
|
|||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" @click="redirectBack('{{ url('/admin/dashboard') }}')"></i>
|
||||
<i class="icon angle-left-icon back-link"
|
||||
onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.promotions.catalog-rules.add-title') }}
|
||||
</h1>
|
||||
|
|
@ -56,7 +57,7 @@
|
|||
|
||||
<div class="control-group">
|
||||
<label for="status">{{ __('admin::app.promotions.catalog-rules.status') }}</label>
|
||||
|
||||
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="status" name="status" value="1" {{ old('status') ? 'checked' : '' }}>
|
||||
<span class="slider round"></span>
|
||||
|
|
@ -345,7 +346,7 @@
|
|||
|
||||
attribute_type_indexes: {
|
||||
'product': 0
|
||||
},
|
||||
},
|
||||
|
||||
condition_operators: {
|
||||
'price': [{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@
|
|||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" @click="redirectBack('{{ url('/admin/dashboard') }}')"></i>
|
||||
<i class="icon angle-left-icon back-link"
|
||||
onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.promotions.catalog-rules.edit-title') }}
|
||||
</h1>
|
||||
|
|
@ -56,7 +57,7 @@
|
|||
|
||||
<div class="control-group">
|
||||
<label for="status">{{ __('admin::app.promotions.catalog-rules.status') }}</label>
|
||||
|
||||
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="status" name="status" value="{{ $catalogRule->status }}" {{ $catalogRule->status ? 'checked' : '' }}>
|
||||
<span class="slider round"></span>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.sales.invoices.add-title') }}
|
||||
</h1>
|
||||
|
|
@ -181,21 +181,21 @@
|
|||
|
||||
<div class="section-content">
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.shipping-method') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
<span class="value">
|
||||
{{ $order->shipping_title }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.shipping-price') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
<span class="value">
|
||||
{{ core()->formatBasePrice($order->base_shipping_amount) }}
|
||||
</span>
|
||||
</div>
|
||||
|
|
@ -230,7 +230,7 @@
|
|||
|
||||
@if (isset($item->additional['attributes']))
|
||||
<div class="item-options">
|
||||
|
||||
|
||||
@foreach ($item->additional['attributes'] as $attribute)
|
||||
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -13,10 +13,7 @@
|
|||
|
||||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
<i class="export-icon"></i> <span>{{ __('admin::app.export.export') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@extends('admin::layouts.master')
|
||||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }}
|
||||
@stop
|
||||
|
||||
@section('content-wrapper')
|
||||
@section('content')
|
||||
|
||||
<?php $order = $invoice->order; ?>
|
||||
|
||||
|
|
@ -14,12 +14,19 @@
|
|||
<h1>
|
||||
{!! view_render_event('sales.invoice.title.before', ['order' => $order]) !!}
|
||||
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
|
||||
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
{{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }}
|
||||
|
||||
{!! view_render_event('sales.invoice.title.after', ['order' => $order]) !!}
|
||||
</h1>
|
||||
|
||||
@if($invoice->state == 'paid')
|
||||
<small><span class="badge badge-md badge-success">{{ __('admin::app.sales.orders.invoice-status-paid') }}</span></small>
|
||||
@elseif($invoice->state == 'pending')
|
||||
<span class="badge badge-md badge-warning">{{ __('admin::app.sales.orders.invoice-status-pending') }}</span>
|
||||
@else
|
||||
<span class="badge badge-md badge-danger">{{ __('admin::app.sales.orders.invoice-status-overdue') }}</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
|
|
@ -29,6 +36,10 @@
|
|||
{{ __('admin::app.sales.invoices.print') }}
|
||||
</a>
|
||||
|
||||
@if($invoice->state == "pending" || $invoice->state == "overdue")
|
||||
<a href="#" id="ChangeStatus" class="btn btn-lg btn-primary" @click="showModal('changeInvoiceState')">{{ __('admin::app.sales.orders.invoices-change-title') }}</a>
|
||||
@endif
|
||||
|
||||
{!! view_render_event('sales.invoice.page_action.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -37,7 +48,7 @@
|
|||
<div class="sale-container">
|
||||
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.order-and-account') }}'" :active="true">
|
||||
<div slot="body">
|
||||
<div slot="body" style="display: flex; overflow:auto;">
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
|
|
@ -46,10 +57,7 @@
|
|||
|
||||
<div class="section-content">
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.invoices.order-id') }}
|
||||
</span>
|
||||
|
||||
<span class="title">{{ __('admin::app.sales.invoices.order-id') }}</span>
|
||||
<span class="value">
|
||||
<a href="{{ route('admin.sales.orders.view', $order->id) }}">#{{ $order->increment_id }}</a>
|
||||
</span>
|
||||
|
|
@ -58,69 +66,55 @@
|
|||
{!! view_render_event('sales.invoice.increment_id.after', ['order' => $order]) !!}
|
||||
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.order-date') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $order->created_at }}
|
||||
</span>
|
||||
<span class="title">{{ __('admin::app.sales.orders.order-date') }}</span>
|
||||
<span class="value">{{ $order->created_at }}</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.created_at.after', ['order' => $order]) !!}
|
||||
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.order-status') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $order->status_label }}
|
||||
</span>
|
||||
<span class="title">{{ __('admin::app.sales.orders.order-status') }}</span>
|
||||
<span class="value">{{ $order->status_label }}</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.status_label.after', ['order' => $order]) !!}
|
||||
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.channel') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $order->channel_name }}
|
||||
</span>
|
||||
<span class="title">{{ __('admin::app.sales.orders.channel') }}</span>
|
||||
<span class="value">{{ $order->channel_name }}</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.channel_name.after', ['order' => $order]) !!}
|
||||
|
||||
<div class="row">
|
||||
<span class="title">{{ __('admin::app.sales.orders.payment-method') }}</span>
|
||||
<span class="value">{{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="title">{{ __('admin::app.sales.orders.shipping-method') }}</span>
|
||||
<span class="value">{{ $order->shipping_title }}</span>
|
||||
</div>
|
||||
{!! view_render_event('sales.invoice.shipping-method.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="sale-section" style="margin: 0 0 0 300px;">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.account-info') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.customer-name') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $invoice->address->name }}
|
||||
</span>
|
||||
<span class="title">{{ __('admin::app.sales.orders.customer-name') }}</span>
|
||||
<span class="value">{{ $invoice->address->name }}</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.customer_name.after', ['order' => $order]) !!}
|
||||
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.email') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $invoice->address->email }}
|
||||
</span>
|
||||
<span class="title">{{ __('admin::app.sales.orders.email') }}</span>
|
||||
<span class="value">{{ $invoice->address->email }}</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.customer_email.after', ['order' => $order]) !!}
|
||||
|
|
@ -131,14 +125,14 @@
|
|||
</accordian>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.address') }}'" :active="true">
|
||||
<div slot="body">
|
||||
<div slot="body" style="display: flex; overflow:auto;">
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<div class="secton-title" style="width: 380px;">
|
||||
<span>{{ __('admin::app.sales.orders.billing-address') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<div class="section-content" style="width: 380px;">
|
||||
@include ('admin::sales.address', ['address' => $order->billing_address])
|
||||
|
||||
{!! view_render_event('sales.invoice.billing_address.after', ['order' => $order]) !!}
|
||||
|
|
@ -146,86 +140,18 @@
|
|||
</div>
|
||||
|
||||
@if ($order->shipping_address)
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<div class="sale-section" style="margin: 0 0 0 300px;">
|
||||
<div class="secton-title" style="width: 400px;">
|
||||
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<div class="section-content" style="width: 400px;">
|
||||
@include ('admin::sales.address', ['address' => $order->shipping_address])
|
||||
|
||||
{!! view_render_event('sales.invoice.shipping_address.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.payment-and-shipping') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.payment-info') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.payment-method') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.currency') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $order->order_currency_code }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.payment-method.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($order->shipping_address)
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.shipping-info') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.shipping-method') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $order->shipping_title }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.shipping-price') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ core()->formatBasePrice($order->base_shipping_amount) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.shipping-method.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
|
|
@ -254,9 +180,7 @@
|
|||
@foreach ($invoice->items as $item)
|
||||
<tr>
|
||||
<td>{{ $item->getTypeInstance()->getOrderedItem($item)->sku }}</td>
|
||||
|
||||
<td>
|
||||
{{ $item->name }}
|
||||
<td>{{ $item->name }}
|
||||
|
||||
@if (isset($item->additional['attributes']))
|
||||
<div class="item-options">
|
||||
|
|
@ -264,19 +188,14 @@
|
|||
@foreach ($item->additional['attributes'] as $attribute)
|
||||
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>{{ core()->formatBasePrice($item->base_price) }}</td>
|
||||
|
||||
<td>{{ $item->qty }}</td>
|
||||
|
||||
<td>{{ core()->formatBasePrice($item->base_total) }}</td>
|
||||
|
||||
<td>{{ core()->formatBasePrice($item->base_tax_amount) }}</td>
|
||||
|
||||
@if ($invoice->base_discount_amount > 0)
|
||||
<td>{{ core()->formatBasePrice($item->base_discount_amount) }}</td>
|
||||
@endif
|
||||
|
|
@ -284,7 +203,6 @@
|
|||
<td>{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount - $item->base_discount_amount) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -322,12 +240,61 @@
|
|||
<td>{{ core()->formatBasePrice($invoice->base_grand_total) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@stop
|
||||
</div>
|
||||
|
||||
<modal id="changeInvoiceState" :is-open="modalIds.changeInvoiceState">
|
||||
<h3 slot="header">{{ __('admin::app.sales.orders.invoices-change-title') }}</h3>
|
||||
<div slot="body">
|
||||
<option-wrapper></option-wrapper>
|
||||
</div>
|
||||
</modal>
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/x-template" id="options-template">
|
||||
<form method="POST" action="{{ route('admin.sales.invoices.update.state', $invoice->id) }}">
|
||||
<div class="page-content">
|
||||
<p>Please select the new invoice state:</p>
|
||||
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
<div>
|
||||
<input type="radio" name="state" id="paid" value="paid">
|
||||
<label for="paid">{{ __('admin::app.sales.orders.invoice-status-paid') }}</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="radio" name="state" id="pending" value="pending" @if($invoice->state == "pending") checked @endif>
|
||||
<label for="pending">{{ __('admin::app.sales.orders.invoice-status-pending') }}</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="radio" name="state" id="overdue" value="overdue" @if($invoice->state == "overdue") checked @endif>
|
||||
<label for="overdue">{{ __('admin::app.sales.orders.invoice-status-overdue') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<button type="submit" class="btn btn-md btn-primary">{{ __('admin::app.sales.orders.invoice-status-update')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
Vue.component('option-wrapper', {
|
||||
template: '#options-template',
|
||||
|
||||
methods: {
|
||||
onSubmit: function(e) {
|
||||
// e.target.submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<h1>
|
||||
{!! view_render_event('sales.order.title.before', ['order' => $order]) !!}
|
||||
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.sales.orders.view-title', ['order_id' => $order->increment_id]) }}
|
||||
|
||||
|
|
@ -157,37 +157,41 @@
|
|||
</div>
|
||||
</accordian>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.address') }}'" :active="true">
|
||||
<div slot="body">
|
||||
@if ($order->billing_address || $order->shipping_address)
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.address') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.billing-address') }}</span>
|
||||
</div>
|
||||
@if($order->billing_address)
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.billing-address') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
@include ('admin::sales.address', ['address' => $order->billing_address])
|
||||
<div class="section-content">
|
||||
@include ('admin::sales.address', ['address' => $order->billing_address])
|
||||
|
||||
{!! view_render_event('sales.order.billing_address.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($order->shipping_address)
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
@include ('admin::sales.address', ['address' => $order->shipping_address])
|
||||
|
||||
{!! view_render_event('sales.order.shipping_address.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{!! view_render_event('sales.order.billing_address.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($order->shipping_address)
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
@include ('admin::sales.address', ['address' => $order->shipping_address])
|
||||
|
||||
{!! view_render_event('sales.order.shipping_address.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
</accordian>
|
||||
@endif
|
||||
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.payment-and-shipping') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
|
@ -470,7 +474,15 @@
|
|||
<td>{{ $invoice->created_at }}</td>
|
||||
<td>#{{ $invoice->order->increment_id }}</td>
|
||||
<td>{{ $invoice->address->name }}</td>
|
||||
<td>{{ $invoice->status_label }}</td>
|
||||
<td>
|
||||
@if($invoice->state == "paid")
|
||||
{{ __('admin::app.sales.orders.invoice-status-paid') }}
|
||||
@elseif($invoice->state == "overdue")
|
||||
{{ __('admin::app.sales.orders.invoice-status-overdue') }}
|
||||
@else
|
||||
{{ __('admin::app.sales.orders.invoice-status-pending') }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ core()->formatBasePrice($invoice->base_grand_total) }}</td>
|
||||
<td class="action">
|
||||
<a href="{{ route('admin.sales.invoices.view', $invoice->id) }}">
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.sales.refunds.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.sales.refunds.view-title', ['refund_id' => $refund->id]) }}
|
||||
</h1>
|
||||
|
|
@ -107,37 +107,41 @@
|
|||
</div>
|
||||
</accordian>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.address') }}'" :active="true">
|
||||
<div slot="body">
|
||||
@if ($order->billing_address || $order->shipping_address)
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.address') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.billing-address') }}</span>
|
||||
</div>
|
||||
@if ($order->billing_address)
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.billing-address') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<div class="section-content">
|
||||
|
||||
@include ('admin::sales.address', ['address' => $order->billing_address])
|
||||
@include ('admin::sales.address', ['address' => $order->billing_address])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($order->shipping_address)
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
|
||||
@include ('admin::sales.address', ['address' => $order->shipping_address])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($order->shipping_address)
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
|
||||
@include ('admin::sales.address', ['address' => $order->shipping_address])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
</accordian>
|
||||
@endif
|
||||
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.payment-and-shipping') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
|
@ -229,7 +233,7 @@
|
|||
|
||||
@if (isset($item->additional['attributes']))
|
||||
<div class="item-options">
|
||||
|
||||
|
||||
@foreach ($item->additional['attributes'] as $attribute)
|
||||
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.sales.shipments.add-title') }}
|
||||
</h1>
|
||||
|
|
@ -274,7 +274,7 @@
|
|||
|
||||
@if (isset($item->additional['attributes']))
|
||||
<div class="item-options">
|
||||
|
||||
|
||||
@foreach ($item->additional['attributes'] as $attribute)
|
||||
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
|
||||
@endforeach
|
||||
|
|
@ -321,7 +321,7 @@
|
|||
<div class="control-group" :class="[errors.has('{{ $inputName }}') ? 'has-error' : '']">
|
||||
|
||||
<input type="text" v-validate="'required|numeric|min_value:0|max_value:{{$sourceQty}}'" class="control" id="{{ $inputName }}" name="{{ $inputName }}" value="{{ $item->qty_invoiced }}" data-vv-as=""{{ __('admin::app.sales.shipments.qty-to-ship') }}"" :disabled="source != '{{ $inventorySource->id }}'"/>
|
||||
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $inputName }}')">
|
||||
@verbatim
|
||||
{{ errors.first('<?php echo $inputName; ?>') }}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.sales.shipments.view-title', ['shipment_id' => $shipment->id]) }}
|
||||
</h1>
|
||||
|
|
@ -254,7 +254,7 @@
|
|||
|
||||
@if (isset($item->additional['attributes']))
|
||||
<div class="item-options">
|
||||
|
||||
|
||||
@foreach ($item->additional['attributes'] as $attribute)
|
||||
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.channels.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.channels.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.currencies.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.currencies.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.exchange_rates.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.exchange_rates.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.inventory_sources.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.inventory_sources.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.locales.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.locales.edit-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.sliders.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.sliders.edit-title') }}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,41 +14,6 @@
|
|||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.settings.sliders.title') }}</h1>
|
||||
|
||||
<div class="control-group">
|
||||
<select class="control" id="channel-switcher" name="channel" onchange="reloadPage('channel', this.value)" >
|
||||
<option value="all" {{ ! isset($channel) ? 'selected' : '' }}>
|
||||
{{ __('admin::app.admin.system.all-channels') }}
|
||||
</option>
|
||||
|
||||
@foreach (core()->getAllChannels() as $channelModel)
|
||||
|
||||
<option
|
||||
value="{{ $channelModel->code }}" {{ (isset($channel) && ($channelModel->code) == $channel) ? 'selected' : '' }}>
|
||||
{{ $channelModel->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<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' : '' }}>
|
||||
{{ $localeModel->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.tax-categories.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.tax-categories.edit.title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.tax-rates.add-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.settings.tax-rates.edit.title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.users.roles.add-role-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.users.roles.edit-role-title') }}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.users.users.add-user-title') }}
|
||||
</h1>
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
<div class="control-group">
|
||||
<label for="status">{{ __('admin::app.users.users.status') }}</label>
|
||||
|
||||
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="status" name="status" value="1" {{ old('status') ? 'checked' : '' }}>
|
||||
<span class="slider round"></span>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.users.users.edit-user-title') }}
|
||||
</h1>
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
|
||||
<div class="control-group">
|
||||
<label for="status">{{ __('admin::app.users.users.status') }}</label>
|
||||
|
||||
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="status" name="status" value="{{ $user->status }}" {{ $user->status ? 'checked' : '' }}>
|
||||
<span class="slider round"></span>
|
||||
|
|
|
|||
|
|
@ -159,8 +159,6 @@ class AttributeController extends Controller
|
|||
$suppressFlash = true;
|
||||
|
||||
$this->attributeRepository->delete($value);
|
||||
} else {
|
||||
session()->flash('error', trans('admin::app.response.user-define-error', ['name' => 'Attribute']));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -174,7 +172,7 @@ class AttributeController extends Controller
|
|||
if ($suppressFlash) {
|
||||
session()->flash('success', trans('admin::app.datagrid.mass-ops.delete-success', ['resource' => 'attributes']));
|
||||
} else {
|
||||
session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'attributes']));
|
||||
session()->flash('error', trans('admin::app.response.user-define-error', ['name' => 'Attribute']));
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class AttributeOption extends TranslatableModel implements AttributeOptionContra
|
|||
public function swatch_value_url()
|
||||
{
|
||||
if ($this->swatch_value && $this->attribute->swatch_type == 'image') {
|
||||
return Storage::url($this->swatch_value);
|
||||
return url('cache/small/'.$this->swatch_value);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "bagisto/laravel-booking-product",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jitendra Singh",
|
||||
"email": "jitendra@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"bagisto/laravel-core": "dev-master",
|
||||
"bagisto/laravel-rule": "dev-master",
|
||||
"bagisto/laravel-sales": "dev-master",
|
||||
"bagisto/laravel-product": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\BookingProduct\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\BookingProduct\\Providers\\BookingProductServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -2,16 +2,14 @@
|
|||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Faker\Generator as Faker;
|
||||
use Webkul\BookingProduct\Models\BookingProduct;
|
||||
use Webkul\BookingProduct\Models\BookingProductEventTicket;
|
||||
use Webkul\Product\Models\Product;
|
||||
|
||||
$factory->define(BookingProductEventTicket::class, function (Faker $faker, array $attributes) {
|
||||
$factory->define(BookingProductEventTicket::class, static function (Faker $faker, array $attributes) {
|
||||
return [
|
||||
'price' => $faker->randomFloat(4, 3, 900),
|
||||
'qty' => $faker->numberBetween(1, 99),
|
||||
'qty' => $faker->numberBetween(100, 1000),
|
||||
'booking_product_id' => static function () {
|
||||
return factory(BookingProduct::class)->create(['type' => 'event'])->id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Webkul\BookingProduct\Repositories;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
|
|
@ -18,12 +19,16 @@ class BookingProductEventTicketRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
* @param array $data
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
*
|
||||
* @return void
|
||||
* @throws \Prettus\Validator\Exceptions\ValidatorException
|
||||
*/
|
||||
public function saveEventTickets($data, $bookingProduct)
|
||||
public function saveEventTickets($data, $bookingProduct): void
|
||||
{
|
||||
Event::dispatch('booking_product.booking.event-ticket.save.before', ['data' => $data, 'bookingProduct' => $bookingProduct]);
|
||||
|
||||
$previousTicketIds = $bookingProduct->event_tickets()->pluck('id');
|
||||
|
||||
if (isset($data['tickets'])) {
|
||||
|
|
@ -54,7 +59,7 @@ class BookingProductEventTicketRepository extends Repository
|
|||
}
|
||||
|
||||
if (Str::contains($ticketId, 'ticket_')) {
|
||||
$this->create(array_merge([
|
||||
$ticket = $this->create(array_merge([
|
||||
'booking_product_id' => $bookingProduct->id,
|
||||
], $ticketInputs));
|
||||
} else {
|
||||
|
|
@ -62,13 +67,18 @@ class BookingProductEventTicketRepository extends Repository
|
|||
$previousTicketIds->forget($index);
|
||||
}
|
||||
|
||||
$this->update($ticketInputs, $ticketId);
|
||||
$ticket = $this->update($ticketInputs, $ticketId);
|
||||
}
|
||||
|
||||
$savedTickets[$ticketId]['ticket'] = $ticket;
|
||||
$savedTickets[$ticketId]['ticketInputs'] = $ticketInputs;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($previousTicketIds as $previousTicketId) {
|
||||
$this->delete($previousTicketId);
|
||||
}
|
||||
|
||||
Event::dispatch('booking_product.booking.event-ticket.save.after', ['tickets' => $savedTickets]);
|
||||
}
|
||||
}
|
||||
|
|
@ -195,13 +195,13 @@ class Booking extends Virtual
|
|||
continue;
|
||||
}
|
||||
|
||||
$cartProducts = parent::prepareForCart([
|
||||
$cartProducts = parent::prepareForCart(array_merge($data, [
|
||||
'product_id' => $data['product_id'],
|
||||
'quantity' => $qty,
|
||||
'booking' => [
|
||||
'ticket_id' => $ticketId,
|
||||
],
|
||||
]);
|
||||
]));
|
||||
|
||||
if (is_string($cartProducts)) {
|
||||
return $cartProducts;
|
||||
|
|
@ -272,4 +272,4 @@ class Booking extends Virtual
|
|||
|
||||
return app($this->bookingHelper->getTypeHepler($bookingProduct->type))->validateCartItem($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "bagisto/laravel-cart-rule",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jitendra Singh",
|
||||
"email": "jitendra@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"bagisto/laravel-core": "dev-master",
|
||||
"bagisto/laravel-rule": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\CartRule\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\CartRule\\Providers\\CartRuleServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
namespace Webkul\CartRule\Helpers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Webkul\CartRule\Repositories\CartRuleRepository;
|
||||
use Webkul\CartRule\Repositories\CartRuleCouponRepository;
|
||||
use Webkul\CartRule\Repositories\CartRuleCouponUsageRepository;
|
||||
|
|
@ -144,7 +145,7 @@ class CartRule
|
|||
if ($staticCartRules::$cartID === cart()->getCart()->id && $staticCartRules::$cartRules) {
|
||||
return $staticCartRules::$cartRules;
|
||||
}
|
||||
|
||||
|
||||
$staticCartRules::$cartID = cart()->getCart()->id;
|
||||
|
||||
$customerGroupId = null;
|
||||
|
|
@ -157,21 +158,7 @@ class CartRule
|
|||
}
|
||||
}
|
||||
|
||||
$cartRules = $this->cartRuleRepository->scopeQuery(function ($query) use ($customerGroupId) {
|
||||
return $query->leftJoin('cart_rule_customer_groups', 'cart_rules.id', '=', 'cart_rule_customer_groups.cart_rule_id')
|
||||
->leftJoin('cart_rule_channels', 'cart_rules.id', '=', 'cart_rule_channels.cart_rule_id')
|
||||
->where('cart_rule_customer_groups.customer_group_id', $customerGroupId)
|
||||
->where('cart_rule_channels.channel_id', core()->getCurrentChannel()->id)
|
||||
->where(function ($query1) {
|
||||
$query1->where('cart_rules.starts_from', '<=', Carbon::now()->format('Y-m-d'))
|
||||
->orWhereNull('cart_rules.starts_from');
|
||||
})
|
||||
->where(function ($query2) {
|
||||
$query2->where('cart_rules.ends_till', '>=', Carbon::now()->format('Y-m-d'))
|
||||
->orWhereNull('cart_rules.ends_till');
|
||||
})
|
||||
->orderBy('sort_order', 'asc');
|
||||
})->findWhere(['status' => 1]);
|
||||
$cartRules = $this->getCartRuleQuery($customerGroupId, core()->getCurrentChannel()->id);
|
||||
|
||||
$staticCartRules::$cartRules = $cartRules;
|
||||
return $cartRules;
|
||||
|
|
@ -180,21 +167,21 @@ class CartRule
|
|||
/**
|
||||
* Check if cart rule can be applied
|
||||
*
|
||||
* @param \Webkul\CartRule\Contracts\CartRule $rule
|
||||
* @param $cart
|
||||
* @param \Webkul\CartRule\Contracts\CartRule $rule
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canProcessRule($rule): bool
|
||||
public function canProcessRule($cart, $rule): bool
|
||||
{
|
||||
$cart = Cart::getCart();
|
||||
|
||||
if ($rule->coupon_type) {
|
||||
if (strlen($cart->coupon_code)) {
|
||||
$coupon = $this->cartRuleCouponRepository->findOneWhere([
|
||||
'cart_rule_id' => $rule->id,
|
||||
'code' => $cart->coupon_code,
|
||||
]);
|
||||
/** @var \Webkul\CartRule\Models\CartRule $rule */
|
||||
// Laravel relation is used instead of repository for performance
|
||||
// reasons (cart_rule_coupon-relation is pre-loaded by self::getCartRuleQuery())
|
||||
$coupon = $rule->cart_rule_coupon->where('code', $cart->coupon_code)->first();
|
||||
|
||||
if ($coupon) {
|
||||
if ($coupon && $coupon->code === $cart->coupon_code) {
|
||||
if ($coupon->usage_limit && $coupon->times_used >= $coupon->usage_limit) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -245,8 +232,10 @@ class CartRule
|
|||
|
||||
$appliedRuleIds = [];
|
||||
|
||||
foreach ($this->getCartRules() as $rule) {
|
||||
if (! $this->canProcessRule($rule)) {
|
||||
$cart = Cart::getCart();
|
||||
|
||||
foreach ($rules = $this->getCartRules() as $rule) {
|
||||
if (! $this->canProcessRule($cart, $rule)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -368,8 +357,10 @@ class CartRule
|
|||
|
||||
$appliedRuleIds = [];
|
||||
|
||||
$cart = Cart::getCart();
|
||||
|
||||
foreach ($this->getCartRules() as $rule) {
|
||||
if (! $this->canProcessRule($rule)) {
|
||||
if (! $this->canProcessRule($cart, $rule)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -450,29 +441,36 @@ class CartRule
|
|||
|
||||
$appliedRuleIds = [];
|
||||
|
||||
foreach ($this->getCartRules() as $rule) {
|
||||
if (! $this->canProcessRule($rule)) {
|
||||
continue;
|
||||
}
|
||||
$cart = Cart::getCart();
|
||||
|
||||
if (! $this->validator->validate($rule, $cart)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($cart->items->all() as $item) {
|
||||
|
||||
if (! $rule || ! $rule->free_shipping) {
|
||||
continue;
|
||||
}
|
||||
foreach ($this->getCartRules() as $rule) {
|
||||
|
||||
$selectedShipping->price = 0;
|
||||
if (! $this->canProcessRule($cart, $rule)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$selectedShipping->base_price = 0;
|
||||
/* given CartItem instance to the validator */
|
||||
if (! $this->validator->validate($rule, $item)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$selectedShipping->save();
|
||||
if (! $rule || ! $rule->free_shipping) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$appliedRuleIds[$rule->id] = $rule->id;
|
||||
$selectedShipping->price = 0;
|
||||
|
||||
if ($rule->end_other_rules) {
|
||||
break;
|
||||
$selectedShipping->base_price = 0;
|
||||
|
||||
$selectedShipping->save();
|
||||
|
||||
$appliedRuleIds[$rule->id] = $rule->id;
|
||||
|
||||
if ($rule->end_other_rules) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -495,12 +493,14 @@ class CartRule
|
|||
*/
|
||||
public function calculateCartItemTotals($items)
|
||||
{
|
||||
$cart = Cart::getCart();
|
||||
|
||||
foreach ($this->getCartRules() as $rule) {
|
||||
if ($rule->action_type == 'cart_fixed') {
|
||||
$totalPrice = $totalBasePrice = $validCount = 0;
|
||||
|
||||
foreach ($items as $item) {
|
||||
if (! $this->canProcessRule($rule, $item)) {
|
||||
if (! $this->canProcessRule($cart, $rule)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -564,4 +564,38 @@ class CartRule
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $customerGroupId
|
||||
* @param $channelId
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
public function getCartRuleQuery($customerGroupId, $channelId): \Illuminate\Database\Eloquent\Collection
|
||||
{
|
||||
return $this->cartRuleRepository->scopeQuery(function ($query) use ($customerGroupId) {
|
||||
/** @var Builder $query */
|
||||
return $query->leftJoin('cart_rule_customer_groups', 'cart_rules.id', '=',
|
||||
'cart_rule_customer_groups.cart_rule_id')
|
||||
->leftJoin('cart_rule_channels', 'cart_rules.id', '=', 'cart_rule_channels.cart_rule_id')
|
||||
->where('cart_rule_customer_groups.customer_group_id', $customerGroupId)
|
||||
->where('cart_rule_channels.channel_id', core()->getCurrentChannel()->id)
|
||||
->where(function ($query1) {
|
||||
/** @var Builder $query1 */
|
||||
$query1->where('cart_rules.starts_from', '<=', Carbon::now()->format('Y-m-d'))
|
||||
->orWhereNull('cart_rules.starts_from');
|
||||
})
|
||||
->where(function ($query2) {
|
||||
/** @var Builder $query2 */
|
||||
$query2->where('cart_rules.ends_till', '>=', Carbon::now()->format('Y-m-d'))
|
||||
->orWhereNull('cart_rules.ends_till');
|
||||
})
|
||||
->with([
|
||||
'cart_rule_customer_groups',
|
||||
'cart_rule_channels',
|
||||
'cart_rule_coupon'
|
||||
])
|
||||
->orderBy('sort_order', 'asc');
|
||||
})->findWhere(['status' => 1]);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,13 +2,11 @@
|
|||
|
||||
namespace Webkul\CartRule\Models;
|
||||
|
||||
// use Webkul\Core\Eloquent\TranslatableModel;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\CartRule\Contracts\CartRule as CartRuleContract;
|
||||
use Webkul\Core\Models\ChannelProxy;
|
||||
use Webkul\Customer\Models\CustomerGroupProxy;
|
||||
|
||||
// class CartRule extends TranslatableModel implements CartRuleContract
|
||||
class CartRule extends Model implements CartRuleContract
|
||||
{
|
||||
protected $fillable = [
|
||||
|
|
@ -40,42 +38,80 @@ class CartRule extends Model implements CartRuleContract
|
|||
'conditions' => 'array',
|
||||
];
|
||||
|
||||
// public $translatedAttributes = ['name'];
|
||||
|
||||
/**
|
||||
* Get the channels that owns the cart rule.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function channels()
|
||||
public function cart_rule_channels(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(ChannelProxy::modelClass(), 'cart_rule_channels');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the customer groups that owns the cart rule.
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*
|
||||
* @deprecated laravel standard should be used
|
||||
*/
|
||||
public function customer_groups()
|
||||
public function channels(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->cart_rule_channels();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the customer groups that owns the cart rule.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function cart_rule_customer_groups(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(CustomerGroupProxy::modelClass(), 'cart_rule_customer_groups');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the coupons that owns the cart rule.
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*
|
||||
* @deprecated laravel standard should be used
|
||||
*/
|
||||
public function coupons()
|
||||
public function customer_groups(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->cart_rule_customer_groups();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the coupons that owns the cart rule.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function cart_rule_coupon(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
{
|
||||
return $this->hasOne(CartRuleCouponProxy::modelClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get primary coupon code for cart rule.
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*
|
||||
* @deprecated laravel standard should be used
|
||||
*/
|
||||
public function coupon_code()
|
||||
public function coupons(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
{
|
||||
return $this->coupons()->where('is_primary', 1);
|
||||
return $this->cart_rule_coupon();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get primary coupon code for cart rule.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function coupon_code(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
{
|
||||
return $this->cart_rule_coupon()->where('is_primary', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get primary coupon code for cart rule.
|
||||
*
|
||||
* @return string|void
|
||||
*/
|
||||
public function getCouponCodeAttribute()
|
||||
{
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue