Skip to main content

Remove main vendor form vendor dropdown field

More
12 years 6 months ago #149807 by pepecortez
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.

More
12 years 6 months ago #149841 by Jerome
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.

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

More
12 years 6 months ago #149873 by pepecortez

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.

More
12 years 6 months ago #149878 by Jerome
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
Code:
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
Code:
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.
The following user(s) said Thank You: pepecortez

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

More
12 years 6 months ago #149894 by pepecortez
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

Code:
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
Code:
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.

More
12 years 6 months ago #149900 by Jerome
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.

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

More
12 years 6 months ago #149940 by pepecortez
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.

More
12 years 6 months ago #149969 by Jerome
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.

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

More
12 years 6 months ago #149998 by pepecortez
Modified that file, but main vendor remains there unfortunately.

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

More
12 years 6 months ago #150030 by Jerome
Hi,

Right, my fault.
The code is
Code:
$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.

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

More
12 years 6 months ago #150045 by pepecortez
Perfect. Thanks!

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

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