changed the add to buttons in bagisto

This commit is contained in:
Prashant Singh 2019-03-19 18:18:59 +05:30
parent b59c25bfb8
commit 8b85452097
3 changed files with 27 additions and 29 deletions

View File

@ -0,0 +1,25 @@
@if (Route::currentRouteName() == "shop.products.index")
@include ('shop::products.add-to', ['product' => $product])
@else
@if ($product->type == "configurable")
<div class="cart-wish-wrap">
<a href="{{ route('cart.add.configurable', $product->url_key) }}" class="btn btn-lg btn-primary addtocart">
{{ __('shop::app.products.add-to-cart') }}
</a>
@include('shop::products.wishlist')
</div>
@else
<div class="cart-wish-wrap">
<form action="{{ route('cart.add', $product->id) }}" method="POST">
@csrf
<input type="hidden" name="product" value="{{ $product->id }}">
<input type="hidden" name="quantity" value="1">
<input type="hidden" value="false" name="is_configurable">
<button class="btn btn-lg btn-primary addtocart" {{ $product->haveSufficientQuantity(1) ? '' : 'disabled' }}>{{ __('shop::app.products.add-to-cart') }}</button>
</form>
@include('shop::products.wishlist')
</div>
@endif
@endif

View File

@ -30,31 +30,7 @@
@include ('shop::products.price', ['product' => $product])
@if (Route::currentRouteName() == "shop.products.index")
@include ('shop::products.add-to', ['product' => $product])
@else
@if ($product->type == "configurable")
<div class="cart-wish-wrap">
<a href="{{ route('cart.add.configurable', $product->url_key) }}" class="btn btn-lg btn-primary addtocart">
{{ __('shop::app.products.add-to-cart') }}
</a>
@include('shop::products.wishlist')
</div>
@else
<div class="cart-wish-wrap">
<form action="{{route('cart.add', $product->id)}}" method="POST">
@csrf
<input type="hidden" name="product" value="{{ $product->id }}">
<input type="hidden" name="quantity" value="1">
<input type="hidden" value="false" name="is_configurable">
<button class="btn btn-lg btn-primary addtocart" {{ $product->haveSufficientQuantity(1) ? '' : 'disabled' }}>{{ __('shop::app.products.add-to-cart') }}</button>
</form>
@include('shop::products.wishlist')
</div>
@endif
@endif
@include('shop::products.add-buttons')
</div>
</div>

View File

@ -75,7 +75,4 @@
} else {
return null;
}
?>
?>