Hi guys.
I don't know if this trouble was solved but i didn't found nothing in the forum search :/
In category, the 2nd page repeat 1rst page items... how can i fix it?
For example: total items in category A: 15 items
My site show 12 items per page. In the 1rst page, i can see 12 items but in the 2nd page, i see 3 duplicate items. So, 3 items are missed :/
I'm using 1.5.1.1
Sorry for my english,
Thanks a lot.
I don't know if this trouble was solved but i didn't found nothing in the forum search :/
In category, the 2nd page repeat 1rst page items... how can i fix it?
For example: total items in category A: 15 items
My site show 12 items per page. In the 1rst page, i can see 12 items but in the 2nd page, i see 3 duplicate items. So, 3 items are missed :/
I'm using 1.5.1.1
Sorry for my english,
Thanks a lot.
Had the same problem, it's just the sorting method that gives this problem.
I hope I can explain it to you:
go to: catelog/controller/product/category.tpl
Find:
Change This:
'p.sort_order'
to:
'pd.name' if you want to sort on name, when Z -> A then you have to change the ASC in the code to DESC.
if you want to sort on price: 'p.price' same here when decreasing prices, change to DESC.
Then it won't give problems anymore.
Hope it will help.
I hope I can explain it to you:
go to: catelog/controller/product/category.tpl
Find:
Code: Select all
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.sort_order';
}
if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'ASC';
}
'p.sort_order'
to:
'pd.name' if you want to sort on name, when Z -> A then you have to change the ASC in the code to DESC.
if you want to sort on price: 'p.price' same here when decreasing prices, change to DESC.
Then it won't give problems anymore.
Hope it will help.
Thanks JSSL.
I did this:
And in line 128, i did this:
Now, categories and sub-categories, work fine (no repeat items in the 2nd and next pages).
Thanks guys.
I did this:
Code: Select all
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.date_added';
}
if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'DESC';
}
Code: Select all
foreach ($results as $result) {
$data = array(
'filter_category_id' => $result['category_id'],
'filter_sub_category' => true
);
$product_total = $this->model_catalog_product->getTotalProducts($data);
$this->data['categories'][] = array(
'name' => $result['name'] . ' (' . $product_total . ')',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
}
Thanks guys.
JSSL wrote:Had the same problem, it's just the sorting method that gives this problem.
I hope I can explain it to you:
go to: catelog/controller/product/category.tpl
Find:Change This:Code: Select all
if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.sort_order'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; }
'p.sort_order'
to:
'pd.name' if you want to sort on name, when Z -> A then you have to change the ASC in the code to DESC.
if you want to sort on price: 'p.price' same here when decreasing prices, change to DESC.
Then it won't give problems anymore.
Hope it will help.
Thanks a lot, I tried other fixes suggested in different topics but ours worked perfect!
By the way upgrading doesn't solve the problem, I'm on 1.5.1.3 and had duplicates too.
Daniel wrote:i did set it to sort by name a while ago but got complaints from people that they wanted a sort order. now it causes problems.
one way to solve it is to add a sort order for ever product.
Makes sense for small shops, but having to set order for lots of products is a pain and if you remove, add etc. more products it becomes unmanageable since you can't see sort order in products view in Admin, so you'd have to open details for every single one to see what's going on..
I think that "'p.date_added" is the best way for set as default in OCDaniel wrote:i did set it to sort by name a while ago but got complaints from people that they wanted a sort order. now it causes problems.
one way to solve it is to add a sort order for ever product.

Hi Spirit & JSSL, im using 1.5.3 and got the same problem. But i modified catagory.php just like you did. And Great! ITS WORKED!spirit wrote:Thanks JSSL.
I did this:And in line 128, i did this:Code: Select all
if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.date_added'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'DESC'; }
Now, categories and sub-categories, work fine (no repeat items in the 2nd and next pages).Code: Select all
foreach ($results as $result) { $data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); $product_total = $this->model_catalog_product->getTotalProducts($data); $this->data['categories'][] = array( 'name' => $result['name'] . ' (' . $product_total . ')', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url) ); }
Thanks guys.
Dont forget to add [PROBLEM SOLVED] on the tittle of your post. Thanks guy

Thanks guy.
Code: Select all
go to: catelog/controller/product/category.tpl
Code: Select all
go to: catalog/controller/product/category.php
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
BRAVO people !!!
Another successfull assitance.
Another successfull assitance.
GxG Web Design Greece
Κατασκευή Ιστοσελίδων
Βελτιστοποίηση Ιστοσελίδων
Who is online
Users browsing this forum: No registered users and 16 guests