Page 1 of 1
Refine Search repeating
Posted: Wed Aug 02, 2017 1:09 am
by ChinmayBhatta
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
Re: Refine Search repeating
Posted: Wed Aug 30, 2017 7:07 pm
by kaylohn
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.
Re: Refine Search repeating
Posted: Fri Sep 01, 2017 4:31 pm
by AlexChanHK
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....