Merge branch 'master' of https://github.com/bagisto/bagisto into velocity-updated

This commit is contained in:
shubhammehrotra.symfony@webkul.com 2020-02-11 17:50:03 +05:30
commit afa4ea627c
10 changed files with 186 additions and 224 deletions

View File

@ -55,7 +55,6 @@ class InvoiceController extends Controller
$this->orderRepository = $orderRepository;
$this->invoiceRepository = $invoiceRepository;
}
/**

View File

@ -71,9 +71,9 @@ class ChannelController extends Controller
'code' => ['required', 'unique:channels,code', new \Webkul\Core\Contracts\Validations\Code],
'name' => 'required',
'locales' => 'required|array|min:1',
'default_locale_id' => 'required',
'default_locale_id' => 'required|in_array:locales.*',
'currencies' => 'required|array|min:1',
'base_currency_id' => 'required',
'base_currency_id' => 'required|in_array:currencies.*',
'root_category_id' => 'required',
'logo.*' => 'mimes:jpeg,jpg,bmp,png',
'favicon.*' => 'mimes:jpeg,jpg,bmp,png',
@ -134,9 +134,9 @@ class ChannelController extends Controller
'name' => 'required',
'locales' => 'required|array|min:1',
'inventory_sources' => 'required|array|min:1',
'default_locale_id' => 'required',
'default_locale_id' => 'required|in_array:locales.*',
'currencies' => 'required|array|min:1',
'base_currency_id' => 'required',
'base_currency_id' => 'required|in_array:currencies.*',
'root_category_id' => 'required',
'logo.*' => 'mimes:jpeg,jpg,bmp,png',
'favicon.*' => 'mimes:jpeg,jpg,bmp,png',

View File

@ -54,7 +54,7 @@ abstract class AbstractShipping
*
* @return array
*/
public function getDecription()
public function getDescription()
{
return $this->getConfigData('decription');
}

View File

@ -107,4 +107,29 @@ class Shipping
return $rates;
}
/**
* Returns active shipping methods
*
* @return array
*/
public function getShippingMethods()
{
$methods = [];
foreach (Config::get('carriers') as $shippingMethod) {
$object = new $shippingMethod['class'];
if (! $object->isAvailable())
continue;
$methods[] = [
'method' => $object->getCode(),
'method_title' => $object->getTitle(),
'description' => $object->getDescription()
];
}
return $methods;
}
}

View File

@ -60,7 +60,7 @@
</span>
</div>
<div :class="`col-12 form-field ${errors.has('address-form.shipping[address1][]') ? 'has-error' : ''}`">
<div :class="`col-12 form-field ${errors.has('address-form.shipping[address1][]') ? 'has-error' : ''}`" style="margin-bottom: 0;">
<label for="shipping_address_0" class="mandatory">
{{ __('shop::app.checkout.onepage.address1') }}
</label>
@ -83,19 +83,19 @@
core()->getConfigData('customer.settings.address.street_lines')
&& core()->getConfigData('customer.settings.address.street_lines') > 1
)
<div class="col-12 form-field">
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
<div class="col-12 form-field" style="margin-top: 10px; margin-bottom: 0">
<input
type="text"
class="control"
id="shipping_address_{{ $i }}"
name="shipping[address1][{{ $i }}]"
v-model="address.shipping.address1[{{$i}}]" />
@endfor
</div>
</div>
@endfor
@endif
<div :class="`col-12 form-field ${errors.has('address-form.shipping[city]') ? 'has-error' : ''}`">
<div :class="`col-12 form-field ${errors.has('address-form.shipping[city]') ? 'has-error' : ''}`" style="margin-top: 15px;">
<label for="shipping[city]" class="mandatory">
{{ __('shop::app.checkout.onepage.city') }}
</label>
@ -321,7 +321,7 @@
</span>
</div>
<div :class="`col-12 form-field ${errors.has('address-form.billing[address1][]') ? 'has-error' : ''}`">
<div :class="`col-12 form-field ${errors.has('address-form.billing[address1][]') ? 'has-error' : ''}`" style="margin-bottom: 0;">
<label for="billing_address_0" class="mandatory">
{{ __('shop::app.checkout.onepage.address1') }}
</label>
@ -345,19 +345,19 @@
core()->getConfigData('customer.settings.address.street_lines')
&& core()->getConfigData('customer.settings.address.street_lines') > 1
)
<div class="col-12 form-field" style="margin-top: -25px;">
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
<input
type="text"
class="control"
id="billing_address_{{ $i }}"
name="billing[address1][{{ $i }}]"
v-model="address.billing.address1[{{$i}}]" />
@endfor
</div>
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
<div class="col-12 form-field" style="margin-top: 10px; margin-bottom: 0">
<input
type="text"
class="control"
id="billing_address_{{ $i }}"
name="billing[address1][{{ $i }}]"
v-model="address.billing.address1[{{$i}}]" />
</div>
@endfor
@endif
<div :class="`col-12 form-field ${errors.has('address-form.billing[city]') ? 'has-error' : ''}`">
<div :class="`col-12 form-field ${errors.has('address-form.billing[city]') ? 'has-error' : ''}`" style="margin-top: 15px;">
<label for="billing[city]" class="mandatory">
{{ __('shop::app.checkout.onepage.city') }}
</label>
@ -510,9 +510,9 @@
<input
class="ml0"
type="checkbox"
@change="validateForm('address-form')"
id="billing[save_as_address]"
name="billing[save_as_address]" v-model="address.billing.save_as_address"/>
<span class="ml-5">
{{ __('shop::app.checkout.onepage.save_as_address') }}
</span>

View File

@ -57,11 +57,11 @@
</div>
@if (core()->getConfigData('customer.settings.address.street_lines') && core()->getConfigData('customer.settings.address.street_lines') > 1)
<div class="control-group" style="margin-top: -25px;">
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
<div class="control-group" style="margin-top: -25px;">
<input type="text" class="control" name="address1[{{ $i }}]" id="address_{{ $i }}" value="{{ $addresses[$i] ?? '' }}">
@endfor
</div>
</div>
@endfor
@endif
@include ('shop::customers.account.address.country-state', ['countryCode' => old('country'), 'stateCode' => old('state')])

View File

@ -31,19 +31,19 @@
</div>
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
<label for="first_name" class="required">{{ __('shop::app.customer.account.address.create.first_name') }}</label>
<label for="first_name" class="mandatory">{{ __('shop::app.customer.account.address.create.first_name') }}</label>
<input type="text" class="control" name="first_name" value="{{ old('first_name') ?? $address->first_name }}" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.first_name') }}&quot;">
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
</div>
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
<label for="last_name" class="required">{{ __('shop::app.customer.account.address.create.last_name') }}</label>
<label for="last_name" class="mandatory">{{ __('shop::app.customer.account.address.create.last_name') }}</label>
<input type="text" class="control" name="last_name" value="{{ old('last_name') ?? $address->last_name }}" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.last_name') }}&quot;">
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
</div>
<div class="control-group" :class="[errors.has('vat_id') ? 'has-error' : '']">
<label for="vat_id" class="required">{{ __('shop::app.customer.account.address.create.vat_id') }}
<label for="vat_id">{{ __('shop::app.customer.account.address.create.vat_id') }}
<span class="help-note">{{ __('shop::app.customer.account.address.create.vat_help_note') }}</span>
</label>
<input type="text" class="control" name="vat_id" value="{{ old('vat_id') ?? $address->vat_id }}" v-validate="" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.vat_id') }}&quot;">
@ -51,35 +51,35 @@
</div>
<div class="control-group" :class="[errors.has('address1[]') ? 'has-error' : '']">
<label for="address_0" class="required">{{ __('shop::app.customer.account.address.edit.street-address') }}</label>
<label for="address_0" class="mandatory">{{ __('shop::app.customer.account.address.edit.street-address') }}</label>
<input type="text" class="control" name="address1[]" value="{{ isset($addresses[0]) ? $addresses[0] : '' }}" id="address_0" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.street-address') }}&quot;">
<span class="control-error" v-if="errors.has('address1[]')">@{{ errors.first('address1[]') }}</span>
</div>
@if (core()->getConfigData('customer.settings.address.street_lines') && core()->getConfigData('customer.settings.address.street_lines') > 1)
<div class="control-group" style="margin-top: -25px;">
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
<div class="control-group" style="margin-top: -25px;">
<input type="text" class="control" name="address1[{{ $i }}]" id="address_{{ $i }}" value="{{ $addresses[$i] ?? '' }}">
@endfor
</div>
</div>
@endfor
@endif
@include ('shop::customers.account.address.country-state', ['countryCode' => old('country') ?? $address->country, 'stateCode' => old('state') ?? $address->state])
<div class="control-group" :class="[errors.has('city') ? 'has-error' : '']">
<label for="city" class="required">{{ __('shop::app.customer.account.address.create.city') }}</label>
<label for="city" class="mandatory">{{ __('shop::app.customer.account.address.create.city') }}</label>
<input type="text" class="control" name="city" value="{{ old('city') ?? $address->city }}" v-validate="'required|alpha_spaces'" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.city') }}&quot;">
<span class="control-error" v-if="errors.has('city')">@{{ errors.first('city') }}</span>
</div>
<div class="control-group" :class="[errors.has('postcode') ? 'has-error' : '']">
<label for="postcode" class="required">{{ __('shop::app.customer.account.address.create.postcode') }}</label>
<label for="postcode" class="mandatory">{{ __('shop::app.customer.account.address.create.postcode') }}</label>
<input type="text" class="control" name="postcode" value="{{ old('postcode') ?? $address->postcode }}" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.postcode') }}&quot;">
<span class="control-error" v-if="errors.has('postcode')">@{{ errors.first('postcode') }}</span>
</div>
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
<label for="phone" class="required">{{ __('shop::app.customer.account.address.create.phone') }}</label>
<label for="phone" class="mandatory">{{ __('shop::app.customer.account.address.create.phone') }}</label>
<input type="text" class="control" name="phone" value="{{ old('phone') ?? $address->phone }}" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.phone') }}&quot;">
<span class="control-error" v-if="errors.has('phone')">@{{ errors.first('phone') }}</span>
</div>

View File

@ -6,11 +6,9 @@
@section('page-detail-wrapper')
<div class="account-head">
<span class="back-icon">
<a href="{{ route('customer.account.index') }}">
<i class="icon icon-menu-back"></i>
</a>
</span>
<a href="{{ route('customer.session.destroy') }}" class="theme-btn light unset pull-right">
{{ __('shop::app.header.logout') }}
</a>
<h1 class="account-heading">
{{ __('shop::app.customer.account.profile.index.title') }}

View File

@ -4,175 +4,135 @@
{{ __('shop::app.customer.account.profile.index.title') }}
@endsection
@push('css')
<style type="text/css">
.account-head {
height: 50px;
}
.table {
width: 70%;
padding: 10px;
}
.table > table {
color: #5E5E5E;
width:100%;
border: 1px solid rgba(0,0,0,.125);
}
.table td {
padding: 5px;
border: unset;
}
.remove-icon {
right: 15px;
font-size: 22px;
height: 24px;
text-align: center;
position: absolute;
border-radius: 50%;
color: #333;
width: 24px;
padding: 0px;
top: 10px;
}
.remove-icon:before {
content: "x";
}
</style>
@endpush
@section('page-detail-wrapper')
<div class="account-head">
<a href="{{ route('customer.session.destroy') }}" class="theme-btn light unset pull-right">
{{ __('shop::app.header.logout') }}
</a>
<h1 class="account-heading">
<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') }}
</h1>
</span>
<span class="account-action">
<a href="{{ route('customer.profile.edit') }}" class="theme-btn light unset pull-right">
{{ __('shop::app.customer.account.profile.index.edit') }}
</a>
</span>
<div class="horizontal-rule"></div>
</div>
{!! view_render_event('bagisto.shop.customers.account.profile.view.before', ['customer' => $customer]) !!}
<div class="profile-update-form">
<form
method="POST"
@submit.prevent="onSubmit"
class="account-table-content"
action="{{ route('customer.profile.edit') }}">
<div class="account-table-content">
<div class="table">
<table>
<tbody>
{!! view_render_event(
'bagisto.shop.customers.account.profile.view.table.before', ['customer' => $customer])
!!}
@csrf
<tr>
<td>{{ __('shop::app.customer.account.profile.fname') }}</td>
<td>{{ $customer->first_name }}</td>
</tr>
<div :class="`row ${errors.has('first_name') ? 'has-error' : ''}`">
<label class="col-12 mandatory">
{{ __('shop::app.customer.account.profile.fname') }}
</label>
<tr>
<td>{{ __('shop::app.customer.account.profile.lname') }}</td>
<td>{{ $customer->last_name }}</td>
</tr>
<div class="col-12">
<input value="{{ $customer->first_name }}" name="first_name" type="text" v-validate="'required'" />
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
</div>
</div>
<tr>
<td>{{ __('shop::app.customer.account.profile.gender') }}</td>
<td>{{ $customer->gender ?? '-' }}</td>
</tr>
<div class="row">
<label class="col-12">
{{ __('shop::app.customer.account.profile.lname') }}
</label>
<tr>
<td>{{ __('shop::app.customer.account.profile.dob') }}</td>
<td>{{ $customer->date_of_birth ?? '-' }}</td>
</tr>
<div class="col-12">
<input value="{{ $customer->last_name }}" name="last_name" type="text" />
</div>
</div>
<tr>
<td>{{ __('shop::app.customer.account.profile.email') }}</td>
<td>{{ $customer->email }}</td>
</tr>
<div :class="`row ${errors.has('gender') ? 'has-error' : ''}`">
<label class="col-12 mandatory">
{{ __('shop::app.customer.account.profile.gender') }}
</label>
<div class="col-12">
<select
name="gender"
v-validate="'required'"
class="control styled-select"
data-vv-as="&quot;{{ __('shop::app.customer.account.profile.gender') }}&quot;">
<option value="" @if ($customer->gender == "") selected @endif></option>
<option
value="Other"
@if ($customer->gender == "Other")
selected="selected"
@endif>
{{ __('velocity::app.shop.gender.other') }}
</option>
<option
value="Male"
@if ($customer->gender == "Male")
selected="selected"
@endif>
{{ __('velocity::app.shop.gender.male') }}
</option>
<option
value="Female"
@if ($customer->gender == "Female")
selected="selected"
@endif>
{{ __('velocity::app.shop.gender.female') }}
</option>
</select>
<div class="select-icon-container">
<span class="select-icon rango-arrow-down"></span>
</div>
<span class="control-error" v-if="errors.has('gender')">@{{ errors.first('gender') }}</span>
</div>
</div>
<div :class="`row ${errors.has('date_of_birth') ? 'has-error' : ''}`">
<label class="col-12">
{{ __('shop::app.customer.account.profile.dob') }}
</label>
<div class="col-12">
<input
type="date"
name="date_of_birth"
placeholder="dd/mm/yyyy"
value="{{ old('date_of_birth') ?? $customer->date_of_birth }}"
v-validate="" data-vv-as="&quot;{{ __('shop::app.customer.account.profile.dob') }}&quot;" />
<span class="control-error" v-if="errors.has('date_of_birth')">
@{{ errors.first('date_of_birth') }}
</span>
</div>
</div>
<div class="row">
<label class="col-12 mandatory">
{{ __('shop::app.customer.account.profile.email') }}
</label>
<div class="col-12">
<input value="{{ $customer->email }}" name="email" type="text" v-validate="'required'" />
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
</div>
</div>
<div class="row">
<label class="col-12">
{{ __('velocity::app.shop.general.enter-current-password') }}
</label>
<div :class="`col-12 ${errors.has('oldpassword') ? 'has-error' : ''}`">
<input value="" name="oldpassword" type="password" />
</div>
</div>
<div class="row">
<label class="col-12">
{{ __('velocity::app.shop.general.new-password') }}
</label>
<div :class="`col-12 ${errors.has('password') ? 'has-error' : ''}`">
<input
value=""
name="password"
type="password"
v-validate="'min:6|max:18'" />
<span class="control-error" v-if="errors.has('password')">
@{{ errors.first('password') }}
</span>
</div>
</div>
<div class="row">
<label class="col-12">
{{ __('velocity::app.shop.general.confirm-new-password') }}
</label>
<div :class="`col-12 ${errors.has('password_confirmation') ? 'has-error' : ''}`">
<input value="" name="password_confirmation" type="password"
v-validate="'min:6|confirmed:password'" data-vv-as="confirm password" />
<span class="control-error" v-if="errors.has('password_confirmation')">
@{{ errors.first('password_confirmation') }}
</span>
</div>
</div>
<button
type="submit"
class="theme-btn mb20">
{{ __('velocity::app.shop.general.update') }}
</button>
</form>
{!! view_render_event(
'bagisto.shop.customers.account.profile.view.table.after', ['customer' => $customer])
!!}
</tbody>
</table>
</div>
<button
type="submit"
class="theme-btn mb20" @click="showModal('deleteProfile')" >
{{ __('shop::app.customer.account.address.index.delete') }}
</button>
<form method="POST" action="{{ route('customer.profile.destroy') }}" @submit.prevent="onSubmit">
@csrf
<modal id="deleteProfile" :is-open="modalIds.deleteProfile">
<h3 slot="header">{{ __('shop::app.customer.account.address.index.enter-password') }}
</h3>
<i class="rango-close"></i>
<div slot="body">
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
<label for="password" class="required">{{ __('admin::app.users.users.password') }}</label>
<input type="password" v-validate="'required|min:6|max:18'" class="control" id="password" name="password" data-vv-as="&quot;{{ __('admin::app.users.users.password') }}&quot;"/>
<span class="control-error" v-if="errors.has('password')">@{{ errors.first('password') }}</span>
</div>
<div class="page-action">
<button type="submit" class="theme-btn mb20">
{{ __('shop::app.customer.account.address.index.delete') }}
</button>
</div>
</div>
</modal>
</form>
</div>
{!! view_render_event('bagisto.shop.customers.account.profile.view.after', ['customer' => $customer]) !!}
@endsection

