Remove main vendor form vendor dropdown field

  • Posts: 171
  • Thank you received: 9
10 years 3 weeks ago #149807

Hi!

It's fine that the "main" vendor can see all the orders in frontend. But what if I don't want to show main vendor as an option when making the order. How can I remove that option from the "vendor choose dropdown custom field"?

Thanks again,
PePe

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 3 weeks ago #149841

Hi,

It requires some modification in the core of HikaMarket.
I am investigating in order to improve the vendor selector and let him have some "filters".
But because this feature as to be compatible with both modes (dropdown and popup), the development is a little bit more complicated.

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: 171
  • Thank you received: 9
10 years 3 weeks ago #149873

Jerome wrote: Hi,

It requires some modification in the core of HikaMarket.
I am investigating in order to improve the vendor selector and let him have some "filters".
But because this feature as to be compatible with both modes (dropdown and popup), the development is a little bit more complicated.

Regards,


Thanks Jerome.
We gonne use dropdown version, temporary try to solve it with CSS display:none; .

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 3 weeks ago #149878

Hi,

Temporally, you can put a little modification in order to change the way that the dropdown works.
You can edit the file "administrator/components/com_hikamarket/types/vendor_selection.php" and replace

	public function displayDropdown($map, $value, $delete = false, $options = '', $id = '') {
		$vendorClass = hikamarket::get('class.vendor');
		$vendors = $vendorClass->getList();
		return JHTML::_('select.genericlist', $vendors, $map, $options, 'value', 'text', $value, $id);
	}
By
	public function displayDropdown($map, $value, $delete = false, $options = '', $id = '') {
		$vendorClass = hikamarket::get('class.vendor');
		$vendors = $vendorClass->getList();
		$app = JFactory::getApplication();
		if(!$app->isAdmin())
				unset($vendors[0]);
		return JHTML::_('select.genericlist', $vendors, $map, $options, 'value', 'text', $value, $id);
	}
It will help you to wait until the implementation of the feature.

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.
The following user(s) said Thank You: pepecortez

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

  • Posts: 171
  • Thank you received: 9
10 years 3 weeks ago #149894

Thanks again, Jerome!

Tried it out, but main vendor still shown. As I understand the code, these lines check weather the vendor is an admin of the site.
You think more in my ideas, but this is also great for later. But for me, now I just need to not show that main vendor I can set up here:
/administrator/index.php?option=com_hikamarket&ctrl=config#vendor

Your code could be also OK, but in that part of the admin backend, there's no way to add admin to vendor, and I think that's what your code is waiting for.

Jerome wrote: Hi,

Temporally, you can put a little modification in order to change the way that the dropdown works.
You can edit the file "administrator/components/com_hikamarket/types/vendor_selection.php" and replace

	public function displayDropdown($map, $value, $delete = false, $options = '', $id = '') {
		$vendorClass = hikamarket::get('class.vendor');
		$vendors = $vendorClass->getList();
		return JHTML::_('select.genericlist', $vendors, $map, $options, 'value', 'text', $value, $id);
	}
By
	public function displayDropdown($map, $value, $delete = false, $options = '', $id = '') {
		$vendorClass = hikamarket::get('class.vendor');
		$vendors = $vendorClass->getList();
		$app = JFactory::getApplication();
		if(!$app->isAdmin())
				unset($vendors[0]);
		return JHTML::_('select.genericlist', $vendors, $map, $options, 'value', 'text', $value, $id);
	}
It will help you to wait until the implementation of the feature.

Regards,

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 3 weeks ago #149900

Hi,

The configuration of the main vendor is a part of HikaMarket that you can't disable like that.
This main vendor should not be removed, it is the base of the front-end editing feature for you.

So, I have difficulties to understand what you want to do.

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: 171
  • Thank you received: 9
10 years 3 weeks ago #149940

Maybe I wasn't fully clear, so misunderstood.

On our site the main vendor should function just as an "administrator". Main vendor should see everything, do everything on frontend.
BUT! Users can make the orders directly just to the sub-vendors. So in checkout process, on the "Choose vendor" dropdown custom field, we wanna show all our sub-vendors, but do not the main vendor. In this way the main vendor can controll all the subvendors' orders, but the user can not make on order directly to the main vendor.

Jerome wrote: Hi,

The configuration of the main vendor is a part of HikaMarket that you can't disable like that.
This main vendor should not be removed, it is the base of the front-end editing feature for you.

So, I have difficulties to understand what you want to do.

Regards,

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 3 weeks ago #149969

Hi,

Ok so it is what I understood and the patch should do his job.
It remove the "main vendor" from the list of vendors when in the call is made from the fron-end.
So, the main vendor should not be displayed in the dropdown (in the front-end) anymore.

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: 171
  • Thank you received: 9
10 years 3 weeks ago #149998

Modified that file, but main vendor remains there unfortunately.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 3 weeks ago #150030

Hi,

Right, my fault.
The code is

		$app = JFactory::getApplication();
		if(!$app->isAdmin())
			unset($vendors[1]);
The main vendor is "1", no "0"...

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: 171
  • Thank you received: 9
10 years 3 weeks ago #150045

Perfect. Thanks!

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

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