This commit is contained in:
rahul shukla 2018-10-15 14:32:26 +05:30
commit 5cc562d972
58 changed files with 6355 additions and 1049 deletions

View File

@ -18,7 +18,6 @@
"laravel/framework": "5.6.*", "laravel/framework": "5.6.*",
"laravel/tinker": "^1.0", "laravel/tinker": "^1.0",
"nwidart/laravel-modules": "^3.2", "nwidart/laravel-modules": "^3.2",
"pragmarx/countries": "^0.5.9",
"prettus/l5-repository": "^2.6", "prettus/l5-repository": "^2.6",
"propaganistas/laravel-intl": "^2.0" "propaganistas/laravel-intl": "^2.0"
}, },

View File

@ -284,20 +284,6 @@ Route::group(['middleware' => ['web']], function () {
])->name('admin.locales.store'); ])->name('admin.locales.store');
// Country Routes
Route::get('/countries', 'Webkul\Core\Http\Controllers\CountryController@index')->defaults('_config', [
'view' => 'admin::settings.countries.index'
])->name('admin.countries.index');
Route::get('/countries/create', 'Webkul\Core\Http\Controllers\CountryController@create')->defaults('_config', [
'view' => 'admin::settings.countries.create'
])->name('admin.countries.create');
Route::post('/countries/create', 'Webkul\Core\Http\Controllers\CountryController@store')->defaults('_config', [
'redirect' => 'admin.countries.index'
])->name('admin.countries.store');
// Currency Routes // Currency Routes
Route::get('/currencies', 'Webkul\Core\Http\Controllers\CurrencyController@index')->defaults('_config', [ Route::get('/currencies', 'Webkul\Core\Http\Controllers\CurrencyController@index')->defaults('_config', [
'view' => 'admin::settings.currencies.index' 'view' => 'admin::settings.currencies.index'
@ -400,54 +386,52 @@ Route::group(['middleware' => ['web']], function () {
'redirect' => 'admin::sliders.index' 'redirect' => 'admin::sliders.index'
])->name('admin.sliders.store'); ])->name('admin.sliders.store');
//tax routes //tax routes
Route::prefix('tax')->group(function () { Route::get('/tax-categories', 'Webkul\Tax\Http\Controllers\TaxController@index')->defaults('_config', [
'view' => 'admin::tax.tax-categories.index'
])->name('admin.tax-categories.index');
Route::get('taxrule', 'Webkul\Tax\Http\Controllers\TaxController@index')->defaults('_config', [ // tax rule routes
'view' => 'admin::tax.taxrule.index' Route::get('/tax-categories/create', 'Webkul\Tax\Http\Controllers\TaxCategoryController@show')->defaults('_config', [
])->name('admin.taxrule.index'); 'view' => 'admin::tax.tax-categories.create'
])->name('admin.tax-categories.show');
// tax rule routes Route::post('/tax-categories/create', 'Webkul\Tax\Http\Controllers\TaxCategoryController@create')->defaults('_config', [
Route::get('taxrule/create', 'Webkul\Tax\Http\Controllers\TaxCategoryController@show')->defaults('_config', [ 'redirect' => 'admin.tax-categories.index'
'view' => 'admin::tax.taxrule.create.create' ])->name('admin.tax-categories.create');
])->name('admin.taxrule.show');
Route::post('taxrule/create', 'Webkul\Tax\Http\Controllers\TaxCategoryController@create')->defaults('_config', [ Route::get('/tax-categories/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxCategoryController@edit')->defaults('_config', [
'redirect' => 'admin.taxrule.index' 'view' => 'admin::tax.tax-categories.edit'
])->name('admin.taxrule.create'); ])->name('admin.tax-categories.edit');
Route::get('/taxrule/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxCategoryController@edit')->defaults('_config', [ Route::put('/tax-categories/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxCategoryController@update')->defaults('_config', [
'view' => 'admin::tax.taxrule.edit.edit' 'redirect' => 'admin.tax-categories.index'
])->name('admin.taxrule.edit'); ])->name('admin.tax-categories.update');
Route::put('/taxrule/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxCategoryController@update')->defaults('_config', [ //tax rule ends
'redirect' => 'admin.taxrule.index'
])->name('admin.taxrule.update');
//tax rule ends
//tax rate //tax rate
Route::get('tax-rates', 'Webkul\Tax\Http\Controllers\TaxRateController@index')->defaults('_config', [
'view' => 'admin::tax.tax-rates.index'
])->name('admin.tax-rates.index');
Route::get('taxrate', 'Webkul\Tax\Http\Controllers\TaxRateController@index')->defaults('_config', [ Route::get('tax-rates/create', 'Webkul\Tax\Http\Controllers\TaxRateController@show')->defaults('_config', [
'view' => 'admin::tax.taxrate.index' 'view' => 'admin::tax.tax-rates.create'
])->name('admin.taxrate.index'); ])->name('admin.tax-rates.show');
Route::get('taxrate/create', 'Webkul\Tax\Http\Controllers\TaxRateController@show')->defaults('_config', [ Route::post('tax-rates/create', 'Webkul\Tax\Http\Controllers\TaxRateController@create')->defaults('_config', [
'view' => 'admin::tax.taxrate.create.taxrate' 'redirect' => 'admin.tax-rates.index'
])->name('admin.taxrate.show'); ])->name('admin.tax-rates.create');
Route::post('taxrate/create', 'Webkul\Tax\Http\Controllers\TaxRateController@create')->defaults('_config', [ Route::get('tax-rates/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxRateController@edit')->defaults('_config', [
'redirect' => 'admin.taxrate.index' 'view' => 'admin::tax.tax-rates.edit'
])->name('admin.taxrate.create'); ])->name('admin.tax-rates.store');
Route::get('taxrate/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxRateController@edit')->defaults('_config', [ Route::put('tax-rates/update/{id}', 'Webkul\Tax\Http\Controllers\TaxRateController@update')->defaults('_config', [
'view' => 'admin::tax.taxrate.edit.edit' 'redirect' => 'admin.tax-rates.index'
])->name('admin.taxrate.store'); ])->name('admin.tax-rates.update');
Route::put('taxrate/update/{id}', 'Webkul\Tax\Http\Controllers\TaxRateController@update')->defaults('_config', [
'redirect' => 'admin.taxrate.index'
])->name('admin.taxrate.update');
});
//tax rate ends //tax rate ends
}); });
}); });

View File

@ -68,21 +68,19 @@ class EventServiceProvider extends ServiceProvider
$menu->add('configuration.account', 'My Account', 'admin.account.edit', 1); $menu->add('configuration.account', 'My Account', 'admin.account.edit', 1);
$menu->add('settings', 'Settings', 'admin.countries.index', 6, 'settings-icon'); $menu->add('settings', 'Settings', 'admin.locales.index', 6, 'settings-icon');
$menu->add('settings.countries', 'Countries', 'admin.countries.index', 1, ''); $menu->add('settings.locales', 'Locales', 'admin.locales.index', 1, '');
$menu->add('settings.locales', 'Locales', 'admin.locales.index', 2, ''); $menu->add('settings.currencies', 'Currencies', 'admin.currencies.index', 2, '');
$menu->add('settings.currencies', 'Currencies', 'admin.currencies.index', 3, ''); $menu->add('settings.exchange_rates', 'Exchange Rates', 'admin.exchange_rates.index', 3, '');
$menu->add('settings.exchange_rates', 'Exchange Rates', 'admin.exchange_rates.index', 4, ''); $menu->add('settings.inventory_sources', 'Inventory Sources', 'admin.inventory_sources.index', 4, '');
$menu->add('settings.inventory_sources', 'Inventory Sources', 'admin.inventory_sources.index', 5, '');
$menu->add('settings.channels', 'Channels', 'admin.channels.index', 5, ''); $menu->add('settings.channels', 'Channels', 'admin.channels.index', 5, '');
$menu->add('settings.users', 'Users', 'admin.users.index', 7, ''); $menu->add('settings.users', 'Users', 'admin.users.index', 6, '');
$menu->add('settings.users.users', 'Users', 'admin.users.index', 1, ''); $menu->add('settings.users.users', 'Users', 'admin.users.index', 1, '');
@ -90,11 +88,11 @@ class EventServiceProvider extends ServiceProvider
$menu->add('settings.sliders', 'Create Sliders', 'admin.sliders.index', 8, ''); $menu->add('settings.sliders', 'Create Sliders', 'admin.sliders.index', 8, '');
$menu->add('settings.tax', 'Taxes', 'admin.taxrule.index', 9, ''); $menu->add('settings.tax', 'Taxes', 'admin.tax-categories.index', 9, '');
$menu->add('settings.tax.taxrule', 'Add Tax Category', 'admin.taxrule.index', 1, ''); $menu->add('settings.tax.tax-categories', 'Add Tax Category', 'admin.tax-categories.index', 1, '');
$menu->add('settings.tax.taxrate', 'Add Tax Rates', 'admin.taxrate.index', 2, ''); $menu->add('settings.tax.tax-rates', 'Add Tax Rates', 'admin.tax-rates.index', 2, '');
}); });
} }

View File

