Post by pteruel » Wed Jul 22, 2020 3:06 am

Hello guys,

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

Sub-categories.png (87.24 KiB) Viewed 923 times

No_sub-categories.png

No_sub-categories.png (288.14 KiB) Viewed 923 times


Newbie

Posts

Joined
Wed Jul 22, 2020 2:50 am

Post by letxobnav » Wed Jul 22, 2020 4:30 pm

catalog/view/theme/XXXX/template/product/category.twig

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.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by pteruel » Wed Jul 22, 2020 10:29 pm

Hello @letxobnav

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.

Newbie

Posts

Joined
Wed Jul 22, 2020 2:50 am

Post by letxobnav » Thu Jul 23, 2020 9:42 am

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".
yes, but apparently you are not using the default theme so that file would not be executed.
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.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by pteruel » Thu Jul 23, 2020 9:20 pm

Hello @ letxobnav

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

Product.png (34.04 KiB) Viewed 778 times


Newbie

Posts

Joined
Wed Jul 22, 2020 2:50 am

Post by letxobnav » Thu Jul 23, 2020 10:09 pm

on the category page, the one in those pictures, what is the route in the address bar?
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.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by pteruel » Thu Jul 23, 2020 10:45 pm

Hello @ letxobnav

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

Cat.png (260.53 KiB) Viewed 752 times


Newbie

Posts

Joined
Wed Jul 22, 2020 2:50 am

Post by JNeuhoff » Thu Jul 23, 2020 11:01 pm

yes, but apparently you are not using the default theme so that file would not be executed.
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.

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


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by pteruel » Thu Jul 23, 2020 11:10 pm

Hello @JNeuhoff

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,

Newbie

Posts

Joined
Wed Jul 22, 2020 2:50 am

Post by letxobnav » Thu Jul 23, 2020 11:15 pm

OpenCart should use the default
That would be my guess but when I look at the outputted html, it does not look like the default template.

in catalog/controller/product/category.php
there are two statements like:

Code: Select all

$this->response->setOutput(...
one is:

Code: Select all

$this->response->setOutput($this->load->view('error/not_found', $data));
what is the other one?

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.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by pteruel » Thu Jul 23, 2020 11:31 pm

Hello @letxobnav

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,

Newbie

Posts

Joined
Wed Jul 22, 2020 2:50 am

Post by letxobnav » Thu Jul 23, 2020 11:34 pm

do you have the category.twig in the theme editor?

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.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by pteruel » Thu Jul 23, 2020 11:47 pm

Hello @letxobnav

Yes, we have a category.twig file inside the theme editor under product.
Here you have attached a screen and the twig file in a .txt

Best regards,

Attachments

CategoryTwig.png

CategoryTwig.png (50.16 KiB) Viewed 688 times


Newbie

Posts

Joined
Wed Jul 22, 2020 2:50 am

Post by letxobnav » Thu Jul 23, 2020 11:50 pm

then that is the code that is being executed, theme editor code (stored in the database, theme table) overrides core and modification files.

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.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by pteruel » Sat Aug 01, 2020 4:55 am

Hello guys,

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,

Newbie

Posts

Joined
Wed Jul 22, 2020 2:50 am

Post by cyclops12 » Sat Aug 01, 2020 2:00 pm

Glad you got it sorted but it would have helped if you had mentioned in your first post that you are using layered navigation

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am
Who is online

Users browsing this forum: Google [Bot], SohBH and 396 guests