Search cutsom field and order date in order listing on front-end

  • Posts: 33
  • Thank you received: 0
6 years 7 months ago #290489

-- HikaShop version -- : 3.4.0 business
-- Joomla version -- : 3.8.6
-- PHP version -- : 7.1.14
-- Browser(s) name and version -- : Firefox 59.0.2 (64 bits)

Hi,

I have created a custom field (custom reference - filed by user on checkout) that is displayed as a column on the order listing for the user in front-end,

I would like the search field to search also into that column (currently it seems to search only the order number column), and additionaly, into the order date column, so the user can search either a date, his custom reference or an order number.

how can I do that ? I see nothing in the order/listing.php view that could help

Thanks

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
6 years 7 months ago #290490

Hi,

You would have to modify that code:

		$searchMap = array(
			'hk_order.order_id',
			'hk_order.order_status',
			'hk_order.order_number'
		);
		$orderingAccept = array(
			'hk_order.'
		);
		$this->processFilters($filters, $order, $searchMap, $orderingAccept);
in the file components/com_hikashop/views/order/view.html.php

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

  • Posts: 33
  • Thank you received: 0
6 years 7 months ago #290508

Perfect, it works, thanks

ps: are you aware that the search on hk_order.order_status doesnt work with translated websites ?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
6 years 7 months ago #290515

Hi,

It's normal because only the english value is storred in MySQL and it is then translated dynamically in PHP.
So to search through the orders with the order status isn't possible with a MySQL query.
Instead, it would be better to have a status filter dropdown, like there is in the backend.

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

  • Posts: 33
  • Thank you received: 0
6 years 7 months ago #290606

Yes, but I mean, there is no mention in documentation that the search field doesnt work equally with translated versions of hikashop

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
6 years 7 months ago #290647

Hi,

Well, first a search field isn't meant to search the name of the order statuses. It was added as an extra capability.
Second, we actually plan on redoing the order listing interface basing ourselves of the order listing interface of HikaMarket Multivendor. So when we do, we'll have the order status dropdown to fitler the orders and thus there will be no point to try to search statuses with the search box.
But thank you for your feedback.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum