Merge pull request #418 from prashant-webkul/development

Development
This commit is contained in:
JItendra Singh 2018-12-27 16:34:07 +05:30 committed by GitHub
commit 857db4f244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 13 deletions

View File

@ -229,6 +229,10 @@ class Cart {
$product = $this->product->findOneByField('id', $id);
if($product->type == 'configurable') {
if(!isset($data['selected_configurable_option'])) {
return false;
}
$parentProduct = $this->product->findOneByField('id', $data['selected_configurable_option']);
$canAdd = $parentProduct->haveSufficientQuantity($data['quantity']);
@ -537,16 +541,24 @@ class Cart {
{
$cart = null;
if(auth()->guard('customer')->check()) {
if (auth()->guard('customer')->check()) {
$cart = $this->cart->findOneWhere([
'customer_id' => auth()->guard('customer')->user()->id,
'is_active' => 1
]);
'customer_id' => auth()->guard('customer')->user()->id,
'is_active' => 1
]);
} elseif(session()->has('cart')) {
} elseif (session()->has('cart')) {
$cart = $this->cart->find(session()->get('cart')->id);
}
if($cart != null) {
if($cart->items->count() == 0) {
$this->cart->delete($cart->id);
return false;
}
}
return $cart && $cart->is_active ? $cart : null;
}

View File

@ -58,7 +58,7 @@ class RegistrationController extends Controller
'last_name' => 'string|required',
'email' => 'email|required|unique:customers,email',
'password' => 'confirmed|min:6|required',
'agreement' => 'required'
// 'agreement' => 'required'
]);
$data = request()->input();

View File

@ -9,7 +9,7 @@
<div style="display: inline-block; cursor: pointer;">
<span class="name">
Cart
<span class="count"> ({{ intval($cart->items_qty) }})</span>
<span class="count"> ({{ $cart->items->count() }})</span>
</span>
</div>

View File

@ -63,15 +63,15 @@
</div> --}}
{!! view_render_event('bagisto.shop.customers.signup_form_controls.after') !!}
<div class="control-group" :class="[errors.has('agreement') ? 'has-error' : '']">
{{-- <div class="control-group" :class="[errors.has('agreement') ? 'has-error' : '']">
<input type="checkbox" id="checkbox2" name="agreement" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.agreement') }}&quot;">
<span>{{ __('shop::app.customer.signup-form.agree') }}
<a href="">{{ __('shop::app.customer.signup-form.terms') }}</a> & <a href="">{{ __('shop::app.customer.signup-form.conditions') }}</a> {{ __('shop::app.customer.signup-form.using') }}.
</span>
<span class="control-error" v-if="errors.has('agreement')">@{{ errors.first('agreement') }}</span>
</div>
</div> --}}
<button class="btn btn-primary btn-lg" type="submit">
{{ __('shop::app.customer.signup-form.button_title') }}

View File

@ -1,7 +1,7 @@
<div class="{{ $css->filter }} filter-wrapper">
<div class="filter-row-one">
<div class="search-filter" style="display: inline-flex; align-items: center;">
<input type="search" class="control search-field" placeholder="Search Here..." value="" />
<input type="search" id="search-field" class="control" placeholder="Search Here..." value="" />
<div class="ic-wrapper">
<span class="icon search-icon search-btn"></span>
</div>

View File

@ -45,13 +45,15 @@
}
$('.search-btn').click(function() {
search_value = $(".search-field").val();
search_value = $("#search-field").val();
alert(search_value);
formURL('search', 'all', search_value, params); //format for search
});
$(".search-field").on('keyup', function (e) {
if (e.keyCode == 13) {
search_value = $(".search-field").val();
search_value = $("#search-field").val();
alert(search_value);
formURL('search', 'all', search_value, params); //format for search
}
});