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
== ==

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();

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 %}

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>