@ -2,7 +2,9 @@
return [ return [
'common' => [ 'common' => [
'no-result-found' => 'We couldn\'t find any records.' 'no-result-found' => 'We couldn\'t find any records.',
'country' => 'Country',
'state' => 'State'
], ],
'account' => [ 'account' => [
'header-title' => 'My Account', 'header-title' => 'My Account',
@ -260,9 +262,9 @@ return [
'add-title' => 'Add Tax Category' 'add-title' => 'Add Tax Category'
], ],
'taxrule' => [ 'tax-categories' => [
'title' => 'Add Tax Category', 'title' => 'Add Tax Category',
'create' => 'Create Tax Category', 'save-btn-title' => 'Save Tax Category',
'general' => 'Tax Category', 'general' => 'Tax Category',
'select-channel' => 'Select Channel', 'select-channel' => 'Select Channel',
'name' => 'Name', 'name' => 'Name',
@ -275,8 +277,9 @@ return [
] ]
], ],
'taxrate' => [ 'tax-rates' => [
'title' => 'Add Tax Rate', 'title' => 'Add Tax Rate',
'save-btn-title' => 'Save Tax Rate',
'general' => 'Tax Rate', 'general' => 'Tax Rate',
'identifier' => 'Identifier', 'identifier' => 'Identifier',
'is_zip' => 'Enable Zip Range', 'is_zip' => 'Enable Zip Range',

View File

@ -0,0 +1,25 @@
<div class="control-group">
<label for="country">{{ __('admin::app.common.country') }}</label>
<select class="control" id="country" name="country">
@foreach(core()->countries() as $country)
<option value="{{ $country->code }}" {{ old('country') == $country->code ? 'selected' : '' }}>
{{ $country->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<label for="state">{{ __('admin::app.common.state') }}</label>
<input class="control" id="state" name="state" value="{{ old('state') }}"/>
</div>
@push('scripts')
@endpush

View File

@ -0,0 +1,28 @@
<div class="control-group">
<?php $selectedCountry = old('country') ?: $model->country ?>
<label for="country">{{ __('admin::app.common.country') }}</label>
<select class="control" id="country" name="country">
@foreach(core()->countries() as $country)
<option value="{{ $country->code }}" {{ $selectedCountry == $country->code ? 'selected' : '' }}>
{{ $country->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<label for="state">{{ __('admin::app.common.state') }}</label>
<input class="control" id="state" name="state" value="{{ old('state') ?: $model->state }}"/>
</div>
@push('scripts')
@endpush

View File

@ -1,43 +0,0 @@
@extends('admin::layouts.content')
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.countries.store') }}" @submit.prevent="onSubmit">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.settings.countries.add-title') }}</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.settings.countries.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
<accordian :title="'{{ __('admin::app.settings.countries.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
<label for="code" class="required">{{ __('admin::app.settings.countries.code') }}</label>
<input v-validate="'required'" class="control" id="code" name="code" v-code/>
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
</div>
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.settings.countries.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
</div>
</accordian>
</div>
</div>
</form>
</div>
@stop

View File

@ -1,22 +0,0 @@
@extends('admin::layouts.content')
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.settings.countries.title') }}</h1>
</div>
<div class="page-action">
<a href="{{ route('admin.countries.create') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.settings.countries.add-title') }}
</a>
</div>
</div>
<div class="page-content">
@inject('countries','Webkul\Admin\DataGrids\CountryDataGrid')
{!! $countries->render() !!}
</div>
</div>
@stop

View File

@ -100,16 +100,7 @@
<accordian :title="'{{ __('admin::app.settings.inventory_sources.address') }}'" :active="true"> <accordian :title="'{{ __('admin::app.settings.inventory_sources.address') }}'" :active="true">
<div slot="body"> <div slot="body">
<div class="control-group"> @include ('admin::common.create-country-state')
<label for="country">{{ __('admin::app.settings.inventory_sources.country') }}</label>
<select class="control" id="country" name="country">
@foreach(core()->countries() as $countryCoode => $countryName)
<option value="{{ $countryCoode }}" {{ old('country') == $countryCoode ? 'selected' : '' }}>
{{ $countryName }}
</option>
@endforeach
</select>
</div>
<div class="control-group"> <div class="control-group">
<label for="state">{{ __('admin::app.settings.inventory_sources.state') }}</label> <label for="state">{{ __('admin::app.settings.inventory_sources.state') }}</label>

View File

@ -101,22 +101,7 @@
<accordian :title="'{{ __('admin::app.settings.inventory_sources.address') }}'" :active="true"> <accordian :title="'{{ __('admin::app.settings.inventory_sources.address') }}'" :active="true">
<div slot="body"> <div slot="body">
<div class="control-group"> @include ('admin::common.edit-country-state', ['model' => $inventorySource])
<?php $selectedCountry = old('country') ?: $inventorySource->country ?>
<label for="country">{{ __('admin::app.settings.inventory_sources.country') }}</label>
<select class="control" id="country" name="country">
@foreach(core()->countries() as $countryCoode => $countryName)
<option value="{{ $countryCoode }}" {{ $selectedCountry == $countryCoode ? 'selected' : '' }}>
{{ $countryName }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<label for="state">{{ __('admin::app.settings.inventory_sources.state') }}</label>
<input class="control" id="state" name="state" value="{{ old('state') ?: $inventorySource->state }}"/>
</div>
<div class="control-group"> <div class="control-group">
<label for="city">{{ __('admin::app.settings.inventory_sources.city') }}</label> <label for="city">{{ __('admin::app.settings.inventory_sources.city') }}</label>

View File

@ -1,20 +1,20 @@
@extends('admin::layouts.content') @extends('admin::layouts.content')
@section('page_title') @section('page_title')
{{ __('admin::app.configuration.taxrule.title') }} {{ __('admin::app.configuration.tax-categories.title') }}
@stop @stop
@section('content') @section('content')
<div class="content"> <div class="content">
<form method="POST" action="{{ route('admin.taxrule.create') }}" @submit.prevent="onSubmit"> <form method="POST" action="{{ route('admin.tax-categories.create') }}" @submit.prevent="onSubmit">
<div class="page-header"> <div class="page-header">
<div class="page-title"> <div class="page-title">
<h1>{{ __('admin::app.configuration.taxrule.title') }}</h1> <h1>{{ __('admin::app.configuration.tax-categories.title') }}</h1>
</div> </div>
<div class="page-action"> <div class="page-action">
<button type="submit" class="btn btn-lg btn-primary"> <button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrule.create') }} {{ __('admin::app.configuration.tax-categories.save-btn-title') }}
</button> </button>
</div> </div>
</div> </div>
@ -22,7 +22,7 @@
<div class="form-container"> <div class="form-container">
@csrf() @csrf()
<div class="control-group" :class="[errors.has('channel') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('channel') ? 'has-error' : '']">
<label for="channel" class="required">{{ __('admin::app.configuration.taxrule.select-channel') }}</label> <label for="channel" class="required">{{ __('admin::app.configuration.tax-categories.select-channel') }}</label>
<select class="control" name="channel_id"> <select class="control" name="channel_id">
@foreach(core()->getAllChannels() as $channelModel) @foreach(core()->getAllChannels() as $channelModel)
@ -38,7 +38,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
<label for="code" class="required">{{ __('admin::app.configuration.taxrule.code') }}</label> <label for="code" class="required">{{ __('admin::app.configuration.tax-categories.code') }}</label>
<input v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') }}"/> <input v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') }}"/>
@ -46,7 +46,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.configuration.taxrule.name') }}</label> <label for="name" class="required">{{ __('admin::app.configuration.tax-categories.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}"/> <input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}"/>
@ -54,7 +54,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
<label for="description" class="required">{{ __('admin::app.configuration.taxrule.description') }}</label> <label for="description" class="required">{{ __('admin::app.configuration.tax-categories.description') }}</label>
<textarea v-validate="'required'" class="control" id="description" name="description" value="{{ old('description') }}"></textarea> <textarea v-validate="'required'" class="control" id="description" name="description" value="{{ old('description') }}"></textarea>
@ -62,7 +62,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('taxrates') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('taxrates') ? 'has-error' : '']">
<label for="taxrates" class="required">{{ __('admin::app.configuration.taxrule.select-taxrates') }}</label> <label for="taxrates" class="required">{{ __('admin::app.configuration.tax-categories.select-taxrates') }}</label>
<select multiple="multiple" v-validate="'required'" class="control" id="taxrates" name="taxrates[]" value="{{ old('taxrates') }}"> <select multiple="multiple" v-validate="'required'" class="control" id="taxrates" name="taxrates[]" value="{{ old('taxrates') }}">
@foreach($taxRates as $taxRate) @foreach($taxRates as $taxRate)

View File

@ -1,20 +1,20 @@
@extends('admin::layouts.content') @extends('admin::layouts.content')
@section('page_title') @section('page_title')
{{ __('admin::app.configuration.taxrate.title') }} {{ __('admin::app.configuration.tax-categories.title') }}
@stop @stop
@section('content') @section('content')
<div class="content"> <div class="content">
<form method="POST" action="{{ route('admin.taxrule.update', $data[0][0]['id']) }}" @submit.prevent="onSubmit"> <form method="POST" action="{{ route('admin.tax-categories.update', $data[0][0]['id']) }}" @submit.prevent="onSubmit">
<div class="page-header"> <div class="page-header">
<div class="page-title"> <div class="page-title">
<h1>{{ __('admin::app.configuration.taxrule.edit.title') }}</h1> <h1>{{ __('admin::app.configuration.tax-categories.edit.title') }}</h1>
</div> </div>
<div class="page-action"> <div class="page-action">
<button type="submit" class="btn btn-lg btn-primary"> <button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrule.edit.edit-button-title') }} {{ __('admin::app.configuration.tax-categories.save-btn-title') }}
</button> </button>
</div> </div>
</div> </div>
@ -23,11 +23,11 @@
<div class="form-container"> <div class="form-container">
@csrf() @csrf()
@method('PUT') @method('PUT')
<accordian :title="'{{ __('admin::app.configuration.taxrule.general') }}'" :active="true"> <accordian :title="'{{ __('admin::app.configuration.tax-categories.general') }}'" :active="true">
<div slot="body"> <div slot="body">
<div class="control-group" :class="[errors.has('channel') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('channel') ? 'has-error' : '']">
<label for="channel" class="required">{{ __('admin::app.configuration.taxrule.select-channel') }}</label> <label for="channel" class="required">{{ __('admin::app.configuration.tax-categories.select-channel') }}</label>
<select class="control" name="channel"> <select class="control" name="channel">
@foreach(core()->getAllChannels() as $channelModel) @foreach(core()->getAllChannels() as $channelModel)
@ -43,7 +43,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
<label for="code" class="required">{{ __('admin::app.configuration.taxrule.code') }}</label> <label for="code" class="required">{{ __('admin::app.configuration.tax-categories.code') }}</label>
<input v-validate="'required'" class="control" id="code" name="code" value="{{ $data[0][0]['code'] }}"/> <input v-validate="'required'" class="control" id="code" name="code" value="{{ $data[0][0]['code'] }}"/>
@ -51,7 +51,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.configuration.taxrule.name') }}</label> <label for="name" class="required">{{ __('admin::app.configuration.tax-categories.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ $data[0][0]['name'] }}"/> <input v-validate="'required'" class="control" id="name" name="name" value="{{ $data[0][0]['name'] }}"/>
@ -59,7 +59,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
<label for="description" class="required">{{ __('admin::app.configuration.taxrule.description') }}</label> <label for="description" class="required">{{ __('admin::app.configuration.tax-categories.description') }}</label>
<textarea v-validate="'required'" class="control" id="description" name="description">{{ $data[0][0]['description'] }}</textarea> <textarea v-validate="'required'" class="control" id="description" name="description">{{ $data[0][0]['description'] }}</textarea>
@ -67,7 +67,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('taxrates') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('taxrates') ? 'has-error' : '']">
<label for="taxrates" class="required">{{ __('admin::app.configuration.taxrule.select-taxrates') }}</label> <label for="taxrates" class="required">{{ __('admin::app.configuration.tax-categories.select-taxrates') }}</label>
@inject('taxRates', 'Webkul\Core\Repositories\TaxRatesRepository') @inject('taxRates', 'Webkul\Core\Repositories\TaxRatesRepository')

