Order - Filter Status - retain between sessions

  • Posts: 52
  • Thank you received: 6
  • Hikashop Business
2 years 5 months ago #342101

-- 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.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
2 years 5 months ago #342106

Hi,

There is no option for that.
However, what you can do is this:
- change the line:

$pageInfo->filter->filter_status = $app->getUserStateFromRequest($this->paramBase.".filter_status",'filter_status', '','array');
to:
$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.

  • Posts: 52
  • Thank you received: 6
  • Hikashop Business
2 years 5 months ago #342119

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.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
2 years 5 months ago #342122

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.

  • Posts: 52
  • Thank you received: 6
  • Hikashop Business
2 years 5 months ago #342152

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.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
2 years 5 months ago #342158

Hi,

Try changing the same line of code to:

$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.

  • Posts: 52
  • Thank you received: 6
  • Hikashop Business
2 years 5 months ago #342178

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.044 seconds
Powered by Kunena Forum