Merge branch 'master' of https://github.com/bagisto/bagisto into development

This commit is contained in:
Prashant Singh 2019-04-30 01:50:17 +05:30
commit 7bd10c1a4a
64 changed files with 500 additions and 277 deletions

View File

@ -1,4 +1,5 @@
<?php
return [
'modules' => [
/**
@ -7,6 +8,7 @@ return [
* VendorB\ModuleY\Providers\ModuleServiceProvider::class
*
*/
\Webkul\Attribute\Providers\ModuleServiceProvider::class,
\Webkul\Category\Providers\ModuleServiceProvider::class,
\Webkul\Checkout\Providers\ModuleServiceProvider::class,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=c0d374be105e7359054c",
"/css/admin.css": "/css/admin.css?id=a71a72c31d6ac0fe375f"
"/js/admin.js": "/js/admin.js?id=d71088ad6eb332aa8de1",
"/css/admin.css": "/css/admin.css?id=a226571863dbe544b173"
}

View File

@ -21,12 +21,13 @@ class CustomerDataGrid extends DataGrid
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('customers as custs')
->addSelect('custs.id as customer_id', 'custs.email', 'cg.name')
->addSelect(DB::raw('CONCAT(custs.first_name, " ", custs.last_name) as full_name'))->leftJoin('customer_groups as cg', 'custs.customer_group_id', '=', 'cg.id');
$queryBuilder = DB::table('customers')
->leftJoin('customer_groups', 'customers.customer_group_id', '=', 'customer_groups.id')
->addSelect('customers.id as customer_id', 'customers.email', 'customer_groups.name')
->addSelect(DB::raw('CONCAT(customers.first_name, " ", customers.last_name) as full_name'));
$this->addFilter('customer_id', 'custs.id');
$this->addFilter('full_name', DB::raw('CONCAT(custs.first_name, " ", custs.last_name)'));
$this->addFilter('customer_id', 'customers.id');
$this->addFilter('full_name', DB::raw('CONCAT(customers.first_name, " ", customers.last_name)'));
$this->setQueryBuilder($queryBuilder);
}

View File

@ -20,12 +20,14 @@ class CustomerReviewDataGrid extends DataGrid
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('product_reviews as pr')
->leftjoin('products_grid as pg', 'pr.product_id', '=', 'pg.id')
->select('pr.id as product_review_id', 'pr.title', 'pr.comment', 'pg.name as product_name', 'pr.status as product_review_status');
->leftjoin('product_flat as pf', 'pr.product_id', '=', 'pf.product_id')
->select('pr.id as product_review_id', 'pr.title', 'pr.comment', 'pf.name as product_name', 'pr.status as product_review_status')
->where('channel', core()->getCurrentChannelCode())
->where('locale', app()->getLocale());
$this->addFilter('product_review_id', 'pr.id');
$this->addFilter('product_review_status', 'pr.status');
$this->addFilter('product_name', 'pg.name');
$this->addFilter('product_name', 'pf.name');
$this->setQueryBuilder($queryBuilder);
}

View File

