commit
b2a63c05cd
|
|
@ -150,22 +150,22 @@ class AttributeDataGrid
|
|||
'type' => 'string',
|
||||
'label' => 'Type',
|
||||
], [
|
||||
'name' => 'is_required',
|
||||
'column' => 'is_required',
|
||||
'alias' => 'attributeIsRequired',
|
||||
'type' => 'boolean',
|
||||
'label' => 'Required',
|
||||
], [
|
||||
'name' => 'is_unique',
|
||||
'column' => 'is_unique',
|
||||
'alias' => 'attributeIsUnique',
|
||||
'type' => 'boolean',
|
||||
'label' => 'Unique',
|
||||
], [
|
||||
'name' => 'value_per_locale',
|
||||
'column' => 'value_per_locale',
|
||||
'alias' => 'attributeValuePerLocale',
|
||||
'type' => 'boolean',
|
||||
'label' => 'Locale based',
|
||||
], [
|
||||
'name' => 'value_per_channel',
|
||||
'column' => 'value_per_channel',
|
||||
'alias' => 'attributeValuePerChannel',
|
||||
'type' => 'boolean',
|
||||
'label' => 'Channel based',
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class ProductDataGrid
|
|||
'type' => 'string',
|
||||
'label' => 'Product Quantity',
|
||||
'sortable' => true,
|
||||
],
|
||||
]
|
||||
],
|
||||
|
||||
'filterable' => [
|
||||
|
|
@ -149,7 +149,7 @@ class ProductDataGrid
|
|||
'type' => 'string',
|
||||
'label' => 'Product Type',
|
||||
], [
|
||||
'name' => 'prods.status',
|
||||
'column' => 'prods.status',
|
||||
'alias' => 'ProductStatus',
|
||||
'type' => 'boolean',
|
||||
'label' => 'Status'
|
||||
|
|
|
|||
|
|
@ -324,6 +324,10 @@ Route::group(['middleware' => ['web']], function () {
|
|||
//delete backend user
|
||||
Route::get('/users/delete/{id}', 'Webkul\User\Http\Controllers\UserController@destroy')->name('admin.users.delete');
|
||||
|
||||
Route::post('/confirm/destroy', 'Webkul\User\Http\Controllers\UserController@destroySelf')->defaults('_config', [
|
||||
'redirect' => 'admin.users.index'
|
||||
])->name('admin.users.confirm.destroy');
|
||||
|
||||
// User Role Routes
|
||||
Route::get('/roles', 'Webkul\User\Http\Controllers\RoleController@index')->defaults('_config', [
|
||||
'view' => 'admin::users.roles.index'
|
||||
|
|
|
|||
|
|
@ -73,24 +73,29 @@ class Product {
|
|||
|
||||
$variants = [];
|
||||
|
||||
$this->productGrid->create($gridObject);
|
||||
$found = $this->productGrid->findOneByField('product_id', $product->id);
|
||||
|
||||
if($product->type == 'configurable') {
|
||||
$variants = $product->variants()->get();
|
||||
//extra measure to stop duplicate entries
|
||||
if($found == null) {
|
||||
$this->productGrid->create($gridObject);
|
||||
|
||||
foreach($variants as $variant) {
|
||||
$variantObj = [
|
||||
'product_id' => $variant->id,
|
||||
'sku' => $variant->sku,
|
||||
'type' => $variant->type,
|
||||
'attribute_family_name' => $variant->toArray()['attribute_family']['name'],
|
||||
'name' => $variant->name,
|
||||
'quantity' => 0,
|
||||
'status' => $variant->status,
|
||||
'price' => $variant->price,
|
||||
];
|
||||
if($product->type == 'configurable') {
|
||||
$variants = $product->variants()->get();
|
||||
|
||||
$this->productGrid->create($variantObj);
|
||||
foreach($variants as $variant) {
|
||||
$variantObj = [
|
||||
'product_id' => $variant->id,
|
||||
'sku' => $variant->sku,
|
||||
'type' => $variant->type,
|
||||
'attribute_family_name' => $variant->toArray()['attribute_family']['name'],
|
||||
'name' => $variant->name,
|
||||
'quantity' => 0,
|
||||
'status' => $variant->status,
|
||||
'price' => $variant->price,
|
||||
];
|
||||
|
||||
$this->productGrid->create($variantObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -268,6 +273,13 @@ class Product {
|
|||
|
||||
$gridObject = [];
|
||||
}
|
||||
|
||||
$this->findRepeated();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function findRepeated() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -50,6 +50,7 @@ return [
|
|||
'change-password' => 'Change Account Password',
|
||||
'current-password' => 'Current Password'
|
||||
],
|
||||
|
||||
'users' => [
|
||||
'forget-password' => [
|
||||
'title' => 'Forget Password',
|
||||
|
|
@ -60,6 +61,7 @@ return [
|
|||
'back-link-title' => 'Back to Sign In',
|
||||
'submit-btn-title' => 'Email Password Reset Link'
|
||||
],
|
||||
|
||||
'reset-password' => [
|
||||
'title' => 'Reset Password',
|
||||
'title' => 'Reset Password',
|
||||
|
|
@ -69,6 +71,7 @@ return [
|
|||
'back-link-title' => 'Back to Sign In',
|
||||
'submit-btn-title' => 'Reset Password'
|
||||
],
|
||||
|
||||
'roles' => [
|
||||
'title' => 'Roles',
|
||||
'add-role-title' => 'Add Role',
|
||||
|
|
@ -82,6 +85,7 @@ return [
|
|||
'custom' => 'Custom',
|
||||
'all' => 'All'
|
||||
],
|
||||
|
||||
'users' => [
|
||||
'title' => 'User',
|
||||
'add-user-title' => 'Add User',
|
||||
|
|
@ -95,8 +99,15 @@ return [
|
|||
'status-and-role' => 'Status and Role',
|
||||
'role' => 'Role',
|
||||
'status' => 'Status',
|
||||
'account-is-active' => 'Account is Active'
|
||||
'account-is-active' => 'Account is Active',
|
||||
'current-password' => 'Enter Current Password',
|
||||
'confirm-delete' => 'Confirm Delete This Account',
|
||||
'confirm-delete-title' => 'Confirm password before delete',
|
||||
'delete-last' => 'At least one admin is required.',
|
||||
'delete-success' => 'Success! User deleted',
|
||||
'incorrect-password' => 'The password you entered is incorrect'
|
||||
],
|
||||
|
||||
'sessions' => [
|
||||
'title' => 'Sign In',
|
||||
'email' => 'Email',
|
||||
|
|
@ -106,6 +117,7 @@ return [
|
|||
'submit-btn-title' => 'Sign In'
|
||||
]
|
||||
],
|
||||
|
||||
'sales' => [
|
||||
'orders' => [
|
||||
'title' => 'Orders',
|
||||
|
|
@ -157,6 +169,7 @@ return [
|
|||
'total-due' => 'Total Due',
|
||||
'cancel-confirm-msg' => 'Are you sure you want to cancel this order ?'
|
||||
],
|
||||
|
||||
'invoices' => [
|
||||
'title' => 'Invoices',
|
||||
'id' => 'Id',
|
||||
|
|
@ -178,6 +191,7 @@ return [
|
|||
'print' => 'Print',
|
||||
'order-date' => 'Order Date'
|
||||
],
|
||||
|
||||
'shipments' => [
|
||||
'title' => 'Shipments',
|
||||
'id' => 'Id',
|
||||
|
|
@ -196,6 +210,7 @@ return [
|
|||
'view-title' => 'Shipment #:shipment_id',
|
||||
]
|
||||
],
|
||||
|
||||
'catalog' => [
|
||||
'products' => [
|
||||
'title' => 'Products',
|
||||
|
|
@ -227,8 +242,10 @@ return [
|
|||
'add-variant-title' => 'Add Variant',
|
||||
'variant-already-exist-message' => 'Variant with same attribute options already exists.',
|
||||
'add-image-btn-title' => 'Add Image',
|
||||
'mass-delete-success' => 'All the selected index of products have been deleted successfully'
|
||||
'mass-delete-success' => 'All the selected index of products have been deleted successfully',
|
||||
'mass-update-success' => 'All the selected index of products have been updated successfully'
|
||||
],
|
||||
|
||||
'attributes' => [
|
||||
'title' => 'Attributes',
|
||||
'add-title' => 'Add Attribute',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.customers.customers.title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.users.users.confirm-delete-title') }}</h1>
|
||||
</div>
|
||||
<div class="page-action">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
<form action="{{ route('admin.users.confirm.destroy') }}" method="POST" @submit.prevent="onSubmit">
|
||||
@csrf
|
||||
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
|
||||
<label for="password" class="required">
|
||||
{{ __('admin::app.users.users.current-password') }}
|
||||
</label>
|
||||
|
||||
<input type="password" v-validate="'required'" class="control" id="password" name="password" data-vv-as=""{{ __('admin::app.users.users.password') }}""/>
|
||||
|
||||
<span class="control-error" v-if="errors.has('password')">
|
||||
@{{ errors.first('password') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-md btn-primary" value="{{ __('admin::app.users.users.confirm-delete') }}">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -30,6 +30,9 @@
|
|||
<div class="dropdown-container">
|
||||
<label>Account</label>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ route('shop.home.index') }}" target="_blank">Visit Shop</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('admin.account.edit') }}">My Account</a>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -639,9 +639,16 @@ class Cart {
|
|||
}
|
||||
}
|
||||
|
||||
$cart->customer_email = $cart->billing_address->email;
|
||||
$cart->customer_first_name = $cart->billing_address->first_name;
|
||||
$cart->customer_last_name = $cart->billing_address->last_name;
|
||||
if(auth()->guard('customer')->check()) {
|
||||
$cart->customer_email = auth()->guard('customer')->user()->email;
|
||||
$cart->customer_first_name = auth()->guard('customer')->user()->first_name;
|
||||
$cart->customer_last_name = auth()->guard('customer')->user()->last_name;
|
||||
} else {
|
||||
$cart->customer_email = $cart->billing_address->email;
|
||||
$cart->customer_first_name = $cart->billing_address->first_name;
|
||||
$cart->customer_last_name = $cart->billing_address->last_name;
|
||||
}
|
||||
|
||||
$cart->save();
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -142,7 +142,6 @@ class ProductController extends Controller
|
|||
'sku' => ['required', 'unique:products,sku', new \Webkul\Core\Contracts\Validations\Slug]
|
||||
]);
|
||||
|
||||
|
||||
//before store of the product
|
||||
Event::fire('catalog.product.create.before');
|
||||
|
||||
|
|
@ -277,7 +276,7 @@ class ProductController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
session()->flash('success', trans('admin::app.catalog.products.mass-delete-success'));
|
||||
session()->flash('success', trans('admin::app.catalog.products.mass-update-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -456,7 +456,11 @@ input {
|
|||
}
|
||||
|
||||
.product-card:hover {
|
||||
box-shadow: 1px 1px 10px #ccc;
|
||||
outline: 1px solid #eaeaec;
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
|
||||
-webkit-box-shadow: 0px 2px 16px 4px rgba(40, 44, 63, 0.07);
|
||||
-moz-box-shadow: 0px 2px 16px 4px rgba(40, 44, 63, 0.07);
|
||||
box-shadow: 0px 2px 16px 4px rgba(40, 44, 63, 0.07);
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 580px) {
|
||||
|
|
|
|||
|
|
@ -631,7 +631,6 @@ class DataGrid
|
|||
throw new \Exception('Multiple Sort keys Found, Please Resolve the URL Manually.');
|
||||
}
|
||||
} elseif ($key=="search") {
|
||||
|
||||
$count_keys = count(array_keys($value));
|
||||
if($count_keys==1)
|
||||
$this->query->where(function ($query) use ($parsed) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Event;
|
|||
use Webkul\User\Repositories\AdminRepository as Admin;
|
||||
use Webkul\User\Repositories\RoleRepository as Role;
|
||||
use Webkul\User\Http\Requests\UserForm;
|
||||
use Hash;
|
||||
|
||||
/**
|
||||
* Admin user controller
|
||||
|
|
@ -165,6 +166,10 @@ class UserController extends Controller
|
|||
} else {
|
||||
Event::fire('user.admin.delete.before', $id);
|
||||
|
||||
if (auth()->guard('admin')->user()->id == $id) {
|
||||
return view('admin::customers.confirm-password');
|
||||
}
|
||||
|
||||
$this->admin->delete($id);
|
||||
|
||||
Event::fire('user.admin.delete.after', $id);
|
||||
|
|
@ -174,4 +179,36 @@ class UserController extends Controller
|
|||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
/**
|
||||
* destroy current after confirming
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function destroySelf()
|
||||
{
|
||||
$password = request()->input('password');
|
||||
|
||||
if(Hash::check($password, auth()->guard('admin')->user()->password)) {
|
||||
if($this->admin->count() == 1) {
|
||||
session()->flash('error', trans('admin::app.users.users.delete-last'));
|
||||
} else {
|
||||
$id = auth()->guard('admin')->user()->id;
|
||||
|
||||
Event::fire('user.admin.delete.before', $id);
|
||||
|
||||
$this->admin->delete($id);
|
||||
|
||||
Event::fire('user.admin.delete.after', $id);
|
||||
|
||||
session()->flash('success', trans('admin::app.users.users.delete-success'));
|
||||
|
||||
return redirect()->route('admin.session.create');
|
||||
}
|
||||
} else {
|
||||
session()->flash('warning', trans('admin::app.users.users.incorrect-password'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue