Merged with master

This commit is contained in:
jitendra 2019-01-02 20:07:00 +05:30
commit 98e2d0e52c
7 changed files with 47 additions and 13 deletions

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
MIT License
Copyright 2010-2018, Webkul Software
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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
}
});