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

View File

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

View File

@ -9,11 +9,11 @@
{% for key, i in item %} {% for key, i in item %}
{% for top_category in top_categories.slice(i.start,1) %} {% for top_category in top_categories.slice(i.start,1) %}
<div class="footer_col-group"> <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}} {{top_category.name}}
</a> </a>
{% for category in top_category.getCategories(i.limit) %} {% 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 %} {% endfor %}
</div> </div>
{% endfor %} {% endfor %}
@ -125,4 +125,4 @@
</div> </div>
</div> </div>
</footer> </footer>
<!-- Footer end ========================= --> <!-- Footer end ========================= -->

View File

@ -115,12 +115,12 @@ function onStart(){
{% for key, i in item %} {% for key, i in item %}
{% for top_category in top_categories.slice(i.start,1) %} {% for top_category in top_categories.slice(i.start,1) %}
<div class="menu_col-group"> <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}} {{top_category.name}}
</a> </a>
<div class="menu_col-box"> <div class="menu_col-box">
{% for category in top_category.getCategories(i.limit) %} {% 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 %} {% endfor %}
</div> </div>
</div> </div>
@ -236,4 +236,4 @@ function onStart(){
</div> </div>
</section> </section>
<!-- Menu end ========================= --> <!-- Menu end ========================= -->