Actual resource tree formed

This commit is contained in:
Prashant Singh 2019-07-03 10:21:05 +05:30
parent 71f0556e9f
commit 42c2f07dbc
6 changed files with 142 additions and 8 deletions

View File

@ -27,18 +27,10 @@ class ShowPriceAfterLoginServiceProvider extends ServiceProvider
dirname(__DIR__) . '/Resources/views/Shop/add-to-cart.blade.php' => base_path('resources/views/vendor/shop/products/add-to-cart.blade.php')
]);
// $this->publishes([
// dirname(__DIR__) . '/Resources/views/Shop/add-buttons.blade.php' => base_path('views/vendor/shop/products/add-buttons.blade.php')
// ]);
$this->publishes([
dirname(__DIR__) . '/Resources/views/Shop/buy-now.blade.php' => base_path('resources/views/vendor/shop/products/buy-now.blade.php')
]);
// $this->publishes([
// dirname(__DIR__) . '/Resources/views/Shop/view/product-add.blade.php' => base_path('views/vendor/shop/products/view/product-add.blade.php')
// ]);
$this->publishes([
dirname(__DIR__) . '/Resources/views/Shop/review-price.blade.php' => base_path('resources/views/vendor/shop/products/review-price.blade.php')
]);

View File

@ -0,0 +1,19 @@
{!! view_render_event('bagisto.shop.products.add_to_cart.before', ['product' => $product]) !!}
@php
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
@endphp
@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') }}
</a>
</div>
@else
<button type="submit" class="btn btn-lg btn-primary addtocart" {{ $product->type != 'configurable' && ! $product->haveSufficientQuantity(1) ? 'disabled' : '' }}>
{{ __('shop::app.products.add-to-cart') }}
</button>
@endif
{!! view_render_event('bagisto.shop.products.add_to_cart.after', ['product' => $product]) !!}

View File

@ -0,0 +1,15 @@
{!! view_render_event('bagisto.shop.products.buy_now.before', ['product' => $product]) !!}
@php
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
@endphp
@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') }}
</button>
@endif
{!! view_render_event('bagisto.shop.products.buy_now.after', ['product' => $product]) !!}

View File

@ -0,0 +1,55 @@
{!! view_render_event('bagisto.shop.products.list.card.before', ['product' => $product]) !!}
@php
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
@endphp
<div class="product-card">
@inject ('productImageHelper', 'Webkul\Product\Helpers\ProductImage')
<?php $productBaseImage = $productImageHelper->getProductBaseImage($product); ?>
@if ($product->new)
<div class="sticker new">
{{ __('shop::app.products.new') }}
</div>
@endif
<div class="product-image">
<a href="{{ route('shop.products.index', $product->url_key) }}" title="{{ $product->name }}">
<img src="{{ $productBaseImage['medium_image_url'] }}" onerror="this.src='{{ asset('vendor/webkul/ui/assets/images/product/meduim-product-placeholder.png') }}'"/>
</a>
</div>
<div class="product-information">
<div class="product-name">
<a href="{{ url()->to('/').'/products/' . $product->url_key }}" title="{{ $product->name }}">
<span>
{{ $product->name }}
</span>
</a>
</div>
@include ('shop::products.price', ['product' => $product])
@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')
{{ __('ShowPriceAfterLogin::app.products.login-to-buy') }}
@else
{{ __('ShowPriceAfterLogin::app.products.login-to-view-price') }}
@endif
</a>
</div>
@else
@include('shop::products.add-buttons', ['product' => $product])
@endif
</div>
</div>
{!! view_render_event('bagisto.shop.products.list.card.after', ['product' => $product]) !!}

View File

@ -0,0 +1,33 @@
{!! 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">
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
@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>
<span class="final-price">{{ core()->currency($priceHelper->getMinimalPrice($product)) }}</span>
@else
@if ($priceHelper->haveSpecialPrice($product))
<div class="sticker sale">
{{ __('shop::app.products.sale') }}
</div>
<span class="regular-price">{{ core()->currency($product->price) }}</span>
<span class="special-price">{{ core()->currency($priceHelper->getSpecialPrice($product)) }}</span>
@else
<span>{{ core()->currency($product->price) }}</span>
@endif
@endif
@endif
</div>
{!! view_render_event('bagisto.shop.products.price.after', ['product' => $product]) !!}

View File

@ -0,0 +1,20 @@
@php
$status = core()->getConfigData('ShowPriceAfterLogin.settings.settings.enableordisable');
$function = core()->getConfigData('ShowPriceAfterLogin.settings.settings.selectfunction');
@endphp
@if(($status && ! auth()->guard('customer')->check()) && $function == 'hide-price-buy-cart-guest')
<div class="product-price mt-10">
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
@if ($product->type == 'configurable')
<span class="pro-price">{{ core()->currency($priceHelper->getMinimalPrice($product)) }}</span>
@else
@if ($priceHelper->haveSpecialPrice($product))
<span class="pro-price">{{ core()->currency($priceHelper->getSpecialPrice($product)) }}</span>
@else
<span class="pro-price">{{ core()->currency($product->price) }}</span>
@endif
@endif
</div>
@endif