Restrict user (groups) to certain vendors

  • Posts: 48
  • Thank you received: 0
11 years 2 months ago #88995

Hi,

1) I want to put users to user groups together. To each user group, one ZIP-code is assigned.

2) For each vendor, I would like to assign one or several ZIP-codes (= the delivery area).

Now - each user of the certain user group sees only the products of the vendors, where the ZIP-codes match.


What would be the best way to configure this?

Thanks a lot.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
11 years 2 months ago #89122

Hi,

It would be complicated to specify a zip code on a user group because a user group is a joomla user group. It's something which we could not extend.
You can create custom fields on vendors, so you can create this new "ZIP-codes" option. And you can create custom fields on users, so you can set the "zip-code" per user (but not per group of users).

Finally, it is possible to create a filter custom plugin which would add some filters rules on product listing and product page.
With the plugin, you can insert new SQL rules in order to check the match between the user zip-code and the vendor zip-codes.

This is the best configure I see for your requirement.

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: 48
  • Thank you received: 0
11 years 2 months ago #89134

OK I see, which is a pity. Hoped, it could be made easier.

I think a geographic restriction of vendors to certain users or user groups would be an extremly valuable feature also for many other HikaMarket users. Maybe another solution could be find?

For my solution: I think making custom fields for the user and the vendor, I will find out easily, how to do.

What about the filter custom plugin? Is this something to "configure", or do I need to make that in PHP and database SQL changes? Not clear yet for me... :(

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
11 years 2 months ago #89139

Hi,

You can take a look on the trigger "onBeforeProductListingLoad" and on the "HikaShop market" plugin (plugins/com_hikashop/market/market.php).
This plugin uses a lot of trigger and you would find the trigger which could give you some examples.

/**
 *
 * @param array $filters
 * @param string $order
 * @param object $view
 * @param string $select
 * @param string $select2
 * @param string $ON_a
 * @param string $ON_B
 * @param string $ON_c
 */
public function onBeforeProductListingLoad(&$filters, &$order, &$view, &$select, &$select2, &$ON_a, &$ON_b, &$ON_c)
We are updating the developer documentation in order to give more details on this trigger and his possibilities.
The trigger allow you to modify the SQL request which would be done for the product listing. You can add a "filter" in the $filters array which would be use in the "WHERE" clause.
$order is for the ordering
$view if the view object so you can access to his parameters
The $select are for extra queries and the $ON_ are for the table links.

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.
Last edit: 11 years 2 months ago by Jerome.

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

  • Posts: 48
  • Thank you received: 0
11 years 2 months ago #89169

Thanks Jerome,
at the moment, this exceeds by far my knowledge in PHP, although I am planning to dig more into it. At the moment, I can only "copy, paste & adapt" PHP, but I dont really understand it yet.

I think a possible solution for me is to wait until the SEBLOD plugin for HIKASHOP is ready, with which I should be able to build a filtered product list - at least I hope so...

Alex

Last edit: 11 years 2 months ago by theweasel68.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
11 years 2 months ago #89270

Hi,

If you want, we could see together by email what would be possible to do with a custom plugin.
I don't know what the SEBLOD team have planned for their integration with HikaShop, I guess that we would be able to talk with them during the next Joomla Day.

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: 48
  • Thank you received: 0
11 years 2 months ago #89312

Hi Jerome,
yes that would be fantastic - I think that feature would also give a significant value to other customers of HikaMarket - I would see it as one of the central elements of every shop, where someone wants to combine online transactions with regionally restricted vendors...

Shall I PM my eMail to you?

Alex

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
11 years 2 months ago #89425

Hi,

I send you an email using the email address of your Joomla account in our website.

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