View File

@ -8,15 +8,15 @@
</div> </div>
<div class="page-action"> <div class="page-action">
<a href="{{ route('admin.taxrule.show') }}" class="btn btn-lg btn-primary"> <a href="{{ route('admin.tax-categories.show') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.tax.add-title') }} {{ __('admin::app.configuration.tax.add-title') }}
</a> </a>
</div> </div>
</div> </div>
<div class="page-content"> <div class="page-content">
@inject('taxrule','Webkul\Admin\DataGrids\TaxRuleDataGrid') @inject('taxCategories','Webkul\Admin\DataGrids\TaxRuleDataGrid')
{!! $taxrule->render() !!} {!! $taxCategories->render() !!}
</div> </div>
</div> </div>
@stop @stop

View File

@ -0,0 +1,126 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.tax-rates.title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.tax-rates.create') }}" @submit.prevent="onSubmit">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.configuration.tax-rates.title') }}</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.tax-rates.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
<div class="control-group" :class="[errors.has('identifier') ? 'has-error' : '']">
<label for="identifier" class="required">{{ __('admin::app.configuration.tax-rates.identifier') }}</label>
<input v-validate="'required'" class="control" id="identifier" name="identifier" value="{{ old('identifier') }}"/>
<span class="control-error" v-if="errors.has('identifier')">@{{ errors.first('identifier') }}</span>
</div>
<div class="control-group" :class="[errors.has('state') ? 'has-error' : '']">
<label for="state" class="required">{{ __('admin::app.configuration.tax-rates.state') }}</label>
<input v-validate="'required'" class="control" id="state" name="state" value="{{ old('state') }}"/>
<span class="control-error" v-if="errors.has('state')">@{{ errors.first('state') }}</span>
</div>
<div class="control-group" :class="[errors.has('country') ? 'has-error' : '']">
<label for="country" class="required">{{ __('admin::app.configuration.tax-rates.country') }}</label>
<input v-validate="'required'" class="control" id="country" name="country" value="{{ old('country') }}"/>
<span class="control-error" v-if="errors.has('country')">@{{ errors.first('country') }}</span>
</div>
<div class="control-group">
<span class="checkbox">
<input type="checkbox" id="is_zip" name="is_zip" onclick="myFunction()">
<label class="checkbox-view" for="is_zip"></label>
Enable Zip Range
</span>
</div>
<div class="control-group" :class="[errors.has('zip_code') ? 'has-error' : '']" id="zip_code">
<label for="zip_code">{{ __('admin::app.configuration.tax-rates.zip_code') }}</label>
<input class="control" id="zip_code" name="zip_code" value="{{ old('zip_code') }}"/>
<span class="control-error" v-if="errors.has('zip_code')">@{{ errors.first('zip_code') }}</span>
</div>
<div class="control-group" :class="[errors.has('zip_from') ? 'has-error' : '']" id="zip_from">
<label for="zip_from">{{ __('admin::app.configuration.tax-rates.zip_from') }}</label>
<input v-validate="'numeric'" class="control" name="zip_from" value="{{ old('zip_from') }}"/>
<span class="control-error" v-if="errors.has('zip_from')">@{{ errors.first('zip_from') }}</span>
</div>
<div class="control-group" :class="[errors.has('zip_to') ? 'has-error' : '']" id="zip_to">
<label for="zip_to">{{ __('admin::app.configuration.tax-rates.zip_to') }}</label>
<input v-validate="'numeric'" class="control" name="zip_to" value="{{ old('zip_to') }}"/>
<span class="control-error" v-if="errors.has('zip_to')">@{{ errors.first('zip_to') }}</span>
</div>
<div class="control-group" :class="[errors.has('tax_rate') ? 'has-error' : '']">
<label for="tax_rate" class="required">{{ __('admin::app.configuration.tax-rates.tax_rate') }}</label>
<input v-validate="'required'" class="control" id="tax_rate" name="tax_rate" value="{{ old('tax_rate') }}"/>
<span class="control-error" v-if="errors.has('tax_rate')">@{{ errors.first('tax_rate') }}</span>
</div>
</div>
</div>
</form>
</div>
@push('scripts')
<script>
window.onload = function () {
document.getElementById("zip_from").style.display = "none";
document.getElementById("zip_to").style.display = "none";
};
function myFunction() {
value = document.getElementById('is_zip').checked;
// console.log(value);
if(value) {
document.getElementById("zip_from").style.display = "";
document.getElementById("zip_to").style.display = "";
document.getElementById("zip_code").style.display = "none";
} else {
document.getElementById("zip_from").style.display = "none";
document.getElementById("zip_to").style.display = "none";
document.getElementById("zip_code").style.display = "";
}
}
</script>
@endpush
@stop

View File

@ -1,20 +1,20 @@
@extends('admin::layouts.content') @extends('admin::layouts.content')
@section('page_title') @section('page_title')
{{ __('admin::app.configuration.taxrate.title') }} {{ __('admin::app.configuration.tax-rates.title') }}
@stop @stop
@section('content') @section('content')
<div class="content"> <div class="content">
<form method="POST" action="{{ route('admin.taxrate.update', $data['id']) }}" @submit.prevent="onSubmit"> <form method="POST" action="{{ route('admin.tax-rates.update', $data['id']) }}" @submit.prevent="onSubmit">
<div class="page-header"> <div class="page-header">
<div class="page-title"> <div class="page-title">
<h1>{{ __('admin::app.configuration.taxrate.edit.title') }}</h1> <h1>{{ __('admin::app.configuration.tax-rates.edit.title') }}</h1>
</div> </div>
<div class="page-action"> <div class="page-action">
<button type="submit" class="btn btn-lg btn-primary"> <button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrate.edit.edit-button-title') }} {{ __('admin::app.configuration.tax-rates.save-btn-title') }}
</button> </button>
</div> </div>
</div> </div>
@ -23,11 +23,11 @@
<div class="form-container"> <div class="form-container">
@method('PUT') @method('PUT')
@csrf() @csrf()
<accordian :title="'{{ __('admin::app.configuration.taxrate.general') }}'" :active="true"> <accordian :title="'{{ __('admin::app.configuration.tax-rates.general') }}'" :active="true">
<div slot="body"> <div slot="body">
<div class="control-group" :class="[errors.has('identifier') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('identifier') ? 'has-error' : '']">
<label for="identifier" class="required">{{ __('admin::app.configuration.taxrate.identifier') }}</label> <label for="identifier" class="required">{{ __('admin::app.configuration.tax-rates.identifier') }}</label>
<input v-validate="'required'" class="control" id="identifier" name="identifier" value="{{ $data['identifier'] }}"/> <input v-validate="'required'" class="control" id="identifier" name="identifier" value="{{ $data['identifier'] }}"/>
@ -45,7 +45,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('zip_from') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('zip_from') ? 'has-error' : '']">
<label for="zip_from" class="required">{{ __('admin::app.configuration.taxrate.zip_from') }}</label> <label for="zip_from" class="required">{{ __('admin::app.configuration.tax-rates.zip_from') }}</label>
<input v-validate="'numeric'" class="control" id="zip_from" name="zip_from" value="{{ $data['zip_from'] }}" /> <input v-validate="'numeric'" class="control" id="zip_from" name="zip_from" value="{{ $data['zip_from'] }}" />
@ -53,7 +53,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('zip_to') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('zip_to') ? 'has-error' : '']">
<label for="zip_to" class="required">{{ __('admin::app.configuration.taxrate.zip_to') }}</label> <label for="zip_to" class="required">{{ __('admin::app.configuration.tax-rates.zip_to') }}</label>
<input v-validate="'numeric'" class="control" id="zip_to" name="zip_to" value="{{ $data['zip_to'] }}" /> <input v-validate="'numeric'" class="control" id="zip_to" name="zip_to" value="{{ $data['zip_to'] }}" />
@ -61,7 +61,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('state') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('state') ? 'has-error' : '']">
<label for="state" class="required">{{ __('admin::app.configuration.taxrate.state') }}</label> <label for="state" class="required">{{ __('admin::app.configuration.tax-rates.state') }}</label>
<input v-validate="'required'" class="control" id="state" name="state" value="{{ $data['state'] }}" /> <input v-validate="'required'" class="control" id="state" name="state" value="{{ $data['state'] }}" />
@ -69,7 +69,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('country') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('country') ? 'has-error' : '']">
<label for="country" class="required">{{ __('admin::app.configuration.taxrate.country') }}</label> <label for="country" class="required">{{ __('admin::app.configuration.tax-rates.country') }}</label>
<input v-validate="'required'" class="control" id="country" name="country" value="{{ $data['country'] }}" /> <input v-validate="'required'" class="control" id="country" name="country" value="{{ $data['country'] }}" />
@ -77,7 +77,7 @@
</div> </div>
<div class="control-group" :class="[errors.has('tax_rate') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('tax_rate') ? 'has-error' : '']">
<label for="tax_rate" class="required">{{ __('admin::app.configuration.taxrate.tax_rate') }}</label> <label for="tax_rate" class="required">{{ __('admin::app.configuration.tax-rates.tax_rate') }}</label>
<input v-validate="'required'" class="control" id="tax_rate" name="tax_rate" value="{{ $data['tax_rate'] }}" /> <input v-validate="'required'" class="control" id="tax_rate" name="tax_rate" value="{{ $data['tax_rate'] }}" />

