Show price after login refactor
This commit is contained in:
parent
813bccf758
commit
1d988dd82a
|
|
@ -1,7 +1,13 @@
|
|||
@php
|
||||
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
|
||||
|
||||
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
|
||||
@endphp
|
||||
|
||||
@if (Route::currentRouteName() == "shop.products.index")
|
||||
@include ('shop::products.add-to', ['product' => $product])
|
||||
@else
|
||||
@if(auth()->guard('customer')->check() && core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable'))
|
||||
@if(auth()->guard('customer')->check() && $status)
|
||||
@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">
|
||||
|
|
@ -26,24 +32,18 @@
|
|||
|
||||
|
||||
|
||||
@elseif(
|
||||
!auth()->guard('customer')->check()
|
||||
&& core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable')
|
||||
&& (
|
||||
core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction') == "hide-buy-cart-guest")
|
||||
)
|
||||
@elseif (! auth()->guard('customer')->check() && $status && ($status == "hide-buy-cart-guest"))
|
||||
<div class="login-to-view-price" style="width:100%;">
|
||||
<a class="btn btn-lg btn-primary addtocart" href="{{ route('customer.session.index') }}">
|
||||
{{ __('ShowPriceAfterLogin::app.products.login-to-buy') }}
|
||||
</a>
|
||||
</div>
|
||||
@elseif(! auth()->guard('customer')->check() && core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable') && core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction') == "hide-price-buy-cart-guest")
|
||||
@elseif (! auth()->guard('customer')->check() && $status && $function == "hide-price-buy-cart-guest")
|
||||
<div class="login-to-view-price" style="width:100%;">
|
||||
<a class="btn btn-lg btn-primary addtocart" href="{{ route('customer.session.index') }}">
|
||||
{{ __('ShowPriceAfterLogin::app.products.login-to-view-price') }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@else
|
||||
@if ($product->type == "configurable")
|
||||
<div class="cart-wish-wrap">
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
{!! view_render_event('bagisto.shop.products.add_to_cart.before', ['product' => $product]) !!}
|
||||
|
||||
@if(auth()->guard('customer')->check() && core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable'))
|
||||
@php
|
||||
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
|
||||
|
||||
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
|
||||
@endphp
|
||||
|
||||
@if(auth()->guard('customer')->check() && $status)
|
||||
<button type="submit" class="btn btn-lg btn-primary addtocart" {{ $product->type != 'configurable' && !$product->haveSufficientQuantity(1) ? 'disabled' : '' }}>
|
||||
{{ __('shop::app.products.add-to-cart') }}
|
||||
</button>
|
||||
|
||||
@elseif(
|
||||
!auth()->guard('customer')->check()
|
||||
&& core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable')
|
||||
&& (
|
||||
core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction') == "hide-price-buy-cart-guest"
|
||||
|| core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction') == "hide-buy-cart-guest")
|
||||
)
|
||||
|
||||
|
||||
@elseif(! auth()->guard('customer')->check() && $status && ($function == "hide-price-buy-cart-guest" || $function == "hide-buy-cart-guest"))
|
||||
|
||||
@else
|
||||
<button type="submit" class="btn btn-lg btn-primary addtocart" {{ $product->type != 'configurable' && !$product->haveSufficientQuantity(1) ? 'disabled' : '' }}>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
{!! view_render_event('bagisto.shop.products.buy_now.before', ['product' => $product]) !!}
|
||||
|
||||
@if(auth()->guard('customer')->check() && core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable'))
|
||||
@php
|
||||
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
|
||||
|
||||
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
|
||||
@endphp
|
||||
|
||||
@if(auth()->guard('customer')->check() && $status)
|
||||
<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') }}
|
||||
</button>
|
||||
|
||||
@elseif(
|
||||
!auth()->guard('customer')->check()
|
||||
&& core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable')
|
||||
&& ( core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction') == "hide-price-buy-cart-guest"
|
||||
||core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction') == "hide-buy-cart-guest"))
|
||||
@elseif(! auth()->guard('customer')->check() && $status && ( $function == "hide-price-buy-cart-guest" || $function == "hide-buy-cart-guest"))
|
||||
|
||||
|
||||
@else
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
{!! view_render_event('bagisto.shop.products.price.before', ['product' => $product]) !!}
|
||||
@php
|
||||
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
|
||||
|
||||
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
|
||||
@endphp
|
||||
|
||||
<div class="product-price">
|
||||
@if(auth()->guard('customer')->check() && core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable'))
|
||||
@if(auth()->guard('customer')->check() && $status)
|
||||
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
|
||||
|
||||
@if ($product->type == 'configurable')
|
||||
|
|
@ -29,9 +35,7 @@
|
|||
|
||||
@endif
|
||||
|
||||
@elseif(!auth()->guard('customer')->check() && core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable') && (core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction') == "hide-price-buy-cart-guest"))
|
||||
|
||||
|
||||
@elseif(!auth()->guard('customer')->check() && $status && ($function == "hide-price-buy-cart-guest"))
|
||||
|
||||
@else
|
||||
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
@if( !(core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable')) )
|
||||
@php
|
||||
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
|
||||
|
||||
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
|
||||
@endphp
|
||||
|
||||
@if(! $status)
|
||||
<div class="product-price mt-10">
|
||||
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
|
||||
|
||||
|
|
|
|||
|
|
@ -5,18 +5,19 @@
|
|||
|
||||
@include ('shop::products.buy-now')
|
||||
|
||||
@if(! auth()->guard('customer')->check() && core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable') && core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction') == "hide-price-buy-cart-guest")
|
||||
@php
|
||||
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
|
||||
|
||||
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
|
||||
@endphp
|
||||
|
||||
@if(! auth()->guard('customer')->check() && $status && $function == "hide-price-buy-cart-guest")
|
||||
<div class="login-to-view-price" style="width:100%;">
|
||||
<a class="btn btn-lg btn-primary addtocart" href="{{ route('customer.session.index') }}">
|
||||
{{ __('ShowPriceAfterLogin::app.products.login-to-view-price') }}
|
||||
</a>
|
||||
</div>
|
||||
@elseif(
|
||||
!auth()->guard('customer')->check()
|
||||
&& core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable')
|
||||
&& (
|
||||
core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction') == "hide-buy-cart-guest")
|
||||
)
|
||||
@elseif (! auth()->guard('customer')->check() && $status && ($function == "hide-buy-cart-guest"))
|
||||
<div class="login-to-view-price" style="width:100%;">
|
||||
<a class="btn btn-lg btn-primary addtocart" href="{{ route('customer.session.index') }}">
|
||||
{{ __('ShowPriceAfterLogin::app.products.login-to-buy') }}
|
||||
|
|
|
|||
Loading…
Reference in New Issue