View File

@ -1,23 +1,3 @@
@php
$activeShippings = [];
$activePayments = [];
$shippings = core()->getConfigData('sales.carriers');
$payments = core()->getConfigData('sales.paymentmethods');
foreach($shippings as $ship) {
if ($ship['active'] == "true") {
array_push($activeShippings, $ship['title']);
}
}
foreach($payments as $payment) {
if ($payment['active'] == "true") {
array_push($activePayments, $payment['title']);
}
}
@endphp
<div class="col-lg-4 col-md-12 col-sm-12 footer-rt-content">
<div class="row">
<div class="mb5 col-12">
@ -25,9 +5,9 @@
</div>
<div class="payment-methods col-12">
@foreach($activePayments as $paymentMethod)
@foreach(\Webkul\Payment\Facades\Payment::getPaymentMethods() as $method)
<div class="method-sticker">
{{ $paymentMethod}}
{{ $method['method_title'] }}
</div>
@endforeach
</div>
@ -39,9 +19,9 @@
</div>
<div class="shipping-methods col-12">
@foreach($activeShippings as $shippingMethod)
@foreach(\Webkul\Shipping\Facades\Shipping::getShippingMethods() as $method)
<div class="method-sticker">
{{ $shippingMethod}}
{{ $method['method_title'] }}
</div>
@endforeach
</div>