Buy now and add to whislist issue fixed
This commit is contained in:
parent
7ee3c3a972
commit
bc67fe761a
|
|
@ -42,9 +42,9 @@ class OrderDataGrid
|
|||
|
||||
'actions' => [
|
||||
[
|
||||
'type' => 'Edit',
|
||||
'type' => 'View',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really wanis?',
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
],
|
||||
[
|
||||
|
|
@ -106,9 +106,9 @@ class OrderDataGrid
|
|||
if($value == 'completed')
|
||||
return '<span class="badge badge-md badge-success">Completed</span>';
|
||||
else if($value == "cancelled")
|
||||
return '<span class="badge badge-md badge-danger">Completed</span>';
|
||||
return '<span class="badge badge-md badge-danger">Cancelled</span>';
|
||||
else if($value == "closed")
|
||||
return '<span class="badge badge-md badge-info">Completed</span>';
|
||||
return '<span class="badge badge-md badge-info">Closed</span>';
|
||||
else if($value == "pending")
|
||||
return '<span class="badge badge-md badge-warning">Pending</span>';
|
||||
},
|
||||
|
|
@ -163,6 +163,5 @@ class OrderDataGrid
|
|||
public function render()
|
||||
{
|
||||
return $this->createOrderDataGrid()->render();
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/shop.js": "/js/shop.js?id=55f8798e657b22f380c9",
|
||||
"/css/shop.css": "/css/shop.css?id=4def3ab1fb731fea6751"
|
||||
"/js/shop.js": "/js/shop.js",
|
||||
"/css/shop.css": "/css/shop.css"
|
||||
}
|
||||
|
|
@ -175,7 +175,5 @@ class CartController extends Controller
|
|||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -207,7 +207,7 @@ input {
|
|||
.add-to-wishlist {
|
||||
.wishlist-icon {
|
||||
&:hover {
|
||||
background-image: url('../images/wishadd.svg');
|
||||
background-image: url('../images/wishlist-added.svg');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -406,6 +406,10 @@ input {
|
|||
|
||||
.add-to-wishlist {
|
||||
margin-top: 5px;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1547,7 +1551,7 @@ section.product-detail {
|
|||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
form {
|
||||
.form-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
// justify-content: space-between;
|
||||
|
|
@ -1635,11 +1639,23 @@ section.product-detail {
|
|||
}
|
||||
|
||||
.add-to-wishlist {
|
||||
background-image: url('../images/wishlist.svg');
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 12px;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
|
||||
&:hover {
|
||||
background-image: url('../images/wishlist-added.svg');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.share {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
<button class="btn btn-lg btn-primary addtocart" {{ $product->type != 'configurable' && !$product->haveSufficientQuantity(1) ? 'disabled' : '' }}>
|
||||
<button type="submit" class="btn btn-lg btn-primary addtocart" {{ $product->type != 'configurable' && !$product->haveSufficientQuantity(1) ? 'disabled' : '' }}>
|
||||
{{ __('shop::app.products.add-to-cart') }}
|
||||
</button>
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
<a href="{{ route('shop.product.buynow', $product->id)}}" class="btn btn-lg btn-primary buynow" style="text-align: center;" id="buynow-changer" {{ $product->type != 'configurable' && !$product->haveSufficientQuantity(1) ? 'disabled' : '' }}>
|
||||
<button type="submit" data-href="{{ route('shop.product.buynow', $product->id)}}" class="btn btn-lg btn-primary buynow" {{ $product->type != 'configurable' && !$product->haveSufficientQuantity(1) ? 'disabled' : '' }}>
|
||||
{{ __('shop::app.products.buy-now') }}
|
||||
</a>
|
||||
</button>
|
||||
|
|
@ -11,76 +11,111 @@
|
|||
|
||||
@section('content-wrapper')
|
||||
<section class="product-detail">
|
||||
<!--<div class="category-breadcrumbs">
|
||||
<span class="breadcrumb">Home</span> > <span class="breadcrumb">Men</span> > <span class="breadcrumb">Slit Open Jeans</span>
|
||||
</div>-->
|
||||
|
||||
<div class="layouter">
|
||||
<form method="POST" action="{{ route('cart.add', $product->id) }}" @submit.prevent="onSubmit">
|
||||
@csrf()
|
||||
<product-view>
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
|
||||
<input type="hidden" name="product" value="{{ $product->id }}">
|
||||
<input type="hidden" name="product" value="{{ $product->id }}">
|
||||
|
||||
@include ('shop::products.view.gallery')
|
||||
@include ('shop::products.view.gallery')
|
||||
|
||||
<div class="details">
|
||||
<div class="details">
|
||||
|
||||
<div class="product-heading">
|
||||
<span>{{ $product->name }}</span>
|
||||
</div>
|
||||
|
||||
@include ('shop::products.review', ['product' => $product])
|
||||
|
||||
@include ('shop::products.price', ['product' => $product])
|
||||
|
||||
@include ('shop::products.view.stock', ['product' => $product])
|
||||
|
||||
<div class="description">
|
||||
{!! $product->short_description !!}
|
||||
</div>
|
||||
|
||||
<div class="quantity control-group" :class="[errors.has('quantity') ? 'has-error' : '']">
|
||||
|
||||
<label class="reqiured">{{ __('shop::app.products.quantity') }}</label>
|
||||
|
||||
<input name="quantity" class="control" value="1" v-validate="'required|numeric|min_value:1'" style="width: 60px;">
|
||||
|
||||
<span class="control-error" v-if="errors.has('quantity')">@{{ errors.first('quantity') }}</span>
|
||||
</div>
|
||||
|
||||
@if ($product->type == 'configurable')
|
||||
<input type="hidden" value="true" name="is_configurable">
|
||||
@else
|
||||
<input type="hidden" value="false" name="is_configurable">
|
||||
@endif
|
||||
|
||||
@include ('shop::products.view.configurable-options')
|
||||
|
||||
<accordian :title="'{{ __('shop::app.products.description') }}'" :active="true">
|
||||
<div slot="header">
|
||||
{{ __('shop::app.products.description') }}
|
||||
<i class="icon expand-icon right"></i>
|
||||
<div class="product-heading">
|
||||
<span>{{ $product->name }}</span>
|
||||
</div>
|
||||
|
||||
<div slot="body">
|
||||
<div class="full-description">
|
||||
{!! $product->description !!}
|
||||
@include ('shop::products.review', ['product' => $product])
|
||||
|
||||
@include ('shop::products.price', ['product' => $product])
|
||||
|
||||
@include ('shop::products.view.stock', ['product' => $product])
|
||||
|
||||
<div class="description">
|
||||
{!! $product->short_description !!}
|
||||
</div>
|
||||
|
||||
<div class="quantity control-group" :class="[errors.has('quantity') ? 'has-error' : '']">
|
||||
|
||||
<label class="reqiured">{{ __('shop::app.products.quantity') }}</label>
|
||||
|
||||
<input name="quantity" class="control" value="1" v-validate="'required|numeric|min_value:1'" style="width: 60px;">
|
||||
|
||||
<span class="control-error" v-if="errors.has('quantity')">@{{ errors.first('quantity') }}</span>
|
||||
</div>
|
||||
|
||||
@if ($product->type == 'configurable')
|
||||
<input type="hidden" value="true" name="is_configurable">
|
||||
@else
|
||||
<input type="hidden" value="false" name="is_configurable">
|
||||
@endif
|
||||
|
||||
@include ('shop::products.view.configurable-options')
|
||||
|
||||
<accordian :title="'{{ __('shop::app.products.description') }}'" :active="true">
|
||||
<div slot="header">
|
||||
{{ __('shop::app.products.description') }}
|
||||
<i class="icon expand-icon right"></i>
|
||||
</div>
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
@include ('shop::products.view.attributes')
|
||||
<div slot="body">
|
||||
<div class="full-description">
|
||||
{!! $product->description !!}
|
||||
</div>
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
@include ('shop::products.view.reviews')
|
||||
@include ('shop::products.view.attributes')
|
||||
|
||||
@include ('shop::products.view.reviews')
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</product-view>
|
||||
</div>
|
||||
|
||||
@include ('shop::products.view.up-sells')
|
||||
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script type="text/x-template" id="product-view-template">
|
||||
<form method="POST" action="{{ route('cart.add', $product->id) }}" @click.prevent="onSubmit($event)">
|
||||
|
||||
<slot></slot>
|
||||
|
||||
</form>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
Vue.component('product-view', {
|
||||
|
||||
template: '#product-view-template',
|
||||
|
||||
inject: ['$validator'],
|
||||
|
||||
methods: {
|
||||
onSubmit (e) {
|
||||
if(e.target.getAttribute('type') != 'submit')
|
||||
return;
|
||||
|
||||
this.$validator.validateAll().then(result => {
|
||||
if (result) {
|
||||
if(e.target.getAttribute('data-href')) {
|
||||
window.location.href = e.target.getAttribute('data-href');
|
||||
} else {
|
||||
e.target.submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
document.onreadystatechange = function () {
|
||||
var state = document.readyState
|
||||
var galleryTemplate = document.getElementById('product-gallery-template');
|
||||
|
|
|
|||
|
|
@ -2,20 +2,7 @@
|
|||
|
||||
@inject ('configurableOptionHelper', 'Webkul\Product\Helpers\ConfigurableOption')
|
||||
|
||||
<product-options>
|
||||
<!--<div class="attribute control-group has-error">
|
||||
<label class="reqiured">Color</label>
|
||||
<select name="super_attribute[104]" id="attribute_104" class="control" data-vv-id="1" aria-required="true" aria-invalid="true">
|
||||
<option value="">Choose an option</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="attribute control-group">
|
||||
<label class="reqiured">Size</label>
|
||||
<select name="super_attribute[105]" disabled="disabled" id="attribute_105" class="control" data-vv-id="2" aria-required="true" aria-invalid="false">
|
||||
</select>
|
||||
</div>-->
|
||||
</product-options>
|
||||
<product-options></product-options>
|
||||
|
||||
@push('scripts')
|
||||
|
||||
|
|
@ -41,7 +28,7 @@
|
|||
</div>
|
||||
</script>
|
||||
|
||||
{{-- <?php $config = $configurableOptionHelper->getConfigurationConfig($product) ?> --}}
|
||||
<?php $config = $configurableOptionHelper->getConfigurationConfig($product) ?>
|
||||
|
||||
<script>
|
||||
|
||||
|
|
@ -112,7 +99,7 @@
|
|||
|
||||
//wishlist anchor href changer with options
|
||||
@auth('customer')
|
||||
var wishlistLink = $('#wishlist-changer').attr('href');
|
||||
var wishlistLink = $('#wishlist-changer').attr('data-href');
|
||||
|
||||
if(this.selectedProductId != '') {
|
||||
var splitted = wishlistLink.split("/");
|
||||
|
|
@ -123,14 +110,14 @@
|
|||
|
||||
var joined = splitted.join('/');
|
||||
|
||||
var newWishlistUrl = joined+'/'+lastItem;
|
||||
var newWishlistUrl = joined + '/' + lastItem;
|
||||
|
||||
$('#wishlist-changer').attr('href', newWishlistUrl);
|
||||
$('#wishlist-changer').attr('data-href', newWishlistUrl);
|
||||
}
|
||||
@endauth
|
||||
|
||||
//buy now anchor href changer with options
|
||||
var buyNowLink = $('#buynow-changer').attr('href');
|
||||
var buyNowLink = $('.btn.buynow').attr('data-href');
|
||||
|
||||
if(this.selectedProductId != '') {
|
||||
var splitted = buyNowLink.split("/");
|
||||
|
|
@ -141,9 +128,9 @@
|
|||
|
||||
var joined = splitted.join('/');
|
||||
|
||||
var newBuyNowUrl = joined+'/'+lastItem;
|
||||
var newBuyNowUrl = joined + '/' + lastItem;
|
||||
|
||||
$('#buynow-changer').attr('href', newBuyNowUrl);
|
||||
$('.btn.buynow').attr('data-href', newBuyNowUrl);
|
||||
}
|
||||
} else {
|
||||
attribute.selectedIndex = 0;
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@
|
|||
|
||||
<product-gallery></product-gallery>
|
||||
|
||||
@include ('shop::products.product-add')
|
||||
@include ('shop::products.view.product-add')
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script type="text/x-template" id="product-gallery-template">
|
||||
|
|
@ -42,7 +40,11 @@
|
|||
{{-- Uncomment the line below for activating share links --}}
|
||||
{{-- @include('shop::products.sharelinks') --}}
|
||||
|
||||
@include('shop::products.wishlist')
|
||||
@auth('customer')
|
||||
<button type="submit" class="add-to-wishlist" data-href="{{ route('customer.wishlist.add', $product->id) }}" id="wishlist-changer">
|
||||
</button>
|
||||
@endauth
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
@if(count($actions))
|
||||
<td class="action">
|
||||
@foreach($actions as $action)
|
||||
<a @if($action['type'] == "Edit") href="{{ url()->current().'/edit/'.$result->id }}" @elseif($action['type']=="Delete") href="{{ url()->current().'/delete/'.$result->id }}" @endif class="Action-{{ $action['type'] }}" id="{{ $result->id }}" onclick="return confirm_click('{{ $action['confirm_text'] }}');">
|
||||
<a @if($action['type'] == "Edit") href="{{ url()->current().'/edit/'.$result->id }}" @elseif($action['type'] == "View") href="{{ url()->current().'/view/'.$result->id }}" @elseif($action['type']=="Delete") href="{{ url()->current().'/delete/'.$result->id }}" @endif class="Action-{{ $action['type'] }}" id="{{ $result->id }}" onclick="return confirm_click('{{ $action['confirm_text'] }}');">
|
||||
<i class="{{ $action['icon'] }}"></i>
|
||||
</a>
|
||||
@endforeach
|
||||
|
|
|
|||
Loading…
Reference in New Issue