Show manufacturer on product listing table

  • Posts: 24
  • Thank you received: 0
9 years 4 months ago #181884

-- HikaShop version -- : 2.5.3
-- Joomla version -- : 3.3
-- PHP version -- : 5.3
-- Error-message(debug-mod must be tuned on) -- : How to show manufacturer on product listing table ?

How to show manufacturer (brand) on product listing table ?

Example

Product Name Product Code {Manufacturer} Vote Price [Add to Cart]

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
9 years 4 months ago #181910

Hi,

The best is to create a view override for the view product listing table.
Thanks to that you can add a new column and display the manufacturer in the cells.

www.hikashop.com/support/support/documen...ize-the-display.html

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: 24
  • Thank you received: 0
9 years 4 months ago #181949

Yes i have added the column and header in the listing_table view
I took this code from another thread because i do not know how to display the manufacturer url.
I see nowhere in your document where this is described ""How to show manufacturer url on listing_table""

I try this but does not work
<td>
<?php echo JText :: sprintf('MANUFACTURER_URL', '<a href="' . $this->element->product_url . '" target="_blank">' . $this->element->product_url . '</a>');?>
</td>

It only display words ""Brand Url: ""

How do show the manufacturer in each row on product listing_table ?

Thanks in advance

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

  • Posts: 12953
  • Thank you received: 1778
9 years 4 months ago #181993

Hello,
Using that code through the file "listing_img_title" of the view "product" of your front-end template via "Hikashop->Display->Views" will probably help you :

<?php
$manufacturerClass = hikashop_get('class.category');
$manufacturer = $manufacturerClass->get($this->row->product_manufacturer_id);
echo $manufacturer->category_name; 
?>

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

  • Posts: 24
  • Thank you received: 0
9 years 4 months ago #182031

<?php
$manufacturerClass = hikashop_get('class.category');
$manufacturer = $manufacturerClass->get($this->row->product_manufacturer_id);
echo $manufacturer->category_description;
?>


This does not return manufacturer on Products Listing_Table either ....

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

  • Posts: 13201
  • Thank you received: 2322
9 years 4 months ago #182063

Hi,

Are you sure that you are editing the view in the correct template ?
Please try: echo $manufacturer->category_name; instead of echo $manufacturer->category_description;

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

  • Posts: 24
  • Thank you received: 0
9 years 4 months ago #182216

Xavior and Mohamed

That was the solution.
I was so tired I didn't even realize that I was calling the wrong column(description)
Thank you so much for the extra attention and noticing the little details. It saved my day

Thanks again

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

  • Posts: 69
  • Thank you received: 1
9 years 3 months ago #184811

Hello
I add this code and it works.
How can we add link to manufacture name?

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

  • Posts: 24
  • Thank you received: 0
9 years 3 months ago #184812

<?php if ($this->config->get('show_code')) { $columns++;?>
<th class="hikashop_product_code_title" align="center">
<?php echo "Manufacturer"; ?>
</th>


Worked for me

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

  • Posts: 12953
  • Thank you received: 1778
9 years 3 months ago #184845

Hello,

How can we add link to manufacture name?

Where do you exactly want your customer to be redirected by using this link ?

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

  • Posts: 69
  • Thank you received: 1
9 years 3 months ago #184865

Mohamed Thelji wrote: Hello,

How can we add link to manufacture name?

Where do you exactly want your customer to be redirected by using this link ?


Hello
I want the customer redirected to manufacture products list.

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

  • Posts: 12953
  • Thank you received: 1778
9 years 3 months ago #185238

Then you'll have to use a link like :

$manufacturer_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=category&task=listing&cid='.$manufacturer_id.'&name='.$manufacturer->category_name.'&Itemid=MANUFACTURER _LISTING_ID'
MANUFACTURER _LISTING_ID : your manufacturer listing content menu ID
$manufacturer_id : your manufacturer ID

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

  • Posts: 5
  • Thank you received: 0
6 years 4 months ago #284166

I couldn't get the provided code to dd a link to the brands listing to work .
I have created the following for a link back to a products listing in listing_img_title.php ( as an override)

<span class="hikashop_product_brand"><?php

if($this->config->get('manufacturer_display', 1) && !empty($this->row->product_manufacturer_id)){
	$categoryClass = hikashop_get('class.category');
	$manufacturer = $categoryClass->get($this->row->product_manufacturer_id);
	if($manufacturer->category_published){
		$menuClass = hikashop_get('class.menus');
		$Itemid = $menuClass->loadAMenuItemId('manufacturer','listing');
		if(empty($Itemid)){
			$Itemid = $menuClass->loadAMenuItemId('','');
		}
		$categoryClass->addAlias($manufacturer);
		echo JText::_('').''.'<a href="'.hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer).'">'.$manufacturer->category_name.'</a>';
		echo "<span style='display:none;' itemprop='Brand'>". $manufacturer->category_name ."</span>";
	}
}?></span>

This almost works...It shows the list of products for the brand but for some reason it goes to a random product category in the URL ( so it shows that random category modules ( banners etc) ).

How would I change this so that the Link URL starts with "brands/" instead of the random category?

Thanks

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
6 years 4 months ago #284178

Hi,

I suppose that the "start of the URL" is the alias of the menu item.
That's because you have that code:

		$menuClass = hikashop_get('class.menus');
		$Itemid = $menuClass->loadAMenuItemId('manufacturer','listing');
		if(empty($Itemid)){
			$Itemid = $menuClass->loadAMenuItemId('','');
		}
This sets the $Itemid variable to the id of a menu item which is either a brands listing or a categories listing.
And then, Joomla's SEF systme uses that id to get the alias of the menu item and use it at the beginning of the URL.
So if you want to have a specific text there, you should create a menu item of the type HikaShop category configured to display the brands, set in it the alias you want (brands) and use such code:
$Itemid = XXX;
where XXX is the id of that menu item.

Last edit: 6 years 4 months ago by nicolas.

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

Time to create page: 0.118 seconds
Powered by Kunena Forum