
I recently had to provide a VirtueMart/Joomla solution for a customer. If you don’t know what VirtueMart is – it’s an open source ecommerce platform and it’s pretty good too.
They wanted a brand logo to be displayed in the product details, along with some other details. VirtueMart supports Manufacturer details but by default it just shows the manufacturer’s name in brackets, with a javascript pop-up window, that looks pretty ugly.
Fortunately we can add the logo by using the description field of the Manufacturers details and by hacking one file.
The following is tested and works for VirtueMart 1.1.3 and 1.1.4
So, open /administrator/components/com_virtuemart/html/shop.product_details.php
at around line 517, it looks like this:
517 518 519 520 521 522 523 524 525 | if( $manufacturer_id && !empty($manufacturer_name) ) { $link = "$mosConfig_live_site/index2.php?page=shop.manufacturer_page&manufacturer_id=$manufacturer_id&output=lite&option=com_virtuemart&Itemid=".$Itemid; $text = '( '.$manufacturer_name.' )'; $manufacturer_link .= vmPopupLink( $link, $text ); // Avoid JavaScript on PDF Output if( @$_REQUEST['output'] == "pdf" ) $manufacturer_link = "<a href=\"$link\" target=\"_blank\" title=\"$text\">$text</a>"; } |
replace it with:
517 518 519 520 521 522 523 524 525 526 527 528 529 530 | if( $manufacturer_id && !empty($manufacturer_name) ) { $manufacturer_link = $manufacturer_name; $q = "SELECT `manufacturer_id`,`mf_name`,`mf_email`,`mf_desc`,`mf_url` FROM `#__{vm}_manufacturer` WHERE "; $q .= "`manufacturer_id`=$manufacturer_id"; $db->query($q); if($db->next_record()) { $mf_name=$db->f("mf_name"); $mf_email=$db->f("mf_email"); $mf_desc=$db->f("mf_desc"); $mf_url = $db->f("mf_url"); } if (!empty($mf_desc)) $manufacturer_link = "$mf_desc"; } |

Product page showing the brand (manufacturer) logo
In the example above I’m using just the description (to show the logo) but you can use it to show other fields, just replace $mf_desc with $mf_name, $mf_email, $mf_url or a combination.
Just one warning: this is an unsupported hack, so when you upgrade VM, you must reapply it.
Hello Armand:
Thanks for the tutorial!
I did all your parameters, but is not working for me. Could you help me with that?
Thanks!
Osiris
Hmm, what happens?
Does the manufacturer link appear at all? By default it looks like this:
( Manufacturer Name )
and when you click on it, a window pops up.
If you don’t see a link at all — are you using the default template or something custom?
Hello:
Thanks for respond!
Yes I am using a custom template (RocketTheme Mynxx) and I think that is the problem!
OK, that explains it. Fortunately I tested the change on Mynxx so I know it works.
Edit the file
/components/com_virtuemart/themes/vm_mynxx/theme.config.phpand locate the line that saysshowManufacturerLink=0, change it toshowManufacturerLink=1. Save it and it should work now.Additionally, if you want to change where the link is placed in the product description, edit
/components/com_virtuemart/themes/vm_mynxx/templates/product_details/flypage.tpl.php. You will see some code like this:< ?php if( $this->get_cfg('showManufacturerLink') ) { echo "<div class=\"manufacturerbox\">$manufacturer_link</div>"; }?>You can move it for example above the product description or something.
Good luck!
Hello,
BIG THANK for the help about the logo. Do someone knows how I can add the manufacturerlogos by the browsepage? For the examle:
The buyer list the categori TV and see many Tv like Sony Smasung Philips etc. and I want to display under each product the small logo because it is difficulty ti read what is is for the each product, but with small logo its is ok.
Please help me if You can.
Best regards
This is a great hack but i can’t get it to work in version 1.5.10 with Mynxx there is no line 517! Any help to get this to work in the newer version of VM would be great!
1.5.10 is Joomla version number, Virtuemart component is still at 1.1.4 and I tested with the Mynxx theme.
Please make sure you are editing the right file (/administrator/components/com_virtuemart/html/shop.product_details.php)
If you still can’t find the code, contact me privately.