Quick fix for v4.0.1 products position issue

Bug: http://forum.cs-cart…ion-not-saving/


  1. Modifying core file:

    #on file [color=#ff0000]app/functions/fn.catalog.php[/color]

    #after
    $params['extend'][] = 'companies';
    #addif (!empty($params['cid'])) {
    $params['extend'][] = 'categories';
    }



  2. Using hooks:

    #on file [color=#ff0000]app/addons/my_changes/init.php[/color]

    #add```php
if (!defined('BOOTSTRAP')) { die('Access denied'); }
fn_register_hooks(
'get_products_pre'
);
```

PS: if file is present just add [color=#ff0000]'get_products_pre'[/color]

#on file [color=#ff0000]app/addons/my_changes/func.php[/color]
#add```php
if (!defined('BOOTSTRAP')) { die('Access denied'); }
function fn_my_changes_get_products_pre($params, $items_per_page, $lang_code){
if(AREA=='A'){
if (!empty($params['cid'])) {
$params['extend'][] = 'categories';
}
}
}
```

PS: if file is present just add function [color=#ff0000]fn_my_changes_get_products_pre[/color]


I hope that helps,

---
Valentin
[color=#808080][size=2]part of hungryweb.net[/size][/color]