Assigning products to multiple categories

  • Posts: 44
  • Thank you received: 2
10 years 10 months ago #109347

Hi,

Thanks for the plugin. Unfortunately, the plugin doesn't do where he's meant for. Let me explain.

First of all, vendors should only be able to publish products in (a subcategory of) ROOT/Products. That can be achieved by setting the Vendors default root category, see attached screen dump (blue text). Furthermore, there's a main category for all vendors: ROOT/Vendors. The vendor specific category is then ROOT/Vendors/VendorX. This is also set in the global configuration of HikaMarket (same screen dump, orange text).

In your plugin, you're looking for the vendors root category (line 95), which in my case is set to ROOT/Products. And which is good! After all, vendors may only publish their products in ROOT/Products.

So, the plugin should not look for the vendors root category, but for the ROOT/Vendors/VendorX category and force that one. Only then will it be possible to relate the products to the vendors very own category. Am I right?

Best regards

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 10 months ago #109349

Hi,

Right, I made a modification in HikaSerial so it still load the value depending the configuration.

Well, you can fix it by editing the plugin "plugins/hikashop/productforcevendorcategory/productforcevendorcategory.php" and replace

		$vendorClass = hikamarket::get('class.vendor');
		$rootCategory = $vendorClass->getRootCategory($vendor_id);
By:
		$db = JFactory::getDBO();
		$db->setQuery('SELECT category_id FROM '.hikamarket::table('shop.category').' WHERE category_namekey = ' . $db->Quote('vendor_'.$vendor_id));
		$rootCategory = (int)$db->loadResult();
It will load the vendor category correctly (so: ROOT/Vendors/VendorX)

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: 10 years 10 months ago by Jerome.
The following user(s) said Thank You: praes

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

  • Posts: 44
  • Thank you received: 2
10 years 10 months ago #109350

Excellent! Problem solved! :laugh:
Thanks a lot.

Best regards

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

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