My store owner wanted his products sorted by price in each category, but he wanted them sorted descending. I found the line in the core/fn.catalog.php file where the 'products_sorting':
I tried to override this with the my_changes addon, but I'm getting an error:
[quote]Hook fn_my_changes_products_sorting is not callable[/quote]
$sorting['price']['default_order'] = 'desc';
Any ideas why this isn't working? I guess I could change the /core.fn.catalog array to sort desc for price, but I'd rather not modify core files.
Put your hook in func.php versus the controller and it will work fine.
[quote name='tbirnseth' timestamp='1336502378' post='136082'] Put your hook in func.php versus the controller and it will work fine. [/quote]
Worked perfectly. Thank you sir!
I took this error,I faced white page.
[color=#000000]Hook fn_******_get_orders is not callable[/color]
how to get rid of this situation?
NOTE: I am using v401
Why are you deleting part of the error? That info would tell us what to tell you to change.
Whatever addon you are using “******” is using a fn_register_hooks() call for 'get_orders' and it cannot find the corresponding function.
The trick will work until you will have a catalog promotion , because the price will be recalculated after this particular hook
Please check controllers/customer/categories.php ```php
list($products, $search) = fn_get_products($params, Registry::get(‘settings.Appearance.products_per_page’));
fn_gather_additional_products_data($products, array(‘get_icon’ => true, ‘get_detailed’ => true, ‘get_options’ => true, ‘get_discounts’ => true, ‘get_features’ => false));
I consider you are using v2.2.3<br />
[color=#808080][size=2]part of hungryweb.net[/size][/color]
Getting similar error after enabling reward points addon. Appreciate a fix. thanks.
Hook fn_reward_points_load_products_extra_data is not callable
app/Tygh/Exceptions/DeveloperException.php, line: 41
The function should exist in the following file
Also ensure you clear your cache since hooks are cached.