Hide All Created Orders in Cpanel and Order Listing

  • Posts: 303
  • Thank you received: 18
  • Hikashop Business
5 years 1 month ago #305047

-- HikaShop version -- : 4.0.3
-- Joomla version -- : 3.9.4
-- PHP version -- : 7.2

How would i go about hiding all orders with the order status "created" in the cpanel recent orders and orders listing page?

I tried using the following conditional inside the foreach loop on the 'cpanel_orders' and 'order_listing' view file:

if ($row->order_status != 'created'){ ... }

and it hides the created orders, but the pagination and total order numbers are off. I'm sure there is probably a more elegant way to accomplish this. Any thoughts?

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

  • Posts: 1119
  • Thank you received: 114
5 years 1 month ago #305051

Hi,

Maybe this topic will help you? Almost similar question was answered today....

www.hikashop.com/forum/orders-management...frontend.html#305029

Thanks

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

  • Posts: 303
  • Thank you received: 18
  • Hikashop Business
5 years 1 month ago #305052

That is a much more elegant solution to one piece of the problem. Thanks! However, this change does still does not effect the pagination numbers or number of orders displayed.

Still showing the total count (including the order status that's hidden). Probably a simple fix, but I couldn't figure out how the sort and filter part is tabulating the total orders returned.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
5 years 1 month ago #305076

Hi,

If you want the pagination to be correct, then you'll have to modify the MySQL query which loads the orders to add your condition on the order_status.
You'll have to do that in the core files of HikaShop via FTP and you'll loose your changes when you update HikaShop.
For example, for the orders listing, it's the file components/com_hikashop/views/order/view.html.php where you can add such line:

$filters[] = 'hk_order.order_status != \'created\'';
before the line:
$this->processFilters($filters, $order, $searchMap, $orderingAccept);

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

  • Posts: 303
  • Thank you received: 18
  • Hikashop Business
5 years 3 weeks ago #305286

Ah i see. Thanks for the help!

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

Time to create page: 0.073 seconds
Powered by Kunena Forum