optional compare option in default theme

This commit is contained in:
Shubham Mehrotra 2020-06-19 13:26:16 +05:30
parent 8cc42af537
commit 76a1034f49
2 changed files with 29 additions and 17 deletions

View File

@ -47,21 +47,27 @@
{!! view_render_event('bagisto.shop.layout.header.comppare-item.before') !!}
<li class="compare-dropdown-container">
<a
@auth('customer')
href="{{ route('velocity.customer.product.compare') }}"
@endauth
@php
$showCompare = core()->getConfigData('general.content.shop.compare_option') == "1" ? true : false
@endphp
@guest('customer')
href="{{ route('velocity.product.compare') }}"
@endguest
style="color: #242424;"
>
<span class="name">{{ __('velocity::app.customer.compare.text') }}</span>
@if ($showCompare)
<li class="compare-dropdown-container">
<a
@auth('customer')
href="{{ route('velocity.customer.product.compare') }}"
@endauth
</a>
</li>
@guest('customer')
href="{{ route('velocity.product.compare') }}"
@endguest
style="color: #242424;"
>
<span class="name">{{ __('velocity::app.customer.compare.text') }}</span>
</a>
</li>
@endif
{!! view_render_event('bagisto.shop.layout.header.compare-item.after') !!}

View File

@ -1,3 +1,7 @@
@php
$showCompare = core()->getConfigData('general.content.shop.compare_option') == "1" ? true : false
@endphp
<div class="cart-wish-wrap">
<form action="{{ route('cart.add', $product->product_id) }}" method="POST">
@csrf
@ -7,8 +11,10 @@
</form>
@include('shop::products.wishlist')
@include('shop::products.compare', [
'productId' => $product->id
])
@if ($showCompare)
@include('shop::products.compare', [
'productId' => $product->id
])
@endif
</div>