Adding Badges by Manufacturer

  • Posts: 259
  • Thank you received: 22
11 years 4 weeks ago #167224

-- HikaShop version -- : 2.3.0
-- Joomla version -- : 3.2.1

Is there a way to get badges to display based on the manufacturer rather than the product category? It seems a shame to have to replicate all of the manufacturers into product categories just for this.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 4 weeks ago #167261

Hi,

Please edit the file "administrator/components/com_hikashop/classes/badge.php" and replace

		$categoryClass = hikashop_get('class.category');
		$productClass = hikashop_get('class.product');
		$loadedCategories = $productClass->getCategories($product_id);
By
		$categories = array(
			'originals' => array(),
			'parents' => array()
		);
		$categoryClass = hikashop_get('class.category');
		$productClass = hikashop_get('class.product');
		$loadedCategories = $productClass->getCategories($product_id);

		if(isset($row->main->product_manufacturer_id))
			$categories['originals'][$row->main->product_manufacturer_id] = $row->main->product_manufacturer_id;
		if(isset($row->product_manufacturer_id))
			$categories['originals'][$row->product_manufacturer_id] = $row->product_manufacturer_id;
It will add the support for manufacturers for the badges.

In the badge configuration, instead of selecting a product category, you can select the target manufacturer in the "root / brand" part.

Regards,

PS : This modification will be include in the next HikaShop release.


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: 259
  • Thank you received: 22
11 years 4 weeks ago #167354

Jerome, that is brilliant. I am constantly amazed at the speed and quality of response I get from you guys. If I had posted anything like this on the Virtuemart forum it would have taken at least a week to get a response and the response would have been along the lines that my client shouldn't want to do that.

For the record, this is for one of two projects I currently have underway replacing other Joomla shopping carts (Virtuemart and Tienda) with Hikashop and my clients are loving it.

The following user(s) said Thank You: Jerome

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 4 weeks ago #167360

Thanks,

You'll make me blush !
(and for sure the rest of the team too when they will see your message)

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.

Time to create page: 0.042 seconds
Powered by Kunena Forum