Fix If Your Product Position Numbers Are Randomly Changing Or Not Saving (4.2.4)

This bug has been driving us nuts since we upgraded from 4.2.1 to 4.2.4

We sell motors from 6w through to 100w, but since the upgrade, all the positioning information was somehow corrupted.



So we would have 40W, then 6w, then 80w, then 45w, then 65w etc etc and everytime we tried to change the positioning using the numbers, cs-cart would seemingly randomly throw everything into different positions and change the numbers by itself!!!



Here is a fix for that



Download

fn.catalog.php from app/functions/



Make a backup copy.



Find this in the fn.catalog.php


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);}




Now change it to this:



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);}




I have confirmed with cs-cart that this is a bug in the current version of the code, but others have had this problem too, so I don't know why they didn't post the fix. C'mon guys help each other out, if just one of you had posted this fix, I wouldnt have had to wait a week and a half for cs-cart support to tell me this!




[quote]

Thank you for your message.



I am glad that the issue is resolved now. Yes, the problem is caused by a bug in the current CS-Cart version.



Thank you.

[/quote]