Vendor custom field filter

  • Posts: 355
  • Thank you received: 28
  • Hikashop Business Hikashop Multisite
1 year 4 months ago #347654

Hi,

Is it a way to filter vendors with they custom fields ?
I mean, in my multi-vendor project for food delivery, i want to be able to show only vendor who sell hamburger for example.

So if i create a custom field with the type of food "hamburger" in the vendor custom field, how can i use this to filter ?
With the standard filter module ?

Regards


“Si tu ne travaille pas pour tes rêves, quelqu'un t'embauchera pour travailler pour les siens" - Steeve Jobs
"La sagesse, c’est d’avoir des rêves suffisamment grands pour ne pas les perdre de vue quand on les poursuit." - Oscar Wilde

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
1 year 4 months ago #347662

Hello,

It requires some custom development ; the feature is not directly available via the HikaShop filter system (which is based on the HikaShop fields).

HikaMarket already adds a "filter" via the HikaShop trigger "onBeforeProductListingLoad" :
www.hikashop.com/support/documentation/6...reProductListingLoad

So the plugin will already add the database table join on the HikaMarket vendor table and include in $filters the entry "active_vendor" to remove the products of unpublished vendors.

$filters['active_vendor'] = '(hikam_vendor.vendor_published IS NULL OR hikam_vendor.vendor_published = 1)';
By adding a new entry in the $filters variable, you can filter display of products based on the field you want.

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: 355
  • Thank you received: 28
  • Hikashop Business Hikashop Multisite
1 year 4 months ago #347668

OK thank you. But i am not a programmer... :)

Question 1 :
But i have to thing about the principe. If a user will eat a burger, how can i purpose to him different type of burger vendor ?
Perhaps with the search filter it will work ?

Question 2 :
Actually, i will use 2 menus (Restaurants and commerce) linked to catégories. And in the configuration, i link the categories to vendor page.
Each vendor will have its own category and sub-categories. I use the vendors page + the Hikamarket module to show the vendor product under the vendor page, sorted by categories.

So i dont know how i can use a "view" for searching a product with the whole shop products ?
I am a bit confusing in the fact i dont use the standard categories but the vendors page...

But in fact, i have to use a filter to search if i want eat a burger or a pizza, and be able to select one of the vendors purpose.


“Si tu ne travaille pas pour tes rêves, quelqu'un t'embauchera pour travailler pour les siens" - Steeve Jobs
"La sagesse, c’est d’avoir des rêves suffisamment grands pour ne pas les perdre de vue quand on les poursuit." - Oscar Wilde
Last edit: 1 year 4 months ago by thefbi.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
1 year 4 months ago #347695

Hello,

Regarding the HikaShop filters, it will be best to ask the HikaShop support team.
That system is not extensible via plugins so HikaMarket is not able to add new entries to filter on special columns.

For the usage of a filter within a module, they would also be more appropriate to answer you.
From the HikaMarket point of view, the vendor product listing is an HikaShop product listing module which is displayed in a specific place of the vendor page ; that module receive a special $filters to just show the current vendor's products.

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: 355
  • Thank you received: 28
  • Hikashop Business Hikashop Multisite
1 year 4 months ago #347698

OK, thank you.

I tried with the filter module that brings the results on the full list of products, it works.

I could use this function, by activating the option of the seller names on the "sold by" products.

This way, I can display all the burgers, with the name of the restaurants (vendors) that offer it.


“Si tu ne travaille pas pour tes rêves, quelqu'un t'embauchera pour travailler pour les siens" - Steeve Jobs
"La sagesse, c’est d’avoir des rêves suffisamment grands pour ne pas les perdre de vue quand on les poursuit." - Oscar Wilde

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

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