
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.
Hi there,
First of all, I’d like to thank you for your work, it’s very instructive!
I changed the code by following your advices and the correct files but it’s not working, nothing is showing up now. It used to show the manufacturer’s link but since the changes, nothing’s showing up.
I worked on both shop.product_details.php and theme.config.php.
In the backend, I also activated “show manufacturer link”.
Any Idea ? you can have a look at this page : http://www.lacompagniedudestockage.fr/index.php?page=shop.product_details&product_id=30&flypage=flypage.tpl&pop=0&option=com_virtuemart&Itemid=278
Thanks by advance Armand!
Regards,
Alexandre
If you get a blank page, it’s most likely a PHP error. You must either enable display of PHP errors or look in the PHP error log (I can’t help you with the exact steps you need to take to do that since it differs from post to post).
After you manage to do that, please contact me privately.
Hello, first of all thank you for the great hack, but I have one problem, after I did the modification only the image from the description shows up but it is not clickable and now does not open the good old and ugly pop up box with manufacturer details. I want it to work exactly as before but instead of (text) to show the manufacturer logo and when clicked to open the pop up box.
You put in the image and make it a link from the editor. Basically, whatever you put in the manufacturer description gets displayed in the product page. I used it to show just an image, you you can put a link on the image or even add text.
Hello,
It works for me ! Thank you sooooooooooo much !

Curious, line 460 is the last one in my shop.product_details.php
VM = 1.1.4
Joomla = 1.5.17
Suggestions?
It looks like a great hack….Just what I’m looking for!
Are your sure you’re looking at the right file? It has to be in
/administrator/Hi Armand,
Sorry for my late reply.
In 1.1.4 I only have 460 lines in that file.
You can find it here: http://www.artenweb.nl/shop.product_details.rar
Regards,
In your file, that code starts at line 266.
Excellent toturial
but how display logo in browse page
Thanks
There’s no way I know of to do this, not with major rewriting anyway.
the same thing for me. its the last line.
You must locate the code, it may not be on that line in your version, but it is there in the file.
how add manufacturer image in browse page…. for producto.
There is no way to do this currently, sorry.