Published new customer group catalog files
This commit is contained in:
parent
cc649c83da
commit
b7b8cde76b
|
|
@ -0,0 +1,94 @@
|
||||||
|
<div class="footer">
|
||||||
|
<div class="footer-content">
|
||||||
|
<div class="footer-list-container">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$categories = [];
|
||||||
|
|
||||||
|
foreach (app('Webkul\CustomerGroupCatalog\Repositories\CategoryRepository')->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category){
|
||||||
|
if ($category->slug)
|
||||||
|
array_push($categories, $category);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
@if (count($categories))
|
||||||
|
<div class="list-container">
|
||||||
|
<span class="list-heading">Categories</span>
|
||||||
|
|
||||||
|
<ul class="list-group">
|
||||||
|
@foreach ($categories as $key => $category)
|
||||||
|
<li>
|
||||||
|
<a href="{{ route('shop.categories.index', $category->slug) }}">{{ $category->name }}</a>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{!! DbView::make(core()->getCurrentChannel())->field('footer_content')->render() !!}
|
||||||
|
|
||||||
|
<div class="list-container">
|
||||||
|
@if(core()->getConfigData('customer.settings.newsletter.subscription'))
|
||||||
|
<span class="list-heading">{{ __('shop::app.footer.subscribe-newsletter') }}</span>
|
||||||
|
<div class="form-container">
|
||||||
|
<form action="{{ route('shop.subscribe') }}">
|
||||||
|
<div class="control-group" :class="[errors.has('subscriber_email') ? 'has-error' : '']">
|
||||||
|
<input type="email" class="control subscribe-field" name="subscriber_email" placeholder="Email Address" required><br/>
|
||||||
|
|
||||||
|
<button class="btn btn-md btn-primary">{{ __('shop::app.subscription.subscribe') }}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
|
||||||
|
$searchTerm = explode("?", $query);
|
||||||
|
|
||||||
|
foreach($searchTerm as $term){
|
||||||
|
if (strpos($term, 'term') !== false) {
|
||||||
|
$serachQuery = $term;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<span class="list-heading">{{ __('shop::app.footer.locale') }}</span>
|
||||||
|
<div class="form-container">
|
||||||
|
<div class="control-group">
|
||||||
|
<select class="control locale-switcher" onchange="window.location.href = this.value" @if (count(core()->getCurrentChannel()->locales) == 1) disabled="disabled" @endif>
|
||||||
|
|
||||||
|
@foreach (core()->getCurrentChannel()->locales as $locale)
|
||||||
|
@if(isset($serachQuery))
|
||||||
|
<option value="?{{ $serachQuery }}?locale={{ $locale->code }}" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}>{{ $locale->name }}</option>
|
||||||
|
@else
|
||||||
|
<option value="?locale={{ $locale->code }}" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}>{{ $locale->name }}</option>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="currency">
|
||||||
|
<span class="list-heading">{{ __('shop::app.footer.currency') }}</span>
|
||||||
|
<div class="form-container">
|
||||||
|
<div class="control-group">
|
||||||
|
<select class="control locale-switcher" onchange="window.location.href = this.value">
|
||||||
|
|
||||||
|
@foreach (core()->getCurrentChannel()->currencies as $currency)
|
||||||
|
@if(isset($serachQuery))
|
||||||
|
<option value="?{{ $serachQuery }}?currency={{ $currency->code }}" {{ $currency->code == core()->getCurrentCurrencyCode() ? 'selected' : '' }}>{{ $currency->code }}</option>
|
||||||
|
@else
|
||||||
|
<option value="?currency={{ $currency->code }}" {{ $currency->code == core()->getCurrentCurrencyCode() ? 'selected' : '' }}>{{ $currency->code }}</option>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
{!! view_render_event('bagisto.shop.layout.header.category.before') !!}
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$categories = [];
|
||||||
|
|
||||||
|
foreach (app('Webkul\CustomerGroupCatalog\Repositories\CategoryRepository')->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category) {
|
||||||
|
if ($category->slug)
|
||||||
|
array_push($categories, $category);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<category-nav categories='@json($categories)' url="{{url()->to('/')}}"></category-nav>
|
||||||
|
|
||||||
|
{!! view_render_event('bagisto.shop.layout.header.category.after') !!}
|
||||||
|
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/x-template" id="category-nav-template">
|
||||||
|
|
||||||
|
<ul class="nav">
|
||||||
|
<category-item
|
||||||
|
v-for="(item, index) in items"
|
||||||
|
:key="index"
|
||||||
|
:url="url"
|
||||||
|
:item="item"
|
||||||
|
:parent="index">
|
||||||
|
</category-item>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
Vue.component('category-nav', {
|
||||||
|
|
||||||
|
template: '#category-nav-template',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
categories: {
|
||||||
|
type: [Array, String, Object],
|
||||||
|
required: false,
|
||||||
|
default: (function () {
|
||||||
|
return [];
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
url: String
|
||||||
|
},
|
||||||
|
|
||||||
|
data: function(){
|
||||||
|
return {
|
||||||
|
items_count:0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
items: function() {
|
||||||
|
return JSON.parse(this.categories)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/x-template" id="category-item-template">
|
||||||
|
<li>
|
||||||
|
<a :href="url+'/categories/'+this.item['translations'][0].slug">
|
||||||
|
@{{ name }} 
|
||||||
|
<i class="icon dropdown-right-icon" v-if="haveChildren && item.parent_id != null"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<i :class="[show ? 'icon icon-arrow-down mt-15' : 'icon dropdown-right-icon left mt-15']"
|
||||||
|
v-if="haveChildren" @click="showOrHide"></i>
|
||||||
|
|
||||||
|
<ul v-if="haveChildren && show">
|
||||||
|
<category-item
|
||||||
|
v-for="(child, index) in item.children"
|
||||||
|
:key="index"
|
||||||
|
:url="url"
|
||||||
|
:item="child">
|
||||||
|
</category-item>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
Vue.component('category-item', {
|
||||||
|
|
||||||
|
template: '#category-item-template',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
item: Object,
|
||||||
|
url: String,
|
||||||
|
},
|
||||||
|
|
||||||
|
data: function() {
|
||||||
|
return {
|
||||||
|
items_count:0,
|
||||||
|
show: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted: function() {
|
||||||
|
if(window.innerWidth > 770){
|
||||||
|
this.show = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
haveChildren: function() {
|
||||||
|
return this.item.children.length ? true : false;
|
||||||
|
},
|
||||||
|
|
||||||
|
name: function() {
|
||||||
|
if (this.item.translations && this.item.translations.length) {
|
||||||
|
this.item.translations.forEach(function(translation) {
|
||||||
|
if (translation.locale == document.documentElement.lang)
|
||||||
|
return translation.name;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.item.name;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
showOrHide: function() {
|
||||||
|
this.show = !this.show;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
@endpush
|
||||||
|
|
@ -0,0 +1,128 @@
|
||||||
|
@extends('shop::layouts.master')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ $category->meta_title ?? $category->name }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('seo')
|
||||||
|
<meta name="description" content="{{ $category->meta_description }}"/>
|
||||||
|
<meta name="keywords" content="{{ $category->meta_keywords }}"/>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content-wrapper')
|
||||||
|
@inject ('productRepository', 'Webkul\Product\Repositories\ProductRepository')
|
||||||
|
|
||||||
|
<div class="main">
|
||||||
|
{!! view_render_event('bagisto.shop.products.index.before', ['category' => $category]) !!}
|
||||||
|
|
||||||
|
<div class="category-container">
|
||||||
|
|
||||||
|
@if (in_array($category->display_mode, [null, 'products_only', 'products_and_description']))
|
||||||
|
@include ('shop::products.list.layered-navigation')
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="category-block" @if ($category->display_mode == 'description_only') style="width: 100%" @endif>
|
||||||
|
<div class="hero-image mb-35">
|
||||||
|
@if (!is_null($category->image))
|
||||||
|
<img class="logo" src="{{ $category->image_url }}" />
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (in_array($category->display_mode, [null, 'description_only', 'products_and_description']))
|
||||||
|
@if ($category->description)
|
||||||
|
<div class="category-description">
|
||||||
|
{!! $category->description !!}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if (in_array($category->display_mode, [null, 'products_only', 'products_and_description']))
|
||||||
|
<?php $products = $productRepository->getAll($category->id); ?>
|
||||||
|
|
||||||
|
@if ($products->count())
|
||||||
|
|
||||||
|
@include ('shop::products.list.toolbar')
|
||||||
|
|
||||||
|
@inject ('toolbarHelper', 'Webkul\Product\Helpers\Toolbar')
|
||||||
|
|
||||||
|
@if ($toolbarHelper->getCurrentMode() == 'grid')
|
||||||
|
<div class="product-grid-3">
|
||||||
|
@foreach ($products as $productFlat)
|
||||||
|
|
||||||
|
@include ('shop::products.list.card', ['product' => $productFlat])
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div class="product-list">
|
||||||
|
@foreach ($products as $productFlat)
|
||||||
|
|
||||||
|
@include ('shop::products.list.card', ['product' => $productFlat])
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{!! view_render_event('bagisto.shop.products.index.pagination.before', ['category' => $category]) !!}
|
||||||
|
|
||||||
|
<div class="bottom-toolbar">
|
||||||
|
{{ $products->appends(request()->input())->links() }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{!! view_render_event('bagisto.shop.products.index.pagination.after', ['category' => $category]) !!}
|
||||||
|
|
||||||
|
@else
|
||||||
|
|
||||||
|
<div class="product-list empty">
|
||||||
|
<h2>{{ __('shop::app.products.whoops') }}</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{{ __('shop::app.products.empty') }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{!! view_render_event('bagisto.shop.products.index.after', ['category' => $category]) !!}
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.responsive-layred-filter').css('display','none');
|
||||||
|
$(".sort-icon, .filter-icon").on('click', function(e){
|
||||||
|
var currentElement = $(e.currentTarget);
|
||||||
|
if (currentElement.hasClass('sort-icon')) {
|
||||||
|
currentElement.removeClass('sort-icon');
|
||||||
|
currentElement.addClass('icon-menu-close-adj');
|
||||||
|
currentElement.next().removeClass();
|
||||||
|
currentElement.next().addClass('icon filter-icon');
|
||||||
|
$('.responsive-layred-filter').css('display','none');
|
||||||
|
$('.pager').css('display','flex');
|
||||||
|
$('.pager').css('justify-content','space-between');
|
||||||
|
} else if (currentElement.hasClass('filter-icon')) {
|
||||||
|
currentElement.removeClass('filter-icon');
|
||||||
|
currentElement.addClass('icon-menu-close-adj');
|
||||||
|
currentElement.prev().removeClass();
|
||||||
|
currentElement.prev().addClass('icon sort-icon');
|
||||||
|
$('.pager').css('display','none');
|
||||||
|
$('.responsive-layred-filter').css('display','block');
|
||||||
|
$('.responsive-layred-filter').css('margin-top','10px');
|
||||||
|
} else {
|
||||||
|
currentElement.removeClass('icon-menu-close-adj');
|
||||||
|
$('.responsive-layred-filter').css('display','none');
|
||||||
|
$('.pager').css('display','none');
|
||||||
|
if ($(this).index() == 0) {
|
||||||
|
currentElement.addClass('sort-icon');
|
||||||
|
} else {
|
||||||
|
currentElement.addClass('filter-icon');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
Loading…
Reference in New Issue