Fix categories

This commit is contained in:
Amanmyrat 2023-09-20 17:09:43 +05:00
parent 61243f2298
commit 980288fca1
4 changed files with 15 additions and 16 deletions

View File

@ -1,5 +1,5 @@
title = "category"
url = "/category/:id/:category"
url = "/category/:id"
layout = "default"
is_hidden = 0
==
@ -26,7 +26,7 @@ function onStart(){
</span>
{{'Главная'|_}}
</a>
<h4 class="crumb_title">
<h4 class="crumb_title">
<a href="{{ url('/') }}/main-category/{{category.top_category.id}}/{{category.top_category.name}}">
{{category.top_category.name}}
</a>
@ -68,8 +68,8 @@ function onStart(){
{% partial 'home/shop_item' shop=shop %}
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</section>
</section>

View File

@ -1,5 +1,5 @@
title = "main-category"
url = "/main-category/:id/:category"
url = "/main-category/:id"
layout = "default"
is_hidden = 0
==
@ -7,7 +7,6 @@ is_hidden = 0
function onStart(){
$this['id'] = $this->param('id');
// $this["category"] = $this->param('category');
if($this['id'] != 0){
$this['top_category'] = Tps\Shops\Models\TopCategory::where("id", $this['id'])->get()->first();
@ -36,12 +35,12 @@ function onStart(){
</a>
<h4 class="crumb_title">
{% if id != 0%}
{{top_category.name}}
{{top_category.name}}
{% else %}
{{'Все магазины'|_}}
{% endif %}
</h4>
</div>
</div>
</div>
@ -63,8 +62,8 @@ function onStart(){
{% partial 'home/shop_item' shop=shop %}
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</section>
</section>

View File

@ -9,11 +9,11 @@
{% for key, i in item %}
{% for top_category in top_categories.slice(i.start,1) %}
<div class="footer_col-group">
<a href="{{ url('/') }}/main-category/{{top_category.id}}/{{top_category.name}}" class="footer_col-title">
<a href="{{ url('/') }}/main-category/{{top_category.id}}" class="footer_col-title">
{{top_category.name}}
</a>
{% for category in top_category.getCategories(i.limit) %}
<a href="{{ url('/') }}/category/{{category.id}}/{{category.name}}" class="footer_col-link">{{category.name}}</a>
<a href="{{ url('/') }}/category/{{category.id}}" class="footer_col-link">{{category.name}}</a>
{% endfor %}
</div>
{% endfor %}
@ -125,4 +125,4 @@
</div>
</div>
</footer>
<!-- Footer end ========================= -->
<!-- Footer end ========================= -->

View File

@ -115,12 +115,12 @@ function onStart(){
{% for key, i in item %}
{% for top_category in top_categories.slice(i.start,1) %}
<div class="menu_col-group">
<a href="{{ url('/') }}/main-category/{{top_category.id}}/{{top_category.name}}" class="menu_col-title accord">
<a href="{{ url('/') }}/main-category/{{top_category.id}}" class="menu_col-title accord">
{{top_category.name}}
</a>
<div class="menu_col-box">
{% for category in top_category.getCategories(i.limit) %}
<a href="{{ url('/') }}/category/{{category.id}}/{{category.name}}" class="menu_col-link">{{category.name}}</a>
<a href="{{ url('/') }}/category/{{category.id}}" class="menu_col-link">{{category.name}}</a>
{% endfor %}
</div>
</div>
@ -236,4 +236,4 @@ function onStart(){
</div>
</section>
<!-- Menu end ========================= -->
<!-- Menu end ========================= -->