Skip to main content

Order - Filter Status - retain between sessions

More
4 years 4 months ago #342101 by dhusband
-- HikaShop version -- : 4.6.0
-- Joomla version -- : 3.10.9
-- PHP version -- : 7.4.29
-- Browser(s) name and version -- : Firefox

I have a number of different Order statuses for different stages in the order journey. Once an order is complete, I rarely need to see it, therefore I filter to just open order status.
When you close the browser it loses what you have set the filter to and you have to work through setting all the open statuses again.
Is it possible the options set in the filter could be remembered between sessions?

Thank you
David

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #342106 by nicolas
Hi,

There is no option for that.
However, what you can do is this:
- change the line:
Code:
$pageInfo->filter->filter_status = $app->getUserStateFromRequest($this->paramBase.".filter_status",'filter_status', '','array');
to:
Code:
$pageInfo->filter->filter_status = $app->getUserStateFromRequest($this->paramBase.".filter_status",'filter_status',$config->get('default_order_status_on_order_listing', ''),'array');
in the file administrator/components/com_hikashop/views/order/view.html.php
- Then, open the table hikashop_config in your database and add an entry with the namekey default_order_status_on_order_listing and the value being the namekey of the order status you want to filter your orders listing by default.
That way, when you arrive on the orders listing it will be filtered by that order status by default.
We'll add that code modification on our end so that you won't loose it when you update your HikaShop.

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #342119 by dhusband
That is brilliant.
Is possible to have multiple statuses as default? Can they be entered separated by ',' or another delimiter?

Thank you for the quick reply.

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #342122 by nicolas
Hi,

I've never tried but I don't think it would work. You can try it.

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #342152 by dhusband
I have tried , and ;
Neither worked, a filter was applied, but not a valid one.
Is this something that could be done?

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #342158 by nicolas
Hi,

Try changing the same line of code to:
Code:
$pageInfo->filter->filter_status = $app->getUserStateFromRequest($this->paramBase.".filter_status",'filter_status',explode(',',$config->get('default_order_status_on_order_listing', '')),'array');
That should allow you to use the comma as a separator in the database.

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #342178 by dhusband
Brilliant!
I can now clearly see my open orders as soon as I open the orders screen.
Thank you!
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.184 seconds
Powered by Kunena Forum