View File

@ -1,19 +1,19 @@
@extends('admin::layouts.content') @extends('admin::layouts.content')
@section('page_title') @section('page_title')
{{ __('admin::app.configuration.taxrate.title') }} {{ __('admin::app.configuration.tax-rates.title') }}
@stop @stop
@section('content') @section('content')
<div class="content"> <div class="content">
<div class="page-header"> <div class="page-header">
<div class="page-title"> <div class="page-title">
<h1>{{ __('admin::app.configuration.taxrate.title') }}</h1> <h1>{{ __('admin::app.configuration.tax-rates.title') }}</h1>
</div> </div>
<div class="page-action"> <div class="page-action">
<a href="{{ route('admin.taxrate.show') }}" class="btn btn-lg btn-primary"> <a href="{{ route('admin.tax-rates.show') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrate.title') }} {{ __('admin::app.configuration.tax-rates.title') }}
</a> </a>
</div> </div>
</div> </div>

View File

@ -1,126 +0,0 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.taxrate.title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.taxrate.create') }}" @submit.prevent="onSubmit">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.configuration.taxrate.title') }}</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrule.create') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
<div class="control-group" :class="[errors.has('identifier') ? 'has-error' : '']">
<label for="identifier" class="required">{{ __('admin::app.configuration.taxrate.identifier') }}</label>
<input v-validate="'required'" class="control" id="identifier" name="identifier" value="{{ old('identifier') }}"/>
<span class="control-error" v-if="errors.has('identifier')">@{{ errors.first('identifier') }}</span>
</div>
<div class="control-group" :class="[errors.has('state') ? 'has-error' : '']">
<label for="state" class="required">{{ __('admin::app.configuration.taxrate.state') }}</label>
<input v-validate="'required'" class="control" id="state" name="state" value="{{ old('state') }}"/>
<span class="control-error" v-if="errors.has('state')">@{{ errors.first('state') }}</span>
</div>
<div class="control-group" :class="[errors.has('country') ? 'has-error' : '']">
<label for="country" class="required">{{ __('admin::app.configuration.taxrate.country') }}</label>
<input v-validate="'required'" class="control" id="country" name="country" value="{{ old('country') }}"/>
<span class="control-error" v-if="errors.has('country')">@{{ errors.first('country') }}</span>
</div>
<div class="control-group">
<span class="checkbox">
<input type="checkbox" id="is_zip" name="is_zip" onclick="myFunction()">
<label class="checkbox-view" for="is_zip"></label>
Enable Zip Range
</span>
</div>
<div class="control-group" :class="[errors.has('zip_code') ? 'has-error' : '']" id="zip_code">
<label for="zip_code">{{ __('admin::app.configuration.taxrate.zip_code') }}</label>
<input class="control" id="zip_code" name="zip_code" value="{{ old('zip_code') }}"/>
<span class="control-error" v-if="errors.has('zip_code')">@{{ errors.first('zip_code') }}</span>
</div>
<div class="control-group" :class="[errors.has('zip_from') ? 'has-error' : '']" id="zip_from">
<label for="zip_from">{{ __('admin::app.configuration.taxrate.zip_from') }}</label>
<input v-validate="'numeric'" class="control" name="zip_from" value="{{ old('zip_from') }}"/>
<span class="control-error" v-if="errors.has('zip_from')">@{{ errors.first('zip_from') }}</span>
</div>
<div class="control-group" :class="[errors.has('zip_to') ? 'has-error' : '']" id="zip_to">
<label for="zip_to">{{ __('admin::app.configuration.taxrate.zip_to') }}</label>
<input v-validate="'numeric'" class="control" name="zip_to" value="{{ old('zip_to') }}"/>
<span class="control-error" v-if="errors.has('zip_to')">@{{ errors.first('zip_to') }}</span>
</div>
<div class="control-group" :class="[errors.has('tax_rate') ? 'has-error' : '']">
<label for="tax_rate" class="required">{{ __('admin::app.configuration.taxrate.tax_rate') }}</label>
<input v-validate="'required'" class="control" id="tax_rate" name="tax_rate" value="{{ old('tax_rate') }}"/>
<span class="control-error" v-if="errors.has('tax_rate')">@{{ errors.first('tax_rate') }}</span>
</div>
</div>
</div>
</form>
</div>
@push('scripts')
<script>
window.onload = function () {
document.getElementById("zip_from").style.display = "none";
document.getElementById("zip_to").style.display = "none";
};
function myFunction() {
value = document.getElementById('is_zip').checked;
// console.log(value);
if(value) {
document.getElementById("zip_from").style.display = "";
document.getElementById("zip_to").style.display = "";
document.getElementById("zip_code").style.display = "none";
} else {
document.getElementById("zip_from").style.display = "none";
document.getElementById("zip_to").style.display = "none";
document.getElementById("zip_code").style.display = "";
}
}
</script>
@endpush
@stop

View File

