Skip to main content

Show manufacturer on product listing table

More
11 years 9 months ago #181884 by tampasounds
-- 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.

More
11 years 9 months ago #181910 by Jerome
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.

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

More
11 years 9 months ago #181949 by tampasounds
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.

More
11 years 9 months ago #181993 by Mohamed Thelji
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 :
Code:
<?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.

More
11 years 9 months ago #182031 by tampasounds
<?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.

More
11 years 9 months ago #182063 by Xavier
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.

More
11 years 9 months ago #182216 by tampasounds
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.

More
11 years 8 months ago #184811 by babaei
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.

More
11 years 8 months ago #184812 by tampasounds
<?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.

More
11 years 8 months ago #184845 by Mohamed Thelji
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.

More
11 years 8 months ago #184865 by babaei

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.

More
11 years 8 months ago #185238 by Mohamed Thelji
Then you'll have to use a link like :
Code:
$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.

More
8 years 9 months ago #284166 by antigeek
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)
Code:
<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.

More
8 years 9 months ago - 8 years 9 months ago #284178 by nicolas
Hi,

I suppose that the "start of the URL" is the alias of the menu item.
That's because you have that code:
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: 8 years 9 months ago by nicolas.

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

Time to create page: 0.297 seconds
Powered by Kunena Forum