Post by ChinmayBhatta » Wed Aug 02, 2017 1:09 am

In some cases, the "Refine Search", we find the category repeating in Category page (route=product/category). The url of the repeats are same.

In the example below, "Terracotta" repeats 4 times (i have just pasted twice) with same url

Version: 3.0.2.0

Necklace Set

Refine Search

Terracotta
Dokra/Dhokra
Beads/Crystal
Costume/Artificial
Jute & Paddy
Sea Shell
Copper
Bamboo & Wooden

Terracotta
Dokra/Dhokra
Beads/Crystal
Costume/Artificial
Jute & Paddy
Sea Shell
Copper
Bamboo & Wooden

Newbie

Posts

Joined
Wed Mar 08, 2017 7:16 pm

Post by kaylohn » Wed Aug 30, 2017 7:07 pm

This occurs on the OpenCart Demo site as well.

https://demo.opencart.com/index.php?rou ... ry&path=34

- Twig functions don't seem to work as expected/ intended.

Possible fix:

File location: /catalog/view/theme/default/template/product/category.twig

Offending code chunk:

Code: Select all

      <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>
Fixed code:

Code: Select all

      <div class="row"> {% for categorycolumns in categories|batch((categories|length / 4)|round(1, 'ceil')) %}
        <div class="col-sm-3">
          <ul>
            {% for category in categorycolumns %}
            <li><a href="{{ category.href }}">{{ category.name }}</a></li>
Hope this helps.

Lets' forge our present as past for the future. - Kay Lohn


User avatar
New member

Posts

Joined
Sat Jan 08, 2011 12:52 am
Location - Pakistan

Post by alexchantesting » Fri Sep 01, 2017 4:31 pm

This bug happened in 3000 to 3012 only, if you are using 3020, it should not exist this issue.
Or you may copy the file in zip of 3020 to replace the template file and try again.
main folder\catalog\view\theme\default\template\product\category.twig

For Opencart demo, since it using the early stage of Opencart 3.0 to create, therefore....

New staff in Opencart ;)



Posts

Joined
Thu Mar 16, 2017 4:34 pm
Who is online

Users browsing this forum: dwains and 10 guests