@ -153,7 +153,7 @@ class Cart {
$itemData = $this->prepareItemData($id, $data); $itemData = $this->prepareItemData($id, $data);
if($itemData == false) { if(!$itemData) {
return false; return false;
} }

View File

@ -10,8 +10,9 @@ use Webkul\Core\Models\TaxCategory as TaxCategory;
use Webkul\Core\Models\TaxRate as TaxRate; use Webkul\Core\Models\TaxRate as TaxRate;
use Webkul\Core\Repositories\CurrencyRepository; use Webkul\Core\Repositories\CurrencyRepository;
use Webkul\Core\Repositories\ExchangeRateRepository; use Webkul\Core\Repositories\ExchangeRateRepository;
use Webkul\Core\Repositories\CountryRepository;
use Webkul\Core\Repositories\CountryStateRepository;
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
use PragmaRX\Countries\Package\Countries;
class Core class Core
{ {
@ -29,21 +30,43 @@ class Core
*/ */
protected $exchangeRateRepository; protected $exchangeRateRepository;
/**
* CountryRepository model
*
* @var mixed
*/
protected $countryRepository;
/**
* CountryStateRepository model
*
* @var mixed
*/
protected $countryStateRepository;
/** /**
* Create a new instance. * Create a new instance.
* *
* @param Webkul\Core\Repositories\CurrencyRepository $currencyRepository * @param Webkul\Core\Repositories\CurrencyRepository $currencyRepository
* @param Webkul\Core\Repositories\ExchangeRateRepository $exchangeRateRepository * @param Webkul\Core\Repositories\ExchangeRateRepository $exchangeRateRepository
* @param Webkul\Core\Repositories\CountryRepository $countryRepository
* @param Webkul\Core\Repositories\CountryStateRepository $countryStateRepository
* @return void * @return void
*/ */
public function __construct( public function __construct(
CurrencyRepository $currencyRepository, CurrencyRepository $currencyRepository,
ExchangeRateRepository $exchangeRateRepository ExchangeRateRepository $exchangeRateRepository,
CountryRepository $countryRepository,
CountryStateRepository $countryStateRepository
) )
{ {
$this->currencyRepository = $currencyRepository; $this->currencyRepository = $currencyRepository;
$this->exchangeRateRepository = $exchangeRateRepository; $this->exchangeRateRepository = $exchangeRateRepository;
$this->countryRepository = $countryRepository;
$this->countryStateRepository = $countryStateRepository;
} }
/** /**
@ -386,9 +409,7 @@ class Core
// $timezonelist = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL); // $timezonelist = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL);
/** /**
* Find all the tax * Find all the tax rates associated with a tax category.
* rates associated
* with a tax category.
* *
* @return Array * @return Array
*/ */
@ -398,8 +419,7 @@ class Core
} }
/** /**
* To fetch all * To fetch all tax rates.
* tax rates.
* *
* @return Collection * @return Collection
*/ */
@ -451,9 +471,7 @@ class Core
*/ */
public function countries() public function countries()
{ {
$countries = new Countries; return $this->countryRepository->all();
return $countries->all()->pluck('name.common', 'cca2');
} }
/** /**
@ -463,14 +481,7 @@ class Core
*/ */
public function states($countryCode) public function states($countryCode)
{ {
$countries = new Countries; return $this->countryStateRepository->findByField('country_code', $countryCode);
return $countries->where('cca2', $countryCode)
->first()
->hydrateStates()
->states
->sortBy('name')
->pluck('name', 'postal');
} }
/** /**
@ -482,8 +493,8 @@ class Core
{ {
$collection = []; $collection = [];
foreach ($this->countries() as $countryCode => $countryName) { foreach ($this->countries() as $country) {
$collection[$countryCode] = $this->states($countryCode)->toArray(); $collection[$country->code] = $this->states($country->code)->toArray();
} }
return $collection; return $collection;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,6 @@ class CreateCountriesTable extends Migration
$table->increments('id'); $table->increments('id');
$table->string('code'); $table->string('code');
$table->string('name'); $table->string('name');
$table->boolean('status')->default(0);
$table->timestamps();
}); });
} }

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCountryTranslationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('country_translations', function (Blueprint $table) {
$table->increments('id');
$table->string('locale');
$table->text('name')->nullable();
$table->integer('country_id')->unsigned();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('country_translations');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCountryStatesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('country_states', function (Blueprint $table) {
$table->increments('id');
$table->string('country_code')->nullable();
$table->string('code')->nullable();
$table->string('default_name')->nullable();
$table->integer('country_id')->nullable()->unsigned();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('country_states');
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCountryStateTranslationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('country_state_translations', function (Blueprint $table) {
$table->increments('id');
$table->string('locale');
$table->text('name')->nullable();
$table->integer('country_state_id')->unsigned();
$table->foreign('country_state_id')->references('id')->on('country_states')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('country_state_translations');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Webkul\Core\Database\Seeders;
use Illuminate\Database\Seeder;
use DB;
class CountriesTableSeeder extends Seeder
{
public function run()
{
DB::table('countries')->delete();
$countries = json_decode(file_get_contents(__DIR__ . '/../../Data/countries.json'), true);
DB::table('countries')->insert($countries);
}
}

View File

@ -3,16 +3,18 @@
namespace Webkul\Core\Database\Seeders; namespace Webkul\Core\Database\Seeders;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Webkul\Core\Models\Currency; use DB;
class CurrencyTableSeeder extends Seeder class CurrencyTableSeeder extends Seeder
{ {
public function run() public function run()
{ {
$currency = new Currency(); DB::table('currencies')->delete();
$locale->code = 'USD';
$locale->name = 'US Dollar'; DB::table('currencies')->insert([
$locale->symbol = '$'; 'code' => 'USD',
$locale->save(); 'name' => 'US Dollar',
'symbol' => '$',
]);
} }
} }

View File

@ -14,5 +14,8 @@ class DatabaseSeeder extends Seeder
public function run() public function run()
{ {
$this->call(LocalesTableSeeder::class); $this->call(LocalesTableSeeder::class);
$this->call(LocalesTableSeeder::class);
$this->call(CountriesTableSeeder::class);
$this->call(StatesTableSeeder::class);
} }
} }

View File

@ -3,22 +3,20 @@
namespace Webkul\Core\Database\Seeders; namespace Webkul\Core\Database\Seeders;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Webkul\Core\Models\Locale; use DB;
class LocalesTableSeeder extends Seeder class LocalesTableSeeder extends Seeder
{ {
public function run() public function run()
{ {
\Illuminate\Database\Eloquent\Model::reguard(); DB::table('locales')->delete();
$locale = new Locale(); DB::table('locales')->insert([
$locale->code = 'en'; 'code' => 'en',
$locale->name = 'English'; 'name' => 'English',
$locale->save(); ], [
'code' => 'fr',
$locale = new Locale(); 'name' => 'French',
$locale->code = 'fr'; ]);
$locale->name = 'French';
$locale->save();
} }
} }

View File

@ -0,0 +1,18 @@
<?php
namespace Webkul\Core\Database\Seeders;
use Illuminate\Database\Seeder;
use DB;
class StatesTableSeeder extends Seeder
{
public function run()
{
DB::table('country_states')->delete();
$states = json_decode(file_get_contents(__DIR__ . '/../../Data/states.json'), true);
DB::table('country_states')->insert($states);
}
}

View File

@ -1,96 +0,0 @@
<?php
namespace Webkul\Core\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Core\Repositories\CountryRepository as Country;
/**
* Country controller
*
* @author Jitendra Singh <jitendra@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CountryController extends Controller
{
/**
* Contains route related configuration
*
* @var array
*/
protected $_config;
/**
* CountryRepository object
*
* @var array
*/
protected $country;
/**
* Create a new controller instance.
*
* @param Webkul\Core\Repositories\CountryRepository $country
* @return void
*/
public function __construct(Country $country)
{
$this->middleware('admin');
$this->country = $country;
$this->_config = request('_config');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view($this->_config['view']);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view($this->_config['view']);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->validate(request(), [
'code' => 'required|unique:countries,code',
'name' => 'required'
]);
$this->country->create(request()->all());
session()->flash('success', 'Country created successfully.');
return redirect()->route($this->_config['redirect']);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}

View File

@ -6,12 +6,5 @@ use Illuminate\Database\Eloquent\Model;
class Country extends Model class Country extends Model
{ {
/** public $timestamps = false;
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'code', 'name'
];
} }

View File

@ -0,0 +1,10 @@
<?php
namespace Webkul\Core\Models;
use Illuminate\Database\Eloquent\Model;
class CountryState extends Model
{
public $timestamps = false;
}

View File

@ -0,0 +1,24 @@
<?php
namespace Webkul\Core\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* CountryState Reposotory
*
* @author Jitendra Singh <jitendra@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CountryStateRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Core\Models\CountryState';
}
}

View File

@ -5,6 +5,7 @@ namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository; use Webkul\Customer\Repositories\CustomerRepository;
use Auth; use Auth;
/** /**

View File

@ -6,7 +6,6 @@ use Illuminate\Http\Request;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Webkul\Core\Repositories\SliderRepository as Sliders; use Webkul\Core\Repositories\SliderRepository as Sliders;
use Webkul\Channel\Channel as Channel;
/** /**
* Home page controller * Home page controller
@ -28,7 +27,6 @@ use Webkul\Channel\Channel as Channel;
} }
public function index() { public function index() {
$current_channel = core()->getCurrentChannel(); $current_channel = core()->getCurrentChannel();
$all_sliders = $this->sliders->findWhere(['channel_id'=>$current_channel['id']]); $all_sliders = $this->sliders->findWhere(['channel_id'=>$current_channel['id']]);

View File

@ -12,10 +12,3 @@ $disc-price: #FF6472;
$disc-price-pro: #A5A5A5; $disc-price-pro: #A5A5A5;
$other-font-color: #5E5E5E; $other-font-color: #5E5E5E;
//shop variables ends here //shop variables ends here
//=======>Need to be removed
//customer variables
//customer variables ends here
//<=======Need to be removed

View File

@ -540,7 +540,7 @@ section.slider-block {
right:5px; right:5px;
} }
/* submenu positioning*/ /* submenu positioning */
.nav ul { .nav ul {
position: absolute; position: absolute;
@ -558,7 +558,6 @@ section.slider-block {
.nav > li:hover > ul { .nav > li:hover > ul {
left: auto; left: auto;
min-width: 100%; min-width: 100%;
} }
.nav > li li:hover { .nav > li li:hover {
@ -864,312 +863,6 @@ section.slider-block {
} }
} }
//customers page css goes here
.content {
padding-top: 15%;
padding-bottom: 15%;
.sign-up-text {
margin-bottom: 2%;
margin-left: auto;
margin-right: auto;
text-align: center;
font-size: 18px;
color: $font-color-light;
text-align: center;
}
.login-form {
margin-left: auto;
margin-right: auto;
display: flex;
border: 1px solid $border-color;
flex-direction: column;
max-width: 530px;
min-width: 380px;
min-height: 345px;
padding-left: 25px;
padding-right: 25px;
.login-text {
font-size: 24px;
font-weight: bold;
color: $font-color;
margin-top: 5%;
margin-bottom: 3%;
}
.control-group {
margin-bottom: 15px !important;
.control {
width: 100% !important;
}
}
.forgot-password-link {
font-size: 17px;
color: $brand-color;
margin-bottom: 5%;
}
.signup-confirm {
margin-bottom: 5%;
}
.btn-primary {
width: 100%;
text-transform: uppercase;
border-radius: 0px;
height: 45px;
margin-bottom: 4%;
}
}
}
//customer pages styles goes here
//account layout
.account-content {
width: 100%;
display: flex;
flex-direction: row;
margin-top: 5.5%;
margin-bottom: 5.5%;
.side-menu-title {
display: none;
}
.account-side-menu {
display: flex;
flex-direction: column;
align-content: center;
justify-content: flex-start;
border: 1px solid $border-color;
width: 25%;
height: 100%;
text-transform: capitalize;
color: $font-color-light;
li {
width: 95%;
height: 50px;
margin-left: 5%;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
border-bottom: 1px solid $border-color;
text-align: center;
}
li:first-child {
border-top: none;
}
li:last-child {
border-bottom: none;
}
li.active {
color: $brand-color;
}
}
.profile {
margin-left: 5.5%;
margin-top: 1%;
width: 100%;
.section-head {
.back-icon {
display: none;
}
.profile-heading {
font-size: 28px;
color: $font-color;
text-transform: capitalize;
text-align: left;
}
.profile-edit {
font-size: 17px;
margin-top: 1%;
color: $brand-color;
float: right;
}
.horizontal-rule {
margin-top: 1.1%;
width: 100%;
height: 1px;
vertical-align: middle;
background: $border-color;
}
}
}
.profile-content {
color: $other-font-color;
margin-top: 1.4%;
table {
tbody {
tr {
height: 45px;
td {
width: 250px;
text-transform: capitalize;
}
}
}
}
}
//edit form
.edit-form-content {
margin-left: 5.5%;
margin-top: 1%;
width: 100%;
.section-head {
.profile-heading {
font-size: 28px;
color: $font-color;
text-transform: capitalize;
text-align: left;
}
.profile-edit {
font-size: 17px;
margin-top: 1%;
color: $brand-color;
float: right;
}
.horizontal-rule {
margin-top: 1.1%;
width: 100%;
height: 1px;
vertical-align: middle;
background: $border-color;
}
}
.edit-text {
margin-bottom: 2%;
margin-left: auto;
margin-right: auto;
font-size: 24px;
}
.edit-form {
display: flex;
border: 1px solid $border-color;
flex-direction: column;
min-height: 345px;
padding: 25px;
}
}
//edit form ends
}
//account ends here
//account responsive layout start here
@media only screen and (max-width: 720px){
.account-content {
flex-direction: column;
.side-menu-title {
height: 48px;
padding-top: 13px;
border: 1px solid $border-color;
font-size: 18px;
display: inline-block;
.right {
float: right;
margin-top: 3px;
}
}
.account-side-menu {
width: 100%;
border: none;
margin-bottom: 20px;
display: none;
li {
width: 100%;
margin-left: 0%;
}
li a {
color: black;
}
li:last-child {
border-bottom: 1px solid $border-color;
}
}
.profile {
margin-left: 0px;
.section-head {
display: flex;
justify-content: space-between;
border-top: 1px solid $border-color;
border-bottom: 1px solid $border-color;
height: 50px;
padding-top: 7px;
.back-icon {
display: block;
cursor: pointer;
margin-top: 5px;
}
.horizontal-rule {
display: none;
}
}
}
.profile-content {
table {
tbody {
tr {
display: grid;
margin-bottom: 20px;
}
}
}
}
.edit-form-content {
margin-left: 0px;
.control-group .control {
width:100%;
}
}
}
}
//account responsive layout end here
//customers page css ends here
// product pages css starts here // product pages css starts here
section.product-detail { section.product-detail {
color: $font-color; color: $font-color;
@ -2120,54 +1813,148 @@ section.review {
} }
// review page end here // review page end here
// customer section css start here
.cusomer-section {
margin-left: 50px;
width:100%;
.customer-section-info { //customers auth page css goes here
display: flex; .auth-content {
flex-direction: row; padding-top: 15%;
border-top: 1px solid $border-color; padding-bottom: 15%;
.pro-img { .sign-up-text {
margin-top: 10px; margin-bottom: 2%;
margin-bottom: 5px; margin-left: auto;
margin-right: auto;
text-align: center;
font-size: 18px;
color: $font-color-light;
img { text-align: center;
height: 125px;
width: 100px;
}
}
.pro-discription {
margin-left: 20px;
width: 100%;
.title {
color: $brand-color;
margin-top: 15px;
}
.rating {
margin-top: 10px;
.icon {
height: 16px;
width: 16px;
}
}
.discription {
margin-top: 15px;
}
}
} }
.customer-section-info:last-child { .login-form {
border-bottom: 1px solid $border-color; margin-left: auto;
margin-right: auto;
display: flex;
border: 1px solid $border-color;
flex-direction: column;
max-width: 530px;
min-width: 380px;
min-height: 345px;
padding-left: 25px;
padding-right: 25px;
.login-text {
font-size: 24px;
font-weight: bold;
color: $font-color;
margin-top: 5%;
margin-bottom: 3%;
}
.control-group {
margin-bottom: 15px !important;
.control {
width: 100% !important;
}
}
.forgot-password-link {
font-size: 17px;
color: $brand-color;
margin-bottom: 5%;
}
.signup-confirm {
margin-bottom: 5%;
}
.btn-primary {
width: 100%;
text-transform: uppercase;
border-radius: 0px;
height: 45px;
margin-bottom: 4%;
}
} }
} }
// customer section css end here
//customer account pages layouts
.account-content {
width: 100%;
display: flex;
flex-direction: row;
margin-top: 5.5%;
margin-bottom: 5.5%;
.account-side-menu {
display: flex;
flex-direction: column;
align-content: center;
justify-content: flex-start;
border: 1px solid $border-color;
width: 25%;
height: 100%;
text-transform: capitalize;
color: $font-color-light;
li {
width: 95%;
height: 50px;
margin-left: 5%;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
border-bottom: 1px solid $border-color;
text-align: center;
}
li:first-child {
border-top: none;
}
li:last-child {
border-bottom: none;
}
li.active {
color: $brand-color;
}
}
//customer account pages content
.account-layout {
margin-left: 5.5%;
margin-top: 1%;
width: 100%;
}
}
//Account content inside a table
.account-table-content {
color: $font-color;
margin-top: 1.4%;
table {
tbody {
tr {
height: 45px;
td {
width: 250px;
text-transform: capitalize;
}
}
}
}
}
.edit-form {
display: flex;
border: 1px solid $border-color;
flex-direction: column;
min-height: 345px;
padding: 25px;
}

View File

@ -1,15 +1,15 @@
// product card, requires no changes for responsiveness. // product card, requires no changes for responsiveness.
.product-grid-4 { .product-grid-4 {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
grid-column-gap: 40px;
grid-row-gap: 15px;
grid-auto-rows: auto; grid-auto-rows: auto;
grid-column-gap: 48px;
grid-row-gap: 15px;
} }
.product-grid-3 { .product-grid-3 {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
grid-gap: 27px; grid-gap: 27px;
grid-auto-rows: auto; grid-auto-rows: auto;
} }
@ -102,46 +102,6 @@
} }
} }
//wishlist item
.wishlist-item {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
height: 125px;
.media-info {
display: flex;
flex-direction: row;
.media {
height: 125px;
width: 100px;
}
.info {
display: block;
margin-left: 20px;
}
}
.operations {
height: 120px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
a {
width: 100%;
span {
float: right;
}
}
}
}
//product page price styles //product page price styles
.product-price { .product-price {
margin-bottom: 14px; margin-bottom: 14px;
@ -170,3 +130,75 @@
height: 1px; height: 1px;
background: $border-color; background: $border-color;
} }
//Customer account section header
.account-head {
.account-heading {
font-size: 28px;
color: $font-color;
text-transform: capitalize;
text-align: left;
}
.account-edit {
font-size: 17px;
margin-top: 1%;
color: $brand-color;
float: right;
}
.horizontal-rule {
margin-top: 1.1%;
width: 100%;
height: 1px;
vertical-align: middle;
background: $border-color;
}
}
//denotes the item card that are used in account pages
.account-item-card {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
height: 125px;
.media-info {
display: flex;
flex-direction: row;
.media {
height: 125px;
width: 125px;
}
.info {
display: block;
margin-left: 20px;
}
}
.operations {
height: 120px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
a {
width: 100%;
span {
float: right;
}
}
}
}
//Account items list
.account-items-list {
display: block;
width: 100%;
}

View File

@ -55,6 +55,18 @@
height: 24px; height: 24px;
} }
.icon-menu {
background-image:URL('../images/icon-menu.svg');
width: 24px;
height: 24px;
}
.icon-search {
background-image:URL('../images/icon-search.svg');
width: 24px;
height: 24px;
}
.icon-menu-back { .icon-menu-back {
background-image:URL('../images/icon-menu-back.svg'); background-image:URL('../images/icon-menu-back.svg');
width: 24px; width: 24px;

View File

@ -199,6 +199,7 @@ return [
'address2' => 'Address 2', 'address2' => 'Address 2',
'city' => 'City', 'city' => 'City',
'state' => 'State', 'state' => 'State',
'select-state' => 'Select a region, state or province.',
'postcode' => 'Zip/Postcode', 'postcode' => 'Zip/Postcode',
'phone' => 'Telephone', 'phone' => 'Telephone',
'country' => 'Country', 'country' => 'Country',

View File

@ -142,6 +142,8 @@
selected_payment_method: '', selected_payment_method: '',
disable_button: false, disable_button: false,
countryStates: @json(core()->groupedStatesByCountries())
}), }),
methods: { methods: {
@ -152,6 +154,13 @@
} }
}, },
haveStates(addressType) {
if(this.countryStates[this.address[addressType].country] && this.countryStates[this.address[addressType].country].length)
return true;
return false;
},
validateForm: function (scope) { validateForm: function (scope) {
this.$validator.validateAll(scope).then((result) => { this.$validator.validateAll(scope).then((result) => {
if(result) { if(result) {

View File

@ -85,7 +85,18 @@
{{ __('shop::app.checkout.onepage.state') }} {{ __('shop::app.checkout.onepage.state') }}
</label> </label>
<input type="text" v-validate="'required'" class="control" id="billing[state]" name="billing[state]" v-model="address.billing.state"/>
<input type="text" v-validate="'required'" class="control" id="billing[state]" name="billing[state]" v-model="address.billing.state" v-if="!haveStates('billing')"/>
<select v-validate="'required'" class="control" id="billing[state]" name="billing[state]" v-model="address.billing.state" v-if="haveStates('billing')">
<option value="">{{ __('shop::app.checkout.onepage.select-state') }}</option>
<option v-for='(state, index) in countryStates[address.billing.country]' :value="state.code">
@{{ state.default_name }}
</option>
</select>
<span class="control-error" v-if="errors.has('address-form.billing[state]')"> <span class="control-error" v-if="errors.has('address-form.billing[state]')">
@{{ errors.first('address-form.billing[state]') }} @{{ errors.first('address-form.billing[state]') }}
@ -104,6 +115,26 @@
</span> </span>
</div> </div>
<div class="control-group" :class="[errors.has('address-form.billing[country]') ? 'has-error' : '']">
<label for="billing[country]" class="required">
{{ __('shop::app.checkout.onepage.country') }}
</label>
<select type="text" v-validate="'required'" class="control" id="billing[country]" name="billing[country]" v-model="address.billing.country">
<option value=""></option>
@foreach (core()->countries() as $country)
<option value="{{ $country->code }}">{{ $country->name }}</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('address-form.billing[country]')">
@{{ errors.first('address-form.billing[country]') }}
</span>
</div>
<div class="control-group" :class="[errors.has('address-form.billing[phone]') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('address-form.billing[phone]') ? 'has-error' : '']">
<label for="billing[phone]" class="required"> <label for="billing[phone]" class="required">
{{ __('shop::app.checkout.onepage.phone') }} {{ __('shop::app.checkout.onepage.phone') }}
@ -116,26 +147,6 @@
</span> </span>
</div> </div>
<div class="control-group" :class="[errors.has('address-form.billing[country]') ? 'has-error' : '']">
<label for="billing[country]" class="required">
{{ __('shop::app.checkout.onepage.country') }}
</label>
<select type="text" v-validate="'required'" class="control" id="billing[country]" name="billing[country]" v-model="address.billing.country">
<option value=""></option>
@foreach (core()->countries() as $code => $country)
<option value="{{ $code }}">{{ $country }}</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('address-form.billing[country]')">
@{{ errors.first('address-form.billing[country]') }}
</span>
</div>
<div class="control-group"> <div class="control-group">
<span class="checkbox"> <span class="checkbox">
<input type="checkbox" id="billing[use_for_shipping]" name="billing[use_for_shipping]" v-model="address.billing.use_for_shipping"/> <input type="checkbox" id="billing[use_for_shipping]" name="billing[use_for_shipping]" v-model="address.billing.use_for_shipping"/>
@ -225,7 +236,18 @@
{{ __('shop::app.checkout.onepage.state') }} {{ __('shop::app.checkout.onepage.state') }}
</label> </label>
<input type="text" v-validate="'required'" class="control" id="shipping[state]" name="shipping[state]" v-model="address.shipping.state"/>
<input type="text" v-validate="'required'" class="control" id="shipping[state]" name="shipping[state]" v-model="address.shipping.state" v-if="!haveStates('shipping')"/>
<select v-validate="'required'" class="control" id="shipping[state]" name="shipping[state]" v-model="address.shipping.state" v-if="haveStates('shipping')">
<option value="">{{ __('shop::app.checkout.onepage.select-state') }}</option>
<option v-for='(state, index) in countryStates[address.shipping.country]' :value="state.code">
@{{ state.default_name }}
</option>
</select>
<span class="control-error" v-if="errors.has('address-form.shipping[state]')"> <span class="control-error" v-if="errors.has('address-form.shipping[state]')">
@{{ errors.first('address-form.shipping[state]') }} @{{ errors.first('address-form.shipping[state]') }}
@ -244,6 +266,26 @@
</span> </span>
</div> </div>
<div class="control-group" :class="[errors.has('address-form.shipping[country]') ? 'has-error' : '']">
<label for="shipping[country]" class="required">
{{ __('shop::app.checkout.onepage.country') }}
</label>
<select type="text" v-validate="'required'" class="control" id="shipping[country]" name="shipping[country]" v-model="address.shipping.country">
<option value=""></option>
@foreach (core()->countries() as $country)
<option value="{{ $country->code }}">{{ $country->name }}</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('address-form.shipping[country]')">
@{{ errors.first('address-form.shipping[country]') }}
</span>
</div>
<div class="control-group" :class="[errors.has('address-form.shipping[phone]') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('address-form.shipping[phone]') ? 'has-error' : '']">
<label for="shipping[phone]" class="required"> <label for="shipping[phone]" class="required">
{{ __('shop::app.checkout.onepage.phone') }} {{ __('shop::app.checkout.onepage.phone') }}
@ -255,26 +297,6 @@
@{{ errors.first('address-form.shipping[phone]') }} @{{ errors.first('address-form.shipping[phone]') }}
</span> </span>
</div> </div>
<div class="control-group" :class="[errors.has('address-form.shipping[country]') ? 'has-error' : '']">
<label for="shipping[country]" class="required">
{{ __('shop::app.checkout.onepage.country') }}
</label>
<select type="text" v-validate="'required'" class="control" id="shipping[country]" name="shipping[country]" v-model="address.shipping.country">
<option value=""></option>
@foreach (core()->countries() as $code => $country)
<option value="{{ $code }}">{{ $country }}</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('address-form.shipping[country]')">
@{{ errors.first('address-form.shipping[country]') }}
</span>
</div>
</div> </div>
</form> </form>

View File

@ -10,13 +10,13 @@
@include('shop::customers.account.partials.sidemenu') @include('shop::customers.account.partials.sidemenu')
<div class="profile"> <div class="account-layout">
<div class="section-head"> <div class="account-head">
<span class="profile-heading">{{ __('shop::app.customer.account.address.index.title') }}</span> <span class="account-heading">{{ __('shop::app.customer.account.address.index.title') }}</span>
@if(!$address->isEmpty()) @if(!$address->isEmpty())
<span class="profile-edit"> <span class="account-edit">
<a href="{{ route('customer.address.edit') }}"> <a href="{{ route('customer.address.edit') }}">
{{ __('shop::app.customer.account.address.index.edit') }} {{ __('shop::app.customer.account.address.index.edit') }}
</a> </a>
@ -25,7 +25,7 @@
<div class="horizontal-rule"></div> <div class="horizontal-rule"></div>
</div> </div>
<div class="profile-content"> <div class="account-table-content">
@if($address->isEmpty()) @if($address->isEmpty())
<div>{{ __('shop::app.customer.account.address.index.empty') }}</div> <div>{{ __('shop::app.customer.account.address.index.empty') }}</div>
<br/> <br/>

View File

@ -6,13 +6,13 @@
<div class="account-content"> <div class="account-content">
@include('shop::customers.account.partials.sidemenu') @include('shop::customers.account.partials.sidemenu')
<div class="edit-form-content"> <div class="account-layout">
<div class="section-head mb-10"> <div class="account-head mb-10">
<div class="profile-heading">{{ __('shop::app.customer.account.address.create.title') }}</div> <div class="account-heading">{{ __('shop::app.customer.account.address.create.title') }}</div>
</div> </div>
<form method="post" action="{{ route('customer.address.create') }}" @submit.prevent="onSubmit"> <form method="post" action="{{ route('customer.address.create') }}" @submit.prevent="onSubmit">
<div class="edit-form"> <div class="account-table-content">
@csrf @csrf
<div class="control-group" :class="[errors.has('address1') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('address1') ? 'has-error' : '']">

View File

@ -6,15 +6,15 @@
<div class="account-content"> <div class="account-content">
@include('shop::customers.account.partials.sidemenu') @include('shop::customers.account.partials.sidemenu')
<div class="edit-form-content"> <div class="account-layout">
<div class="section-head mb-10"> <div class="account-head mb-10">
<div class="profile-heading">{{ __('shop::app.customer.account.address.edit.title') }}</div> <div class="account-heading">{{ __('shop::app.customer.account.address.edit.title') }}</div>
</div> </div>
<form method="post" action="{{ route('customer.address.edit') }}"> <form method="post" action="{{ route('customer.address.edit') }}">
<div class="edit-form"> <div class="account-table-content">
@csrf @csrf
<div class="control-group" :class="[errors.has('address1') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('address1') ? 'has-error' : '']">

View File

@ -9,10 +9,10 @@
@include('shop::customers.account.partials.sidemenu') @include('shop::customers.account.partials.sidemenu')
<div class="edit-form-content"> <div class="account-layout">
<div class="section-head mb-10"> <div class="account-head mb-10">
<div class="profile-heading">{{ __('shop::app.customer.account.profile.edit-profile.title') }}</div> <div class="account-heading">{{ __('shop::app.customer.account.profile.edit-profile.title') }}</div>
</div> </div>
<form method="post" action="{{ route('customer.profile.edit') }}"> <form method="post" action="{{ route('customer.profile.edit') }}">

View File

@ -8,16 +8,22 @@
@include('shop::customers.account.partials.sidemenu') @include('shop::customers.account.partials.sidemenu')
<div class="account profile"> <div class="account-layout">
<div class="account-head">
{{-- <span class="back-icon"><a href="{{ route('customer.account.index') }}"><i class="icon icon-menu-back"></i></a></span> --}}
<span class="account-heading">{{ __('shop::app.customer.account.profile.index.title') }}</span>
<span class="account-edit">
<a href="{{ route('customer.profile.edit') }}">{{ __('shop::app.customer.account.profile.index.edit') }}</a>
</span>
<div class="section-head">
<span class="back-icon"><a href="{{ route('customer.account.index') }}"><i class="icon icon-menu-back"></i></a></span>
<span class="profile-heading">{{ __('shop::app.customer.account.profile.index.title') }}</span>
<span class="profile-edit"><a href="{{ route('customer.profile.edit') }}">{{ __('shop::app.customer.account.profile.index.edit') }}</a></span>
<div class="horizontal-rule"></div> <div class="horizontal-rule"></div>
</div> </div>
<div class="profile-content"> <div class="account-table-content">
<table> <table>
<tbody> <tbody>
<tr> <tr>
@ -51,10 +57,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
@endsection @endsection

View File

@ -7,13 +7,13 @@
@include('shop::customers.account.partials.sidemenu') @include('shop::customers.account.partials.sidemenu')
<div class="profile"> <div class="account-layout">
<div class="section-head"> <div class="account-head">
<span class="profile-heading">{{ __('shop::app.wishlist.title') }}</span> <span class="account-heading">{{ __('shop::app.wishlist.title') }}</span>
@if(count($items)) @if(count($items))
<div class="profile-edit"> <div class="account-edit">
<a href="" style="margin-right: 15px;">{{ __('shop::app.wishlist.deleteall') }}</a> <a href="" style="margin-right: 15px;">{{ __('shop::app.wishlist.deleteall') }}</a>
<a href="">{{ __('shop::app.wishlist.moveall') }}</a> <a href="">{{ __('shop::app.wishlist.moveall') }}</a>
</div> </div>
@ -21,11 +21,11 @@
<div class="horizontal-rule"></div> <div class="horizontal-rule"></div>
</div> </div>
<div class="profile-content"> <div class="account-items-list">
@if(count($items)) @if(count($items))
@foreach($items as $item) @foreach($items as $item)
<div class="wishlist-item mb-10"> <div class="account-item-card mt-15 mb-15">
<div class="media-info"> <div class="media-info">
@php @php
$image = $productImageHelper->getProductBaseImage($item); $image = $productImageHelper->getProductBaseImage($item);

View File

@ -4,7 +4,7 @@
@endsection @endsection
@section('content-wrapper') @section('content-wrapper')
<div class="content"> <div class="auth-content">
<div class="sign-up-text"> <div class="sign-up-text">
{{ __('shop::app.customer.login-text.no_account') }} - <a href="{{ route('customer.register.index') }}">{{ __('shop::app.customer.login-form.title') }}</a> {{ __('shop::app.customer.login-text.no_account') }} - <a href="{{ route('customer.register.index') }}">{{ __('shop::app.customer.login-form.title') }}</a>

View File

@ -4,7 +4,7 @@
@endsection @endsection
@section('content-wrapper') @section('content-wrapper')
<div class="content"> <div class="auth-content">
<form method="post" action="{{ route('customer.forgot-password.store') }}"> <form method="post" action="{{ route('customer.forgot-password.store') }}">

View File

@ -4,7 +4,7 @@
@endsection @endsection
@section('content-wrapper') @section('content-wrapper')
<div class="content"> <div class="auth-content">
<div class="sign-up-text"> <div class="sign-up-text">
{{ __('shop::app.customer.signup-text.account_exists') }} - <a href="{{ route('customer.session.index') }}">{{ __('shop::app.customer.signup-text.title') }}</a> {{ __('shop::app.customer.signup-text.account_exists') }} - <a href="{{ route('customer.session.index') }}">{{ __('shop::app.customer.signup-text.title') }}</a>

View File

@ -2,7 +2,7 @@
@section('content-wrapper') @section('content-wrapper')
<div class="content"> <div class="auth-content">
<form method="post" action="{{ route('customer.reset-password.store') }}" > <form method="post" action="{{ route('customer.reset-password.store') }}" >

View File

@ -14,7 +14,7 @@
<li class="search-group"> <li class="search-group">
<input type="search" class="search-field" placeholder="Search for products"> <input type="search" class="search-field" placeholder="Search for products">
<div class="search-icon-wrapper"> <div class="search-icon-wrapper">
<span class="icon search-icon"></span> <span class="icon icon-search"></span>
</div> </div>
</li> </li>
</ul> </ul>
@ -169,7 +169,7 @@
</ul> </ul>
<ul class="right-responsive"> <ul class="right-responsive">
<li class="search-box"><span class="icon search-icon" id="search"></span></li> <li class="search-box"><span class="icon icon-search" id="search"></span></li>
<ul class="resp-account-dropdown-container"> <ul class="resp-account-dropdown-container">
<li class="account-dropdown"> <li class="account-dropdown">
@ -235,7 +235,7 @@
@endif @endif
</li> </li>
</ul> </ul>
<li class="menu-box" ><span class="icon sortable-icon" id="hammenu"></span></li> <li class="menu-box" ><span class="icon icon-menu" id="hammenu"></span></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -246,13 +246,13 @@
<div class="search-responsive"> <div class="search-responsive">
<div class="search-content"> <div class="search-content">
<i class="icon search-icon mt-10"></i> <i class="icon icon-search mt-10"></i>
<input class="search mt-5"> <input class="search mt-5">
<i class="icon icon-menu-back right mt-10"></i> <i class="icon icon-menu-back right mt-10"></i>
</div> </div>
<div class="search-content"> <div class="search-content">
<i class="icon search-icon mt-10"></i> <i class="icon icon-search mt-10"></i>
<span class="suggestion mt-15">Designer sarees</span> <span class="suggestion mt-15">Designer sarees</span>
</div> </div>
</div> </div>

View File

@ -33,8 +33,6 @@
@else @else
@if($product->type == "configurable") @if($product->type == "configurable")
<a href="{{ route('cart.add.configurable', $product->url_key) }}" class="btn btn-lg btn-primary addtocart">{{ __('shop::app.home.product-card.add-to-cart') }}</a> <a href="{{ route('cart.add.configurable', $product->url_key) }}" class="btn btn-lg btn-primary addtocart">{{ __('shop::app.home.product-card.add-to-cart') }}</a>
@include('shop::products.wishlist')
@else @else
<form action="{{route('cart.add', $product->id)}}" method="POST"> <form action="{{route('cart.add', $product->id)}}" method="POST">
@csrf @csrf
@ -43,6 +41,7 @@
<input type="hidden" value="false" name="is_configurable"> <input type="hidden" value="false" name="is_configurable">
<button class="btn btn-lg btn-primary addtocart">{{ __('shop::app.home.product-card.add-to-cart') }}</button> <button class="btn btn-lg btn-primary addtocart">{{ __('shop::app.home.product-card.add-to-cart') }}</button>
</form> </form>
@include('shop::products.wishlist')
@endif @endif
@endif @endif
</div> </div>

View File

@ -77,8 +77,6 @@ class TaxCategoryController extends Controller
'description' => 'required|string' 'description' => 'required|string'
]); ]);
dd($data);
if($currentTaxRule = $this->taxRule->create(request()->input())) { if($currentTaxRule = $this->taxRule->create(request()->input())) {
$allTaxRules = $data['taxrates']; $allTaxRules = $data['taxrates'];

View File

@ -15,6 +15,14 @@ class TaxServiceProvider extends ServiceProvider
public function boot(Router $router) public function boot(Router $router)
{ {
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
}
/**
* Register services.
*
* @return void
*/
public function register()
{
} }
} }

View File

@ -55,6 +55,18 @@
height: 24px; height: 24px;
} }
.icon-menu {
background-image: URL("../images/icon-menu.svg");
width: 24px;
height: 24px;
}
.icon-search {
background-image: URL("../images/icon-search.svg");
width: 24px;
height: 24px;
}
.icon-menu-back { .icon-menu-back {
background-image: URL("../images/icon-menu-back.svg"); background-image: URL("../images/icon-menu-back.svg");
width: 24px; width: 24px;
@ -111,15 +123,15 @@
.product-grid-4 { .product-grid-4 {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
grid-column-gap: 40px;
grid-row-gap: 15px;
grid-auto-rows: auto; grid-auto-rows: auto;
grid-column-gap: 48px;
grid-row-gap: 15px;
} }
.product-grid-3 { .product-grid-3 {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
grid-gap: 27px; grid-gap: 27px;
grid-auto-rows: auto; grid-auto-rows: auto;
} }
@ -205,69 +217,6 @@
background-image: url("../images/wishadd.svg"); background-image: url("../images/wishadd.svg");
} }
.wishlist-item {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 125px;
}
.wishlist-item .media-info {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
}
.wishlist-item .media-info .media {
height: 125px;
width: 100px;
}
.wishlist-item .media-info .info {
display: block;
margin-left: 20px;
}
.wishlist-item .operations {
height: 120px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.wishlist-item .operations a {
width: 100%;
}
.wishlist-item .operations a span {
float: right;
}
.product-price { .product-price {
margin-bottom: 14px; margin-bottom: 14px;
width: 100%; width: 100%;
@ -295,6 +244,96 @@
background: #E8E8E8; background: #E8E8E8;
} }
.account-head .account-heading {
font-size: 28px;
color: #242424;
text-transform: capitalize;
text-align: left;
}
.account-head .account-edit {
font-size: 17px;
margin-top: 1%;
color: #0031F0;
float: right;
}
.account-head .horizontal-rule {
margin-top: 1.1%;
width: 100%;
height: 1px;
vertical-align: middle;
background: #E8E8E8;
}
.account-item-card {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 125px;
}
.account-item-card .media-info {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
}
.account-item-card .media-info .media {
height: 125px;
width: 125px;
}
.account-item-card .media-info .info {
display: block;
margin-left: 20px;
}
.account-item-card .operations {
height: 120px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.account-item-card .operations a {
width: 100%;
}
.account-item-card .operations a span {
float: right;
}
.account-items-list {
display: block;
width: 100%;
}
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -1085,7 +1124,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
border-top: 1px solid lightgrey; border-top: 1px solid lightgrey;
border-bottom: 1px solid lightgrey; border-bottom: 1px solid lightgrey;
display: block; display: block;
/* submenu positioning*/ /* submenu positioning */
} }
.header .header-bottom ul.nav { .header .header-bottom ul.nav {
@ -1485,6 +1524,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
text-align: center; text-align: center;
} }
<<<<<<< HEAD
.content { .content {
padding-top: 15%; padding-top: 15%;
padding-bottom: 15%; padding-bottom: 15%;
@ -1785,6 +1825,8 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
} }
} }
=======
>>>>>>> 4bd252edde6f5f1b7ccb356b0c09c593c9fc0cfc
section.product-detail { section.product-detail {
color: #242424; color: #242424;
} }
@ -2757,12 +2799,75 @@ section.review .review-layouter .review-info .review-detail .rating-calculate .p
border: 1px solid blue; border: 1px solid blue;
} }
.cusomer-section { .auth-content {
margin-left: 50px; padding-top: 15%;
width: 100%; padding-bottom: 15%;
} }
.cusomer-section .customer-section-info { .auth-content .sign-up-text {
margin-bottom: 2%;
margin-left: auto;
margin-right: auto;
text-align: center;
font-size: 18px;
color: #A5A5A5;
text-align: center;
}
.auth-content .login-form {
margin-left: auto;
margin-right: auto;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
border: 1px solid #E8E8E8;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
max-width: 530px;
min-width: 380px;
min-height: 345px;
padding-left: 25px;
padding-right: 25px;
}
.auth-content .login-form .login-text {
font-size: 24px;
font-weight: bold;
color: #242424;
margin-top: 5%;
margin-bottom: 3%;
}
.auth-content .login-form .control-group {
margin-bottom: 15px !important;
}
.auth-content .login-form .control-group .control {
width: 100% !important;
}
.auth-content .login-form .forgot-password-link {
font-size: 17px;
color: #0031F0;
margin-bottom: 5%;
}
.auth-content .login-form .signup-confirm {
margin-bottom: 5%;
}
.auth-content .login-form .btn-primary {
width: 100%;
text-transform: uppercase;
border-radius: 0px;
height: 45px;
margin-bottom: 4%;
}
.account-content {
width: 100%;
display: -webkit-box; display: -webkit-box;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
@ -2770,42 +2875,92 @@ section.review .review-layouter .review-info .review-detail .rating-calculate .p
-webkit-box-direction: normal; -webkit-box-direction: normal;
-ms-flex-direction: row; -ms-flex-direction: row;
flex-direction: row; flex-direction: row;
border-top: 1px solid #E8E8E8; margin-top: 5.5%;
margin-bottom: 5.5%;
} }
.cusomer-section .customer-section-info .pro-img { .account-content .account-side-menu {
margin-top: 10px; display: -webkit-box;
margin-bottom: 5px; display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-ms-flex-line-pack: center;
align-content: center;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
border: 1px solid #E8E8E8;
width: 25%;
height: 100%;
text-transform: capitalize;
color: #A5A5A5;
} }
.cusomer-section .customer-section-info .pro-img img { .account-content .account-side-menu li {
height: 125px; width: 95%;
width: 100px; height: 50px;
margin-left: 5%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border-bottom: 1px solid #E8E8E8;
text-align: center;
} }
.cusomer-section .customer-section-info .pro-discription { .account-content .account-side-menu li:first-child {
margin-left: 20px; border-top: none;
}
.account-content .account-side-menu li:last-child {
border-bottom: none;
}
.account-content .account-side-menu li.active {
color: #0031F0;
}
.account-content .account-layout {
margin-left: 5.5%;
margin-top: 1%;
width: 100%; width: 100%;
} }
.cusomer-section .customer-section-info .pro-discription .title { .account-table-content {
color: #0031F0; color: #242424;
margin-top: 15px; margin-top: 1.4%;
} }
.cusomer-section .customer-section-info .pro-discription .rating { .account-table-content table tbody tr {
margin-top: 10px; height: 45px;
} }
.cusomer-section .customer-section-info .pro-discription .rating .icon { .account-table-content table tbody tr td {
height: 16px; width: 250px;
width: 16px; text-transform: capitalize;
} }
.cusomer-section .customer-section-info .pro-discription .discription { .edit-form {
margin-top: 15px; display: -webkit-box;
} display: -ms-flexbox;
display: flex;
.cusomer-section .customer-section-info:last-child { border: 1px solid #E8E8E8;
border-bottom: 1px solid #E8E8E8; -webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
min-height: 345px;
padding: 25px;
} }