i have noticed that some products are duplicating on my website, for example i have a photo frame under "gifts for children" on page 1 then when i go to page 2 the same product is on that page further down the product list, the same is happening for a few products
i have checked "links" in backoffice and i only have that category selected, does anyone have a clue?
Reason: Title adjusted, moved
Matthew
by default the order the products are returned from the database is by sort order.
Many people will not enter this when editing/adding a product and so essentially every product has the same sort order.
When page 2 is clicked in the product list, the query is run again and consequently returns different results.
This fix may work,
in catalog/model/catalog/product.php
find:
Code: Select all
$sql .= " ORDER BY p.sort_order";
Code: Select all
$sql .= " ORDER BY p.sort_order ASC p.product_id";
find
Code: Select all
$sort = 'p.sort_order';
Code: Select all
$sort = 'p.sort_order ASC p.product_id';
Hiuksitebuilder wrote:Check the file still has those changes in my post above
i've checked and file still has code change, it is working on some products but i've noticed there is still a few that appear on different pages of the same category
Matthew
I really have too many products to go back and sort order them all. I can't really see this being feasible moving forward either.
Has anyone got a recommended fix for this? We were hoping to launch our site this week and only found this glaringly obvious bug today!!
Thank you in advance.
All you have to do is in admin settings/edit/option then type a high number for number of product displayed on page.aledmann wrote:I really have too many products to go back and sort order them all. I can't really see this being feasible moving forward either.
for mine i typed 10 as i don't have more than ten products per page in each categories
Matthew
uksitebuilder wrote: in catalog/model/catalog/product.php
find:change to:Code: Select all
$sql .= " ORDER BY p.sort_order";
Code: Select all
$sql .= " ORDER BY p.sort_order ASC p.product_id";
This kind of fixed my sorting issues, but after few page reloads it repeats again..
Did you mean catalog/controller/product/category.php ? Done this part and got this error when browsing to any category:uksitebuilder wrote: catalog/controller/catalog/category.php
findchange toCode: Select all
$sort = 'p.sort_order';
You may need to repeat the last change above in search.php, manufacturer.php and special.phpCode: Select all
$sort = 'p.sort_order ASC p.product_id';
Code: Select all
Notice: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'p.product_id ASC LIMIT 0,15' at line 1
Error No: 1064
SELECT p.product_id, (SELECT AVG(rating) AS total FROM review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN product_to_category p2c ON (p.product_id = p2c.product_id) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND p2c.category_id = '66' GROUP BY p.product_id ORDER BY p.sort_order ASC p.product_id ASC LIMIT 0,15 in /home/seventea/public_html/system/database/mysql.php on line 49
$sql .= " ORDER BY p.sort_order"; appears twice in catalog/model/catalog/product.php, so I changed both entries..
Still got those SQL errors in random categories, so no joy. This fix also $#@%&( up google base product feed - got SQL error too..

Or a fix in the code preventing this from happening.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
i2Paq wrote:I think that the sort-order field when entering a product should be mandatory.
Or a fix in the code preventing this from happening.
And if I have 852 products, remove three in the middle and then want to add one, remove few more and add some tomorrow, will you re-edit sort order on all of them for me please? :-)
SureAnonyMoose wrote:will you re-edit sort order on all of them for me please? :-)

Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
i2Paq wrote:SureAnonyMoose wrote:will you re-edit sort order on all of them for me please? :-)
Got screenshot, you have no excuses now! ;P
I wonder who banned youAnonyMoose wrote:Got screenshot, you have no excuses now! ;Pi2Paq wrote:SureAnonyMoose wrote:will you re-edit sort order on all of them for me please? :-)

Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Users browsing this forum: No registered users and 15 guests