conditions now more properly grouped for show price after login functionalities

This commit is contained in:
Prashant Singh 2019-06-22 16:52:46 +05:30
parent 14546dc12d
commit 7d023afa5b
5 changed files with 9 additions and 9 deletions

View File

@ -14,6 +14,7 @@
<input type="hidden" name="product" value="{{ $product->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>

View File

@ -2,10 +2,10 @@
@php
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
$function = $status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
@endphp
@if ($status && ($function == 'hide-buy-cart-guest' || $function == 'hide-price-buy-cart-guest') && ! auth()->guard('customer')->check())
@if (($status && ! auth()->guard('customer')->check()) && ($function == 'hide-buy-cart-guest' || $function == 'hide-price-buy-cart-guest'))
<div class="login-to-view-price">
<a class="btn btn-lg btn-primary addtocart" href="{{ route('customer.session.index') }}" style="width:100%;">
{{ __('ShowPriceAfterLogin::app.products.login-to-view-price') }}

View File

@ -3,10 +3,10 @@
@php
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
$function = $status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
@endphp
@if ($status && ($function == 'hide-buy-cart-guest' || $function == 'hide-price-buy-cart-guest') && ! auth()->guard('customer')->check())
@if (($status && ! auth()->guard('customer')->check()) && ($function == 'hide-buy-cart-guest' || $function == 'hide-price-buy-cart-guest'))
@else
<button type="submit" data-href="{{ route('shop.product.buynow', $product->product_id)}}" class="btn btn-lg btn-primary buynow" {{ $product->type != 'configurable' && ! $product->haveSufficientQuantity(1) ? 'disabled' : '' }}>
{{ __('shop::app.products.buy-now') }}

View File

@ -3,7 +3,7 @@
@php
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
$function = $status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
@endphp
<div class="product-card">
@ -35,7 +35,7 @@
@include ('shop::products.price', ['product' => $product])
@if ($status && ($function == 'hide-buy-cart-guest' || $function == 'hide-price-buy-cart-guest') && ! auth()->guard('customer')->check())
@if (($status && ! auth()->guard('customer')->check()) && ($function == 'hide-buy-cart-guest' || $function == 'hide-price-buy-cart-guest'))
<div class="login-to-view-price">
<a class="btn btn-lg btn-primary addtocart" href="{{ route('customer.session.index') }}" style="width:100%;">
@if ($function == 'hide-buy-cart-guest')
@ -43,7 +43,6 @@
@else
{{ __('ShowPriceAfterLogin::app.products.login-to-view-price') }}
@endif
</a>
</div>
@else

View File

@ -3,12 +3,12 @@
@php
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
$function = $status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
@endphp
<div class="product-price">
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
@if ($status && $function == "hide-price-buy-cart-guest" && ! auth()->guard('customer')->check())
@if (($status && ! auth()->guard('customer')->check()) && $function == "hide-price-buy-cart-guest")
@else
@if ($product->type == 'configurable')
<span class="price-label">{{ __('shop::app.products.price-label') }}</span>