@ -149,6 +149,9 @@ class ShipmentController extends Controller
{
$valid = false;
if (! isset($data['shipment']['items']))
return ;
foreach ($data['shipment']['items'] as $itemId => $inventorySource) {
if ($qty = $inventorySource[$data['shipment']['source']]) {
$orderItem = $this->orderItem->find($itemId);

View File

@ -23,7 +23,6 @@ class AdminServiceProvider extends ServiceProvider
*/
public function boot()
{
// include __DIR__ . '/../Http/routes.php';
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'admin');

View File

@ -28,8 +28,8 @@ window.onload = function () {
if(pageContentHeight <= innerSectionHeight - 60) {
$('.navbar-left').css("position","absolute");
$('.content').css({"position": "fixed", "width": "65%"});
$('.content-wrapper').css({"position": "sticky", "top": "60px"});
// $('.content').css({"position": "fixed", "width": "65%"});
// $('.content-wrapper').css({"position": "sticky", "top": "60px"});
}
else {
$('.accordian-header').on('click',function(event) {

View File

@ -415,7 +415,7 @@ body {
}
.data {
padding-top: 3px;
padding-top: 13px;
font-size: 32px;
color: #0041FF;

View File

@ -706,6 +706,9 @@ return [
],
'error' => [
'go-to-home' => 'إذهب إلى البيت',
'in-maitainace' => 'In Maintenance',
'right-back' => 'Be Right Back',
'404' => [
'page-title' => '404 صفحة غير موجودة',
'name' => '404',

View File

@ -768,6 +768,8 @@ return [
'error' => [
'go-to-home' => 'GO TO HOME',
'in-maitainace' => 'In Maintenance',
'right-back' => 'Be Right Back',
'404' => [
'page-title' => '404 Page not found',

View File

@ -721,6 +721,8 @@ return [
'error' => [
'go-to-home' => 'IR PARA PÁGINA INICIAL',
'in-maitainace' => 'In Maintenance',
'right-back' => 'Be Right Back',
'404' => [
'page-title' => '404 Página não Encontrada',

View File

@ -281,7 +281,7 @@
@foreach (Webkul\Core\Models\Locale::all() as $locale)
<td>
<div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']">
<input type="text" v-validate="'required'" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control" data-vv-as="&quot;{{ $locale->name . ' (' . $locale->code . ')' }}&quot;"/>
<input type="text" v-validate="'{{ app()->getLocale() }}' == '{{ $locale->code }}' ? 'required': ''" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control" data-vv-as="&quot;{{ $locale->name . ' (' . $locale->code . ')' }}&quot;"/>
<span class="control-error" v-if="errors.has(localeInputName(row, '{{ $locale->code }}'))">@{{ errors.first(localeInputName(row, '{!! $locale->code !!}')) }}</span>
</div>
</td>

View File

@ -336,7 +336,7 @@
@foreach (Webkul\Core\Models\Locale::all() as $locale)
<td>
<div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']">
<input type="text" v-validate="'required'" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control" data-vv-as="&quot;{{ $locale->name . ' (' . $locale->code . ')' }}&quot;"/>
<input type="text" v-validate="'{{ app()->getLocale() }}' == '{{ $locale->code }}' ? 'required': ''" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control" data-vv-as="&quot;{{ $locale->name . ' (' . $locale->code . ')' }}&quot;"/>
<span class="control-error" v-if="errors.has(localeInputName(row, '{{ $locale->code }}'))">@{{ errors.first(localeInputName(row, '{!! $locale->code !!}')) }}</span>
</div>
</td>

View File

@ -93,11 +93,7 @@
<span class="control-error" v-if="errors.has('display_mode')">@{{ errors.first('display_mode') }}</span>
</div>
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
<label for="description" id="descript-label" class="required">{{ __('admin::app.catalog.categories.description') }}</label>
<textarea v-validate="''" class="control" id="description" name="description" data-vv-as="&quot;{{ __('admin::app.catalog.categories.description') }}&quot;">{{ old('description') }}</textarea>
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
</div>
<description></description>
<div class="control-group">
<label>{{ __('admin::app.catalog.categories.image') }}
@ -179,6 +175,16 @@
@push('scripts')
<script src="{{ asset('vendor/webkul/admin/assets/js/tinyMCE/tinymce.min.js') }}"></script>
<script type="text/x-template" id="description-template">
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
<label for="description" :class="isRequired ? 'required' : ''">{{ __('admin::app.catalog.categories.description') }}</label>
<textarea v-validate="isRequired ? 'required' : ''" class="control" id="description" name="description" data-vv-as="&quot;{{ __('admin::app.catalog.categories.description') }}&quot;">{{ old('description') }}</textarea>
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
</div>
</script>
<script>
$(document).ready(function () {
tinymce.init({
@ -189,14 +195,33 @@
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | code',
image_advtab: true
});
$('#display_mode').on('change', function (e) {
if ($('#display_mode').val() != 'products_only') {
$("#descript-label").addClass("required");
} else {
$("#descript-label").removeClass("required");
}
})
});
Vue.component('description', {
template: '#description-template',
inject: ['$validator'],
data() {
return {
isRequired: true,
}
},
created () {
var this_this = this;
$(document).ready(function () {
$('#display_mode').on('change', function (e) {
if ($('#display_mode').val() != 'products_only') {
this_this.isRequired = true;
} else {
this_this.isRequired = false;
}
})
});
}
})
</script>
@endpush

View File

@ -106,11 +106,7 @@
<span class="control-error" v-if="errors.has('display_mode')">@{{ errors.first('display_mode') }}</span>
</div>
<div class="control-group" :class="[errors.has('{{$locale}}[description]') ? 'has-error' : '']">
<label for="description">{{ __('admin::app.catalog.categories.description') }}</label>
<textarea class="control" id="description" name="{{$locale}}[description]" data-vv-as="&quot;{{ __('admin::app.catalog.categories.description') }}&quot;">{{ old($locale)['description'] ?: $category->translate($locale)['description'] }}</textarea>
<span class="control-error" v-if="errors.has('{{$locale}}[description]')">@{{ errors.first('{!!$locale!!}[description]') }}</span>
</div>
<description></description>
<div class="control-group">
<label>{{ __('admin::app.catalog.categories.image') }} </label>
@ -192,6 +188,16 @@
@push('scripts')
<script src="{{ asset('vendor/webkul/admin/assets/js/tinyMCE/tinymce.min.js') }}"></script>
<script type="text/x-template" id="description-template">
<div class="control-group" :class="[errors.has('{{$locale}}[description]') ? 'has-error' : '']">
<label for="description" :class="isRequired ? 'required' : ''">{{ __('admin::app.catalog.categories.description') }}</label>
<textarea v-validate="isRequired ? 'required' : ''" class="control" id="description" name="{{$locale}}[description]" data-vv-as="&quot;{{ __('admin::app.catalog.categories.description') }}&quot;">{{ old($locale)['description'] ?: $category->translate($locale)['description'] }}</textarea>
<span class="control-error" v-if="errors.has('{{$locale}}[description]')">@{{ errors.first('{!!$locale!!}[description]') }}</span>
</div>
</script>
<script>
$(document).ready(function () {
tinymce.init({
@ -203,5 +209,38 @@
image_advtab: true
});
});
Vue.component('description', {
template: '#description-template',
inject: ['$validator'],
data() {
return {
isRequired: true,
}
},
created () {
var this_this = this;
$(document).ready(function () {
$('#display_mode').on('change', function (e) {
if ($('#display_mode').val() != 'products_only') {
this_this.isRequired = true;
} else {
this_this.isRequired = false;
}
})
if ($('#display_mode').val() != 'products_only') {
this_this.isRequired = true;
} else {
this_this.isRequired = false;
}
});
}
})
</script>
@endpush

View File

@ -98,7 +98,8 @@
@if (view()->exists($typeView = 'admin::catalog.products.field-types.' . $attribute->type))
<div class="control-group {{ $attribute->type }}" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
<div class="control-group {{ $attribute->type }}" @if ($attribute->type == 'multiselect') :class="[errors.has('{{ $attribute->code }}[]') ? 'has-error' : '']" @else :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']" @endif>
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
{{ $attribute->admin_name }}
@ -124,7 +125,13 @@
@include ($typeView)
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
<span class="control-error" @if ($attribute->type == 'multiselect') v-if="errors.has('{{ $attribute->code }}[]')" @else v-if="errors.has('{{ $attribute->code }}')" @endif>
@if ($attribute->type == 'multiselect')
@{{ errors.first('{!! $attribute->code !!}[]') }}
@else
@{{ errors.first('{!! $attribute->code !!}') }}
@endif
</span>
</div>
@endif

View File

@ -35,7 +35,7 @@
}
?>
<div class="control-group {{ $field['type'] }}" :class="[errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]') ? 'has-error' : '']">
<div class="control-group {{ $field['type'] }}" @if ($field['type'] == 'multiselect') :class="[errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}][]') ? 'has-error' : '']" @else :class="[errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]') ? 'has-error' : '']" @endif>
<label for="{{ $name }}" {{ !isset($field['validation']) || strpos('required', $field['validation']) < 0 ? '' : 'class=required' }}>
@ -216,7 +216,14 @@
<span class="control-info">{{ trans($field['info']) }}</span>
@endif
<span class="control-error" v-if="errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]')">@{{ errors.first('{!! $firstField !!}[{!! $secondField !!}][{!! $thirdField !!}][{!! $field['name'] !!}]') }}</span>
<span class="control-error" @if ($field['type'] == 'multiselect') v-if="errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}][]')" @else v-if="errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]')" @endif
>
@if ($field['type'] == 'multiselect')
@{{ errors.first('{!! $firstField !!}[{!! $secondField !!}][{!! $thirdField !!}][{!! $field['name'] !!}][]') }}
@else
@{{ errors.first('{!! $firstField !!}[{!! $secondField !!}][{!! $thirdField !!}][{!! $field['name'] !!}]') }}
@endif
</span>
</div>

View File

@ -27,6 +27,7 @@
<div class="page-content">
@inject('customerGrid','Webkul\Admin\DataGrids\CustomerDataGrid')
{!! $customerGrid->render() !!}
</div>
</div>

View File

@ -16,7 +16,7 @@
{{ __('admin::app.error.401.name') }}
</div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E; margin-top: 40px;">
{{ __('admin::app.error.401.title') }}
</div>

View File

@ -16,7 +16,7 @@
{{ __('admin::app.error.403.name') }}
</div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E; margin-top: 40px;">
{{ __('admin::app.error.403.title') }}
</div>

View File

@ -16,7 +16,7 @@
{{ __('admin::app.error.404.name') }}
</div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E; margin-top: 40px;">
{{ __('admin::app.error.404.title') }}
</div>

View File

@ -17,7 +17,7 @@
{{ __('admin::app.error.500.name') }}
</div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E; margin-top: 40px;">
{{ __('admin::app.error.500.title') }}
</div>

View File

@ -16,11 +16,11 @@
<div class="error-box" style="width: 50%">
<div class="error-title" style="font-size: 100px;color: #5E5E5E">
In Mainetenance
{{ __('admin::app.error.in-maitainace') }}
</div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
Be Right Back
{{ __('admin::app.error.right-back') }}
</div>
</div>

View File

@ -20,7 +20,7 @@
</div>
</div>
<button type="submit" class="btn btn-lg btn-primary" @click="closeModal">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.export.export') }}
</button>
@ -29,11 +29,8 @@
<script>
Vue.component('export-form', {
template: '#export-form-template',
methods: {
closeModal () {
this.$parent.closeModal();
}
}
});
</script>

View File

@ -156,7 +156,7 @@ class AttributeRepository extends Repository
*/
public function getFilterAttributes()
{
return $this->model->where('is_filterable', 1)->get();
return $this->model->where('is_filterable', 1)->with('options')->get();
}
/**

View File

@ -76,8 +76,8 @@ class CategoryRepository extends Repository
public function getCategoryTree($id = null)
{
return $id
? Category::orderBy('position', 'ASC')->where('id', '!=', $id)->get()->toTree()
: Category::orderBy('position', 'ASC')->get()->toTree();
? $this->model::orderBy('position', 'ASC')->where('id', '!=', $id)->get()->toTree()
: $this->model::orderBy('position', 'ASC')->get()->toTree();
}
@ -88,7 +88,7 @@ class CategoryRepository extends Repository
*/
public function getRootCategories()
{
return Category::withDepth()->having('depth', '=', 0)->get();
return $this->model::withDepth()->having('depth', '=', 0)->get();
}
/**
@ -104,9 +104,9 @@ class CategoryRepository extends Repository
if(array_key_exists($id, $categories))
return $categories[$id];
return $categories[$id] = $id
? Category::orderBy('position', 'ASC')->where('status', 1)->descendantsOf($id)->toTree()
: Category::orderBy('position', 'ASC')->where('status', 1)->get()->toTree();
return $categories[$id] = $id
? $this->model::orderBy('position', 'ASC')->where('status', 1)->descendantsOf($id)->toTree()
: $this->model::orderBy('position', 'ASC')->where('status', 1)->get()->toTree();
}
/**

View File

@ -134,6 +134,19 @@ class Cart {
$this->suppressFlash = false;
}
/**
* Return current logged in customer
*
* @return Customer | Boolean
*/
public function getCurrentCustomer()
{
$guard = request()->has('token') ? 'api' : 'customer';
return auth()->guard($guard);
}
/**
* Create new cart instance.
*
@ -158,12 +171,12 @@ class Cart {
];
//Authentication details
if (auth()->guard('customer')->check()) {
$cartData['customer_id'] = auth()->guard('customer')->user()->id;
if ($this->getCurrentCustomer()->check()) {
$cartData['customer_id'] = $this->getCurrentCustomer()->user()->id;
$cartData['is_guest'] = 0;
$cartData['customer_first_name'] = auth()->guard('customer')->user()->first_name;
$cartData['customer_last_name'] = auth()->guard('customer')->user()->last_name;
$cartData['customer_email'] = auth()->guard('customer')->user()->email;
$cartData['customer_first_name'] = $this->getCurrentCustomer()->user()->first_name;
$cartData['customer_last_name'] = $this->getCurrentCustomer()->user()->last_name;
$cartData['customer_email'] = $this->getCurrentCustomer()->user()->email;
} else {
$cartData['is_guest'] = 1;
}
@ -246,7 +259,8 @@ class Cart {
*/
public function createItem($id, $data)
{
$product = $parentProduct = $configurable = false;
$childProduct = $configurable = false;
$product = $this->product->findOneByField('id', $id);
if ($product->type == 'configurable') {
@ -254,17 +268,15 @@ class Cart {
return false;
}
$parentProduct = $this->product->findOneByField('id', $data['selected_configurable_option']);
$childProduct = $this->product->findOneByField('id', $data['selected_configurable_option']);
$canAdd = $parentProduct->haveSufficientQuantity($data['quantity']);
$canAdd = $childProduct->haveSufficientQuantity($data['quantity']);
if (! $canAdd) {
session()->flash('warning', trans('shop::app.checkout.cart.quantity.inventory_warning'));
return false;
}
$configurable = true;
} else {
$canAdd = $product->haveSufficientQuantity($data['quantity']);
@ -276,12 +288,12 @@ class Cart {
}
//Check if the product's information is proper or not
if (! isset($data['product']) || !isset($data['quantity'])) {
if (! isset($data['product']) || ! isset($data['quantity'])) {
session()->flash('error', trans('shop::app.checkout.cart.integrity.missing_fields'));
return false;
} else {
if ($product->type == 'configurable' && !isset($data['super_attribute'])) {
if ($product->type == 'configurable' && ! isset($data['super_attribute'])) {
session()->flash('error', trans('shop::app.checkout.cart.integrity.missing_options'));
return false;
@ -292,12 +304,12 @@ class Cart {
$additional = [];
if ($product->type == 'configurable') {
$price = $this->price->getMinimalPrice($parentProduct);
$price = $this->price->getMinimalPrice($childProduct);
} else {
$price = $this->price->getMinimalPrice($product);
}
$weight = ($product->type == 'configurable' ? $parentProduct->weight : $product->weight);
$weight = ($product->type == 'configurable' ? $childProduct->weight : $product->weight);
$parentData = [
'sku' => $product->sku,
@ -317,27 +329,28 @@ class Cart {
'additional' => $data,
];
if ($configurable) {
$attributeDetails = $this->getProductAttributeOptionDetails($parentProduct);
if ($product->type == 'configurable') {
$attributeDetails = $this->getProductAttributeOptionDetails($childProduct);
unset($attributeDetails['html']);
$parentData['additional'] = array_merge($parentData['additional'], $attributeDetails);
$childData['product_id'] = (int)$data['selected_configurable_option'];
$childData['sku'] = $parentProduct->sku;
$childData['name'] = $parentProduct->name;
$childData['sku'] = $childProduct->sku;
$childData['name'] = $childProduct->name;
$childData['type'] = 'simple';
$childData['cart_id'] = $this->getCart()->id;
}
$result = $this->cartItem->create($parentData);
$item = $this->cartItem->create($parentData);
if ($childData != null) {
$childData['parent_id'] = $result->id;
$childData['parent_id'] = $item->id;
$this->cartItem->create($childData);
}
return $result;
return $item;
}
/**
@ -440,7 +453,7 @@ class Cart {
public function mergeCart()
{
if (session()->has('cart')) {
$cart = $this->cart->findWhere(['customer_id' => auth()->guard('customer')->user()->id, 'is_active' => 1]);
$cart = $this->cart->findWhere(['customer_id' => $this->getCurrentCustomer()->user()->id, 'is_active' => 1]);
if ($cart->count()) {
$cart = $cart->first();
@ -453,11 +466,11 @@ class Cart {
//when the logged in customer is not having any of the cart instance previously and are active.
if (! $cart) {
$guestCart->update([
'customer_id' => auth()->guard('customer')->user()->id,
'customer_id' => $this->getCurrentCustomer()->user()->id,
'is_guest' => 0,
'customer_first_name' => auth()->guard('customer')->user()->first_name,
'customer_last_name' => auth()->guard('customer')->user()->last_name,
'customer_email' => auth()->guard('customer')->user()->email
'customer_first_name' => $this->getCurrentCustomer()->user()->first_name,
'customer_last_name' => $this->getCurrentCustomer()->user()->last_name,
'customer_email' => $this->getCurrentCustomer()->user()->email
]);
session()->forget('cart');
@ -554,7 +567,7 @@ class Cart {
*/
public function putCart($cart)
{
if (! auth()->guard('customer')->check()) {
if (! $this->getCurrentCustomer()->check()) {
session()->put('cart', $cart);
}
}
@ -568,9 +581,9 @@ class Cart {
{
$cart = null;
if (auth()->guard('customer')->check()) {
if ($this->getCurrentCustomer()->check()) {
$cart = $this->cart->findOneWhere([
'customer_id' => auth()->guard('customer')->user()->id,
'customer_id' => $this->getCurrentCustomer()->user()->id,
'is_active' => 1
]);
@ -649,9 +662,9 @@ class Cart {
if (isset($data['billing']['address_id']) && $data['billing']['address_id']) {
$address = $this->customerAddress->findOneWhere(['id'=> $data['billing']['address_id']])->toArray();
$billingAddress['first_name'] = auth()->guard('customer')->user()->first_name;
$billingAddress['last_name'] = auth()->guard('customer')->user()->last_name;
$billingAddress['email'] = auth()->guard('customer')->user()->email;
$billingAddress['first_name'] = $this->getCurrentCustomer()->user()->first_name;
$billingAddress['last_name'] = $this->getCurrentCustomer()->user()->last_name;
$billingAddress['email'] = $this->getCurrentCustomer()->user()->email;
$billingAddress['address1'] = $address['address1'];
$billingAddress['country'] = $address['country'];
$billingAddress['state'] = $address['state'];
@ -662,9 +675,9 @@ class Cart {
if (isset($data['shipping']['address_id']) && $data['shipping']['address_id']) {
$address = $this->customerAddress->findOneWhere(['id'=> $data['shipping']['address_id']])->toArray();
$shippingAddress['first_name'] = auth()->guard('customer')->user()->first_name;
$shippingAddress['last_name'] = auth()->guard('customer')->user()->last_name;
$shippingAddress['email'] = auth()->guard('customer')->user()->email;
$shippingAddress['first_name'] = $this->getCurrentCustomer()->user()->first_name;
$shippingAddress['last_name'] = $this->getCurrentCustomer()->user()->last_name;
$shippingAddress['email'] = $this->getCurrentCustomer()->user()->email;
$shippingAddress['address1'] = $address['address1'];
$shippingAddress['country'] = $address['country'];
$shippingAddress['state'] = $address['state'];
@ -674,12 +687,12 @@ class Cart {
}
if (isset($data['billing']['save_as_address']) && $data['billing']['save_as_address']) {
$billingAddress['customer_id'] = auth()->guard('customer')->user()->id;
$billingAddress['customer_id'] = $this->getCurrentCustomer()->user()->id;
$this->customerAddress->create($billingAddress);
}
if (isset($data['shipping']['save_as_address']) && $data['shipping']['save_as_address']) {
$shippingAddress['customer_id'] = auth()->guard('customer')->user()->id;
$shippingAddress['customer_id'] = $this->getCurrentCustomer()->user()->id;
$this->customerAddress->create($shippingAddress);
}
@ -709,10 +722,10 @@ class Cart {
}
}
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;
if ($this->getCurrentCustomer()->check()) {
$cart->customer_email = $this->getCurrentCustomer()->user()->email;
$cart->customer_first_name = $this->getCurrentCustomer()->user()->first_name;
$cart->customer_last_name = $this->getCurrentCustomer()->user()->last_name;
} else {
$cart->customer_email = $cart->billing_address->email;
$cart->customer_first_name = $cart->billing_address->first_name;
@ -1021,7 +1034,7 @@ class Cart {
'customer_email' => $data['customer_email'],
'customer_first_name' => $data['customer_first_name'],
'customer_last_name' => $data['customer_last_name'],
'customer' => auth()->guard('customer')->check() ? auth()->guard('customer')->user() : null,
'customer' => $this->getCurrentCustomer()->check() ? $this->getCurrentCustomer()->user() : null,
'shipping_method' => $data['selected_shipping_rate']['method'],
'shipping_title' => $data['selected_shipping_rate']['carrier_title'] . ' - ' . $data['selected_shipping_rate']['method_title'],
@ -1122,7 +1135,7 @@ class Cart {
$wishlist = [];
$wishlist = [
'channel_id' => $cart->channel_id,
'customer_id' => auth()->guard('customer')->user()->id,
'customer_id' => $this->getCurrentCustomer()->user()->id,
];
foreach ($items as $item) {
@ -1134,7 +1147,7 @@ class Cart {
$wishtlist['options'] = $item->additional;
}
$shouldBe = $this->wishlist->findWhere(['customer_id' => auth()->guard('customer')->user()->id, 'product_id' => $wishlist['product_id']]);
$shouldBe = $this->wishlist->findWhere(['customer_id' => $this->getCurrentCustomer()->user()->id, 'product_id' => $wishlist['product_id']]);
if ($shouldBe->isEmpty()) {
$wishlist = $this->wishlist->create($wishlist);

View File

@ -15,7 +15,5 @@ class CustomerServiceProvider extends ServiceProvider
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'customer');
$this->loadMigrationsFrom(__DIR__ . '/../Database/migrations');
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'customer');
}
}

View File

@ -37,7 +37,7 @@ class CreateProductFlatTable extends Migration
$table->integer('size_label')->nullable();
$table->date('created_at')->nullable();
$table->string('locale')->nullable();
$table->string('channel')->nullable();

View File

@ -0,0 +1,30 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterProductFlatTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('product_flat', function (Blueprint $table) {
$table->text('description')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -52,12 +52,9 @@ class ProductImage extends AbstractProduct
*/
public function getProductBaseImage($product)
{
if (! $product)
return [];
$images = $product->images;
$images = $product ? $product->images : null;
if ($images->count()) {
if ($images && $images->count()) {
$image = [
'small_image_url' => url('cache/small/' . $images[0]->path),
'medium_image_url' => url('cache/medium/' . $images[0]->path),

View File

@ -118,7 +118,7 @@ class ProductFlat
public function afterAttributeDeleted($attributeId)
{
$attribute = $this->attributeRepository->find($attributeId);
if (Schema::hasColumn('product_flat', strtolower($attribute->code))) {
Schema::table('product_flat', function (Blueprint $table) use($attribute) {
$table->dropColumn($attribute->code);
@ -158,9 +158,14 @@ class ProductFlat
{
static $familyAttributes = [];
static $superAttributes = [];
if (! array_key_exists($product->attribute_family->id, $familyAttributes))
$familyAttributes[$product->attribute_family->id] = $product->attribute_family->custom_attributes;
if ($parentProduct && ! array_key_exists($parentProduct->id, $superAttributes))
$superAttributes[$parentProduct->id] = $parentProduct->super_attributes()->pluck('code')->toArray();
foreach (core()->getAllChannels() as $channel) {
foreach ($channel->locales as $locale) {
$productFlat = $this->productFlatRepository->findOneWhere([
@ -178,15 +183,15 @@ class ProductFlat
}
foreach ($familyAttributes[$product->attribute_family->id] as $attribute) {
if ($parentProduct && ! in_array($attribute->code, ['sku', 'name', 'price', 'weight', 'status']))
if ($parentProduct && ! in_array($attribute->code, array_merge($superAttributes[$parentProduct->id], ['sku', 'name', 'price', 'weight', 'status'])))
continue;
if (in_array($attribute->code, ['short_description', 'tax_category_id', 'meta_title', 'meta_keywords', 'meta_description', 'width', 'height']))
continue;
// if (! Schema::hasColumn('product_flat', $attribute->code))
// continue;
if (! Schema::hasColumn('product_flat', $attribute->code))
continue;
if ($attribute->value_per_channel) {
if ($attribute->value_per_locale) {
$productAttributeValue = $product->attribute_values()->where('channel', $channel->code)->where('locale', $locale->code)->where('attribute_id', $attribute->id)->first();
@ -217,6 +222,24 @@ class ProductFlat
$productFlat->{$attribute->code . '_label'} = $attributeOption->admin_name;
}
}
} elseif ($attribute->type == 'multiselect') {
$attributeOptionIds = explode(',', $product->{$attribute->code});
if (count($attributeOptionIds)) {
$attributeOptions = $this->attributeOptionRepository->findWhereIn('id', $attributeOptionIds);
$optionLabels = [];
foreach ($attributeOptions as $attributeOption) {
if ($attributeOptionTranslation = $attributeOption->translate($locale->code)) {
$optionLabels[] = $attributeOptionTranslation->label;
} else {
$optionLabels[] = $attributeOption->admin_name;
}
}
$productFlat->{$attribute->code . '_label'} = implode(', ', $optionLabels);
}
}
}

View File

@ -442,7 +442,7 @@ class ProductRepository extends Repository
->addSelect('product_flat.*')
->addSelect(DB::raw('IF( product_flat.special_price_from IS NOT NULL
AND product_flat.special_price_to IS NOT NULL , IF( NOW( ) >= product_flat.special_price_from
AND NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , IF( product_flat.special_price_from IS NULL , IF( product_flat.special_price_to IS NULL , IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , IF( NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) ) , IF( product_flat.special_price_to IS NULL , IF( NOW( ) >= product_flat.special_price_from, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , product_flat.price ) ) ) AS price'))
AND NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , IF( product_flat.special_price_from IS NULL , IF( product_flat.special_price_to IS NULL , IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , IF( NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) ) , IF( product_flat.special_price_to IS NULL , IF( NOW( ) >= product_flat.special_price_from, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , product_flat.price ) ) ) AS final_price'))
->leftJoin('products', 'product_flat.product_id', '=', 'products.id')
->leftJoin('product_categories', 'products.id', '=', 'product_categories.product_id')
@ -472,7 +472,11 @@ class ProductRepository extends Repository
$attribute = $this->attribute->findOneByField('code', $params['sort']);
if ($params['sort'] == 'price') {
$qb->orderBy($attribute->code, $params['order']);
if ($attribute->code == 'price') {
$qb->orderBy('final_price', $params['order']);
} else {
$qb->orderBy($attribute->code, $params['order']);
}
} else {
$qb->orderBy($params['sort'] == 'created_at' ? 'product_flat.created_at' : $attribute->code, $params['order']);
}
@ -495,7 +499,11 @@ class ProductRepository extends Repository
}
});
} else {
$query2 = $query2->where($column, '>=', current($queryParams))->where($column, '<=', end($queryParams));
if ($attribute->code != 'price') {
$query2 = $query2->where($column, '>=', current($queryParams))->where($column, '<=', end($queryParams));
} else {
$query2 = $query2->where($column, '>=', current($queryParams))->where($column, '<=', end($queryParams));
}
}
}
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=a13f5cfbeef666d71b37",
"/css/shop.css": "/css/shop.css?id=8991884e53441d770cee"
"/js/shop.js": "/js/shop.js?id=ad1039174ce2c81c8805",
"/css/shop.css": "/css/shop.css?id=bafca07fed1830b7fd24"
}

View File

@ -33,13 +33,18 @@ use Webkul\Core\Repositories\SliderRepository;
*/
public function index()
{
if (request()->route('any'))
abort(404);
$currentChannel = core()->getCurrentChannel();
$sliderData = $this->sliderRepository->findByField('channel_id', $currentChannel->id)->toArray();
return view($this->_config['view'], compact('sliderData'));
}
/**
* loads the home page for the storefront
*/
public function notFound()
{
abort(404);
}
}

View File

@ -275,5 +275,5 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
});
//customer routes end here
Route::get('/{any?}', 'Webkul\Shop\Http\Controllers\HomeController@index');
Route::fallback('Webkul\Shop\Http\Controllers\HomeController@notFound');
});

View File

@ -26,7 +26,7 @@ class ShopServiceProvider extends ServiceProvider
*/
public function boot(Router $router)
{
include __DIR__ . '/../Http/routes.php';
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'shop');

View File

@ -10,8 +10,6 @@ Vue.prototype.$http = axios
window.eventBus = new Vue();
Vue.component("category-nav", require("./components/category-nav.vue"));
Vue.component("category-item", require("./components/category-item.vue"));
Vue.component("image-slider", require("./components/image-slider.vue"));
Vue.component("vue-slider", require("vue-slider-component"));

View File

@ -1,66 +0,0 @@
<template>
<li>
<a :href="url+'/categories/'+this.item['translations'][0].slug">
{{ name }}&emsp;
<i class="icon dropdown-right-icon" v-if="haveChildren && item.parent_id != null"></i>
</a>
<i :class="[show ? 'icon icon-arrow-down mt-15' : 'icon dropdown-right-icon left mt-15']"
v-if="haveChildren" @click="showOrHide"></i>
<ul v-if="haveChildren && show">
<category-item
v-for="(child, index) in item.children"
:key="index"
:url="url"
:item="child">
</category-item>
</ul>
</li>
</template>
<script>
// define the item component
export default {
props: {
item: Object,
url: String,
},
data() {
return {
items_count:0,
show: false,
};
},
mounted: function() {
if(window.innerWidth > 770){
this.show = true;
}
},
computed: {
haveChildren() {
return this.item.children.length ? true : false;
},
name() {
if (this.item.translations && this.item.translations.length) {
this.item.translations.forEach(function(translation) {
if (translation.locale == document.documentElement.lang)
return translation.name;
});
}
return this.item.name;
}
},
methods: {
showOrHide: function() {
this.show = !this.show;
}
}
}
</script>

View File

@ -1,38 +0,0 @@
<template>
<ul class="nav">
<category-item
v-for="(item, index) in items"
:key="index"
:url="url"
:item="item"
:parent="index">
</category-item>
</ul>
</template>
<script>
// define the item component
export default {
props: {
categories: {
type: [Array, String, Object],
required: false,
default: () => ([])
},
url: String
},
data(){
return {
items_count:0
};
},
computed: {
items () {
return JSON.parse(this.categories)
}
},
}
</script>

View File

@ -1963,6 +1963,14 @@ section.product-detail {
}
}
}
.quantity-change {
cursor: pointer;
&:focus {
border-color: $border-color !important;
}
}
}
}
}
@ -3139,12 +3147,6 @@ section.review {
height: 30px;
}
}
// .default-address {
// position: absolute;
// top: 10px;
// right: 10px;
// }
}
}

View File

@ -321,7 +321,8 @@ return [
'quantity' => 'الكمية',
'in-stock' => 'في الأسهم',
'out-of-stock' => 'خارج الأسهم',
'view-all' => 'عرض الكل'
'view-all' => 'عرض الكل',
'less-quantity' => 'Quantity can not be less than one.'
],
'wishlist' => [

View File

@ -330,7 +330,8 @@ return [
'in-stock' => 'In Stock',
'out-of-stock' => 'Out Of Stock',
'view-all' => 'View All',
'select-above-options' => 'Please select above options first.'
'select-above-options' => 'Please select above options first.',
'less-quantity' => 'Quantity can not be less than one.'
],
'wishlist' => [

View File

@ -326,7 +326,8 @@ return [
'in-stock' => 'Em Estoque',
'out-of-stock' => 'Fora de Estoque',
'view-all' => 'Ver Tudo',
'select-above-options' => 'Por favor, selecione as opções acima primeiro.'
'select-above-options' => 'Por favor, selecione as opções acima primeiro.',
'less-quantity' => 'Quantity can not be less than one.'
],
'wishlist' => [

View File

@ -15,7 +15,7 @@
<div class="error-title" style="font-size: 100px;color: #5E5E5E"> {{ __('admin::app.error.401.name') }} </div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E; margin-top: 40px;">
{{ __('admin::app.error.401.title') }}
</div>

View File

@ -15,7 +15,7 @@
<div class="error-title" style="font-size: 100px;color: #5E5E5E"> {{ __('admin::app.error.403.name') }} </div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E; margin-top: 40px">
{{ __('admin::app.error.403.title') }}
</div>

View File

@ -17,7 +17,7 @@
{{ __('admin::app.error.404.name') }}
</div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E; margin-top: 40px">
{{ __('admin::app.error.404.title') }}
</div>

View File

@ -17,7 +17,7 @@
{{ __('admin::app.error.500.name') }}
</div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E; margin-top: 40px">
{{ __('admin::app.error.500.title') }}
</div>

View File

@ -15,11 +15,11 @@
<div class="error-box" style="width: 50%">
<div class="error-title" style="font-size: 100px;color: #5E5E5E">
In Mainetenance
{{ __('admin::app.error.in-maitainace') }}
</div>
<div class="error-messgae" style="font-size: 24px;color: #5E5E5E">
Be Right Back
{{ __('admin::app.error.right-back') }}
</div>
</div>

View File

@ -13,4 +13,123 @@ foreach (app('Webkul\Category\Repositories\CategoryRepository')->getVisibleCateg
<category-nav categories='@json($categories)' url="{{url()->to('/')}}"></category-nav>
{!! view_render_event('bagisto.shop.layout.header.category.after') !!}
{!! view_render_event('bagisto.shop.layout.header.category.after') !!}
@push('scripts')
<script type="text/x-template" id="category-nav-template">
<ul class="nav">
<category-item
v-for="(item, index) in items"
:key="index"
:url="url"
:item="item"
:parent="index">
</category-item>
</ul>
</script>
<script>
Vue.component('category-nav', {
template: '#category-nav-template',
props: {
categories: {
type: [Array, String, Object],
required: false,
default: () => ([])
},
url: String
},
data(){
return {
items_count:0
};
},
computed: {
items () {
return JSON.parse(this.categories)
}
},
});
</script>
<script type="text/x-template" id="category-item-template">
<li>
<a :href="url+'/categories/'+this.item['translations'][0].slug">
@{{ name }}&emsp;
<i class="icon dropdown-right-icon" v-if="haveChildren && item.parent_id != null"></i>
</a>
<i :class="[show ? 'icon icon-arrow-down mt-15' : 'icon dropdown-right-icon left mt-15']"
v-if="haveChildren" @click="showOrHide"></i>
<ul v-if="haveChildren && show">
<category-item
v-for="(child, index) in item.children"
:key="index"
:url="url"
:item="child">
</category-item>
</ul>
</li>
</script>
<script>
Vue.component('category-item', {
template: '#category-item-template',
props: {
item: Object,
url: String,
},
data() {
return {
items_count:0,
show: false,
};
},
mounted: function() {
if(window.innerWidth > 770){
this.show = true;
}
},
computed: {
haveChildren() {
return this.item.children.length ? true : false;
},
name() {
if (this.item.translations && this.item.translations.length) {
this.item.translations.forEach(function(translation) {
if (translation.locale == document.documentElement.lang)
return translation.name;
});
}
return this.item.name;
}
},
methods: {
showOrHide: function() {
this.show = !this.show;
}
}
});
</script>
@endpush

View File

@ -20,7 +20,7 @@
<div class="form-container">
@csrf()
<input type="hidden" name="product" value="{{ $product->id }}">
<input type="hidden" name="product" value="{{ $product->product_id }}">
@include ('shop::products.view.gallery')
@ -50,7 +50,11 @@
<label class="required">{{ __('shop::app.products.quantity') }}</label>
<input name="quantity" class="control" value="1" v-validate="'required|numeric|min_value:1'" style="width: 60px;" data-vv-as="&quot;{{ __('shop::app.products.quantity') }}&quot;">
<input class="control quantity-change" value="-" style="width: 35px; border-radius: 3px 0px 0px 3px;" onclick="updateQunatity('remove')" readonly>
<input name="quantity" id="quantity" class="control quantity-change" value="1" v-validate="'required|numeric|min_value:1'" style="width: 60px; position: relative; margin-left: -4px; margin-right: -4px; border-right: none;border-left: none; border-radius: 0px;" data-vv-as="&quot;{{ __('shop::app.products.quantity') }}&quot;" readonly>
<input class="control quantity-change" value="+" style="width: 35px; padding: 0 12px; border-radius: 0px 3px 3px 0px;" onclick=updateQunatity('add') readonly>
<span class="control-error" v-if="errors.has('quantity')">@{{ errors.first('quantity') }}</span>
</div>
@ -184,5 +188,21 @@
}
}
};
function updateQunatity(operation) {
var quantity = document.getElementById('quantity').value;
if (operation == 'add') {
quantity = parseInt(quantity) + 1;
} else if (operation == 'remove') {
if (quantity > 1) {
quantity = parseInt(quantity) - 1;
} else {
alert('{{ __('shop::app.products.less-quantity') }}');
}
}
document.getElementById("quantity").value = quantity;
event.preventDefault();
}
</script>
@endpush

View File

@ -167,6 +167,7 @@
this.reloadPrice();
this.changeProductImages();
this.changeStock(this.simpleProduct);
},
getSelectedIndex (attribute, value) {
@ -320,6 +321,16 @@
});
}
},
changeStock(productId) {
var inStockElement = document.getElementById('in-stock');
if (productId) {
inStockElement.style.display= "block";
} else {
inStockElement.style.display= "none";
}
},
}
});

View File

@ -1,7 +1,13 @@
{!! view_render_event('bagisto.shop.products.view.stock.before', ['product' => $product]) !!}
<div class="stock-status {{ $product->type != 'configurable' && ! $product->haveSufficientQuantity(1) ? '' : 'active' }}">
{{ $product->type != 'configurable' && ! $product->haveSufficientQuantity(1) ? __('shop::app.products.out-of-stock') : __('shop::app.products.in-stock') }}
</div>
@if ($product->type == 'simple')
<div class="stock-status {{! $product->haveSufficientQuantity(1) ? '' : 'active' }}">
{{ $product->haveSufficientQuantity(1) ? __('shop::app.products.in-stock') : __('shop::app.products.out-of-stock') }}
</div>
@else
<div class="stock-status in-stock" id="in-stock" style="display: none;">
{{ __('shop::app.products.in-stock') }}
</div>
@endif
{!! view_render_event('bagisto.shop.products.view.stock.after', ['product' => $product]) !!}

View File

@ -298,4 +298,4 @@ class TaxRateController extends Controller
return redirect()->route($this->_config['redirect']);
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=ab3c0287e6da076fc413",
"/css/ui.css": "/css/ui.css?id=0a7cb18085cb895b431f"
}
"/js/ui.js": "/js/ui.js?id=d2b67f9707c2727a06a5",
"/css/ui.css": "/css/ui.css?id=f912bd2a6525691bdb61"
}

View File

@ -743,12 +743,12 @@ modal {
.modal-container {
background: #ffffff;
top: 200px;
top: 100px;
width: 600px;
max-width: 80%;
left: auto;
right: auto;
position: absolute;
left: 50%;
margin-left: -300px;
position: fixed;
z-index: 11;
@include box-shadow(
0px 15px 25px 0px rgba(0, 0, 0, 0.03),

View File

@ -7,7 +7,7 @@ return [
'massaction' => [
'mass-delete-confirm' => 'Do you really want to delete these selected :resource?',
'mass-update-status' => 'Do you really want to update status of these selected :resource?',
'delete' => 'Do you really want to delete this :resource?',
'delete' => 'Do you really want to perform this action?',
'edit' => 'Do you really want to edit this :resource?',
],

View File

@ -703,17 +703,21 @@
doAction(e) {
var element = e.currentTarget;
axios.post(element.getAttribute('data-action'), {
_token : element.getAttribute('data-token'),
_method : element.getAttribute('data-method')
}).then(function(response) {
this.result = response;
location.reload();
}).catch(function (error) {
location.reload();
});
if (confirm('{{__('ui::app.datagrid.massaction.delete') }}')) {
axios.post(element.getAttribute('data-action'), {
_token : element.getAttribute('data-token'),
_method : element.getAttribute('data-method')
}).then(function(response) {
this.result = response;
location.reload();
}).catch(function (error) {
location.reload();
});
e.preventDefault();
e.preventDefault();
} else {
e.preventDefault();
}
},
removeMassActions() {