Search for vendor listing

  • Posts: 13
  • Thank you received: 0
6 years 1 month ago #288133

Hi

Is it possible to create a vendor search module? Can this be done by using an event hook onBeforeVendorListingDisplay? Can I use this event to get the search results?

Can you give me some advice in what the best approach would be?

Regards
Wouter

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
6 years 1 month ago #288155

Hello,

In fact, you have almost "nothing" to do except that sending the parameter "search" (in the URL or as POST data).
HikaMarket vendor listing will automatically perform the search on the fields listing in "search_map" that you can see in data given during the trigger "onBeforeVendorListingDisplay".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 13
  • Thank you received: 0
6 years 1 month ago #288187

Thank you for your reply. Will this work as well when searching for keywords in the description or other fields?

Regards
Wouter

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
6 years 1 month ago #288189

Hello,

As mentioned, the list of fields is available via the trigger ( search_map ) and you can tweak it if you want to change/add/ the fields that you want to look into.
By default it's

$trigger_params['search_map'] = array(
	'vendor.vendor_name',
	'vendor.vendor_description',
	'vendor.vendor_id'
);

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 13
  • Thank you received: 0
6 years 1 month ago #288244

Thank you, this helps allot!

Regards
Wouter

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

  • Posts: 13
  • Thank you received: 0
6 years 1 month ago #288518

Hi Jerome,

I tried to create the extension as you described but when I put a variable in the search it is not working.
demo.hikashop.com/index.php/en/hikamarke...sting?search=vendor1

Even in the vendor listing if I request a variable as search it is not working.
Can you show me a working url as example?

Regards
Wouter

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
6 years 1 month ago #288523

Hello,

My bad, I didn't realized that the "pageInfo" is not loaded via the common function ; so the loading of the "search" is missing.
In the view.html.php file of the vendormarket folder ; please replace

	$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart_' . $this->params->get('main_div_name'), 0, 'int');
By
	$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart_' . $this->params->get('main_div_name'), 0, 'int');

	$pageInfo->search = JString::strtolower($app->getUserStateFromRequest($this->paramBase.'.search', 'search', '', 'string'));
	$pageInfo->search = trim($pageInfo->search);
And it would activate the search.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Moderators: Obsidev
Time to create page: 0.066 seconds
Powered by Kunena Forum