Product Sort Order With Multiple Categories

Hi



I have a project where many of the products are across multiple categories



When I try to control the sort order by entering numbers in the product view (10,20,30 etc), even within it's primary category, when I hit save they revert to 0



I've just tried this on the demo too and it's the same problem



If I take the product out of other categories (ie just under the main category) then sorting works again, I can then add it back to other categories and it sort of works, but as soon as you try to alter it it's screwed up again??



This seems to be a pretty serious bug?? I can't even control the product order in its main category



Any ideas





Thanks





Lee

I've just posted the same question. Bugs appear to be classed as major features from my experience over the years.

I must admit this worried the hell out of me on Friday, the site is almost finished and it's important products are ordered specifically as they are related items and should display in groups not by price or alphabetically. If the customers brings it up I'm going to have a real problem!

If you are interested, we can examine the issue and fix it on your store. Feel free to contact us

Hi



I've had a response from support on this which I've just tested and it seems to work perfectly!



Code was at line 7349 for me (4.2.4)



Lee



Thank you for your message.



To resolve the issue with positions in category, please replace this part of code:

if (in_array('categories_filter', $params['extend'])) {

$category_filter_avail_cond = str_replace('?:categories', 'categories_filter', $category_avail_cond);

$join .= " INNER JOIN ?:products_categories as products_categories_filter ON products_categories_filter.product_id = products.product_id INNER JOIN ?:categories AS categories_filter ON categories_filter.category_id = products_categories_filter.category_id $category_filter_avail_cond ";

$condition .= fn_get_localizations_condition('categories_filter.localization', true);

}



with this one:

if (in_array('categories_filter', $params['extend'])) {

$category_filter_avail_cond = str_replace('?:categories', 'categories_filter', $category_avail_cond);

$join .= " INNER JOIN ?:products_categories as products_categories_filter ON products_categories_filter.product_id = products.product_id INNER JOIN ?:categories AS categories_filter ON categories_filter.category_id = products_categories_filter.category_id $category_filter_avail_cond ";

$fields['categories_position'] = $sortings['position'] = 'products_categories_filter.position';

$condition .= fn_get_localizations_condition('categories_filter.localization', true);

}



in the app/functions/fn.catalog.php file of your CS-Cart installation.

http://forum.cs-cart.com/tracker/issue-5404-bug-with-saving-position-of-product-in-category/