Display only categories of vendor in vendor page

  • Posts: 9
  • Thank you received: 0
8 years 3 months ago #225859

-- url of the page with the problem -- : ilaza.vn
-- HikaShop version -- : 2.6.0
-- HikaMarket version -- : 1.6.7
-- Joomla version -- : 3.4
-- PHP version -- : 5.5

Hello,

Please guide me how to display only categories of vendor in vendor page. Example: Vendor A create 3 categories: A1, A2, A3 in A category. Vendor B create 3 categories: B1, B2, B3, when user select vendor A, I want only show categories of A vendor. Please let me know which module I need use. Thanks you very much.

Regards,
Tri

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
8 years 3 months ago #225906

Hi,

The HikaMarket category class have a function "processListing".
When a category listing module is displayed in the vendor page ; that function can alter the content of the module.
The processing is only made when the setting "Synchronize" is on.

If the setting "only with products" is set in the category listing module configuration, HikaMarket will filter the category to only display thus which have products of the current vendor.

There is also some commented/unpublished code in that function in order to change dynamically the "main category" and target the vendor category instead:

if((int)$filter_type == 0) {
	$vendorClass = hikamarket::get('class.vendor');
	$rootCategory = $vendorClass->getRootCategory($vendor_id);
	if(empty($rootCategory))
		return;

	if(isset($filters['category_parent_id'])) {
		$filters['category_parent_id'] = 'a.category_parent_id = ' . (int)$rootCategory;
	} else {
		foreach($filters as &$filter) {
			if(substr($filter, 0, 23) != 'a.category_parent_id = ')
				continue;
			$filter = 'a.category_parent_id = ' . (int)$rootCategory;
			break;
		}
		unset($filter);
	}
}
You can place that code just below
$filter_type = $view->params->get('filter_type');
$filter_only_products = $view->params->get('only_if_products',0);
$vendor_id = hikamarket::getCID('vendor_id');
in order to activate the feature.
And I'll see to publish that in the next HikaMarket release.

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: 15
  • Thank you received: 0
8 years 3 months ago #226931

sorry when up old topic! but you can tell me where can i add this commented/unpublished code?
i find in mod_hikashop, mod_hikamarket but nothing at all.
can i add before yours update? because i need it.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
8 years 3 months ago #226933

Hi,

The HikaMarket category class have a function "processListing".

The HikaMarket category class is with the other HikaMarket classes, in the folder "administrator/components/com_hikamarket/classes/".

And don't worry, it's not an old topic ; it just have one week !

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: 15
  • Thank you received: 0
8 years 3 months ago #226977

Hi Jerome!
sorry but i don't see folder name 'classes' in com_hikamarket
there are 3 folder in com_hikamarket is views, controllers and fields.
my hikamarket version is: HikaMarket Multivendor: 1.6.7
my hikashop version is: HikaShop Business: 2.6.0

Last edit: 8 years 3 months ago by quangnguyen.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
8 years 3 months ago #226978

Hi,

administrator/components/com_hikamarket/classes/


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