I already red all the threads with this topic without success.
We tried to modify the category twig from /var/www/html/catalog/view/theme/default/template/product but it seems that the changes that we made take no effect whatsoever.
Here you have attached some screenshots for the problem that I am having.
Interesting fact, the sub-categories ONLY appear at the top when the parent category has 5 or more children. If the parent has 4 children no sub-categories are displayed at the top.
We are using Opencart 3.0.3.1 with the Digitech 2 theme. I don't know if this matters, but just in case I leave the information.
Hope you can help me.
Best regards,
Attachments
Sub-categories.png (87.24 KiB) Viewed 923 times
No_sub-categories.png (288.14 KiB) Viewed 923 times
Code: Select all
{% if categories %}
<h3>{{ text_refine }}</h3>
{% if categories|length <= 5 %}
<div class="row">
<div class="col-sm-3">
<ul>
{% for category in categories %}
<li><a href="{{ category.href }}">{{ category.name }}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% else %}
<div class="row">{% for category in categories|batch((categories|length / 4)|round(1, 'ceil')) %}
<div class="col-sm-3">
<ul>
{% for child in category %}
<li><a href="{{ child.href }}">{{ child.name }}</a></li>
{% endfor %}
</ul>
</div>
{% endfor %}</div>
<br />
{% endif %}
{% endif %}
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Thanks for your quick reply.
We don't have a Category.twig file inside "catalog/view/theme/tt_digitech2/template/product", but we found it in: "catalog/view/theme/default/template/product".
Unfortunenately we already comment that code but for some reason the changes are not taking effect on the webpage. Even with that piece of code commented, the sub-categories are still appearing.
Update:
We deleted the category.twig file from "catalog/view/theme/default/template/product" and refreshed everything but the page still loads. So we are assuming that, the category.twig file inside "catalog/view/theme/default/template/product" is not the file we are loking for.
Best regards.
yes, but apparently you are not using the default theme so that file would not be executed.We don't have a Category.twig file inside "catalog/view/theme/tt_digitech2/template/product", but we found it in: "catalog/view/theme/default/template/product".
So what files are there in catalog/view/theme/tt_digitech2/template/product/?
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
This is what we got under catalog/view/theme/tt_digitech2/template/product/
manufacturer_info.twig
octestimonial.twig
product.twig
search.twig
special.twig
Hope you can help us,
Best regards.
Attachments
Product.png (34.04 KiB) Viewed 778 times
like https://your-domain/index.php?route=xxxxx/yyyyy
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
This is the address that you ask for:
https://www.audys.com/index.php?route=p ... ry&path=66
I left attached a screenshot just in case.
Best regards,
Attachments
Cat.png (260.53 KiB) Viewed 752 times
If there is no 'catalog/view/theme/tt_digitech2/template/product/category.twig' then OpenCart should use the default 'catalog/view/theme/default/template/product/category.twig' instead automatically.yes, but apparently you are not using the default theme so that file would not be executed.
Perhaps it's an issue with caching? Worth a try to do a 'Dashboard > Developer Settings > Theme > Refresh', as well as a 'Extensions > Modifications > Refresh'.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
With every change that we are making to a twig file, we are refreshing 3 things before testing on the webpage:
- Dashboard -> Gear icon -> Refresh Theme
- Dashboard -> Gear icon -> Refresh SASS (idk if it's relevant or not)
- Extensions -> Modifications -> Refresh
Even tho, I deleted for testing only the category.twig in the 'catalog/view/theme/default/template/product/category.twig' and everyting is working fine. That's why we are assuming that the category.twig file inside that route is not working or something happens.
Best regards,
That would be my guess but when I look at the outputted html, it does not look like the default template.OpenCart should use the default
in catalog/controller/product/category.php
there are two statements like:
Code: Select all
$this->response->setOutput(...
Code: Select all
$this->response->setOutput($this->load->view('error/not_found', $data));
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
This is the other line that you ask:
$this->response->setOutput($this->load->view('product/category', $data));
We rename (for testing) the category.twig file from "/var/www/html/catalog/view/theme/default/template/product" to category.twig.bkp, refresh the 3 things mention above and everything is still working. I am doing those rename tests to heck that we are in the correct file.
Best regards,
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
After a super long search we found the file to modify.
/var/www/html/catalog/view/theme/tt_digitech2/template/extension/module/oclayerednavigation/occategory.twig
Inside that file we comment the code below:
{# {% if categories %}
<h3 class="text-refine">{{ text_refine }}</h3>
{% if categories|length <= 5 %}
<div class="row">
<div class="col-sm-3">
<ul class="list-cate">
{% for category in categories %}
<li><a href="{{ category.href }}">{{ category.name }}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% else %}
<div class="row"> {% for category in categories|batch((categories|length / 4)|round(1, 'ceil')) %}
<div class="col-sm-3">
<ul>
{% for category in categories %}
<li><a href="{{ category.href }}">{{ category.name }}</a></li>
{% endfor %}
</ul>
</div>
{% endfor %} </div>
<br />
{% endif %}
{% endif %} #}
There is no more sub-categories at the top with this modification.
Thanks to everyone, we appreciate all the help given.
Best regards,
Users browsing this forum: Google [Bot], SohBH and 396 guests