{"id":250,"date":"2010-03-28T02:34:39","date_gmt":"2010-03-28T00:34:39","guid":{"rendered":"http:\/\/kavdesign.net\/wordpress\/?p=250"},"modified":"2010-03-28T02:34:39","modified_gmt":"2010-03-28T00:34:39","slug":"virtuemart-how-to-show-manufacturer-logo-in-product-details","status":"publish","type":"post","link":"https:\/\/www.kavdesign.net\/blog\/coding\/virtuemart-how-to-show-manufacturer-logo-in-product-details\/","title":{"rendered":"VirtueMart how to show manufacturer logo in product details?"},"content":{"rendered":"<p>VirtueMart supports Manufacturer details but by default it just shows  the manufacturer\u2019s name in brackets, with a javascript pop-up window,  that looks pretty ugly.<\/p>\n<p>Fortunately we can add the logo by using the description field of the  Manufacturers details and by hacking one file.<\/p>\n<p>The following is tested and works for VirtueMart 1.1.3 and 1.1.4<\/p>\n<p>So, open <code>\/administrator\/components\/com_virtuemart\/html\/shop.product_details.php<\/code><\/p>\n<p><!--more-->at around line 259, it looks like this:<\/p>\n<blockquote><p>if( $manufacturer_id &amp;&amp; !empty($manufacturer_name) ) {<br \/>\n$link = &#8220;$mosConfig_live_site\/index2.php?page=shop.manufacturer_page&amp;amp;manufacturer_id=$manufacturer_id&amp;amp;output=lite&amp;amp;option=com_virtuemart&amp;amp;Itemid=&#8221;.$Itemid;<br \/>\n$text = $manufacturer_name;<br \/>\n$manufacturer_link .= vmPopupLink( $link, $text );<\/p>\n<p>\/\/ Avoid JavaScript on PDF Output<br \/>\nif( @$_REQUEST[&#8216;output&#8217;] == &#8220;pdf&#8221; )<br \/>\n$manufacturer_link = &#8220;&lt;a href=\\&#8221;$link\\&#8221; target=\\&#8221;_blank\\&#8221; title=\\&#8221;$text\\&#8221;&gt;$text&lt;\/a&gt;&#8221;;<br \/>\n}<\/p><\/blockquote>\n<p>replace it with:<\/p>\n<div id=\"attachment_462\" style=\"width: 358px;\">\n<blockquote><p>if( $manufacturer_id &amp;&amp; !empty($manufacturer_name) ) {<br \/>\n$manufacturer_link = $manufacturer_name;<br \/>\n$q\u00a0 = &#8220;SELECT `manufacturer_id`,`mf_name`,`mf_email`,`mf_desc`,`mf_url` FROM `#__{vm}_manufacturer` WHERE &#8220;;<br \/>\n$q .= &#8220;`manufacturer_id`=$manufacturer_id&#8221;;<br \/>\n$db-&gt;query($q);<br \/>\nif($db-&gt;next_record())<br \/>\n{<br \/>\n$mf_name=$db-&gt;f(&#8220;mf_name&#8221;);<br \/>\n$mf_email=$db-&gt;f(&#8220;mf_email&#8221;);<br \/>\n$mf_desc=$db-&gt;f(&#8220;mf_desc&#8221;);<br \/>\n$mf_url = $db-&gt;f(&#8220;mf_url&#8221;);<br \/>\n}<br \/>\nif (!empty($mf_desc))\u00a0 $manufacturer_link = &#8220;$mf_desc&#8221;;<br \/>\n}<\/p><\/blockquote>\n<p>Product page showing the brand (manufacturer)  logo<\/p><\/div>\n<p>In the example above I\u2019m using just the description (to show the  logo) but you can use it to show other fields, just replace <code>$mf_desc<\/code> with <code>$mf_name<\/code>, <code>$mf_email<\/code>, <code>$mf_url<\/code> or a combination.<\/p>\n<p>Just one warning: this is an unsupported hack, so when you upgrade  VM, you must reapply it.<\/p>\n<p>Original publication by <span>Armand  Niculescu<\/span>: <a href=\"http:\/\/www.richnetapps.com\/virtuemart-show-manufacturer-logo-in-product-details\/\" target=\"_blank\">http:\/\/www.richnetapps.com\/virtuemart-show-manufacturer-logo-in-product-details\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>VirtueMart supports Manufacturer details but by default it just shows the manufacturer\u2019s name in brackets, with a javascript pop-up window, that looks pretty ugly. Fortunately<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/www.kavdesign.net\/blog\/coding\/virtuemart-how-to-show-manufacturer-logo-in-product-details\/\">Continue reading<span class=\"screen-reader-text\">VirtueMart how to show manufacturer logo in product details?<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[9],"tags":[55,54,58,33],"class_list":["post-250","post","type-post","status-publish","format-standard","hentry","category-coding","tag-logo","tag-manufacturer","tag-product-details","tag-virtuemart","entry"],"_links":{"self":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/comments?post=250"}],"version-history":[{"count":2,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/250\/revisions"}],"predecessor-version":[{"id":252,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/250\/revisions\/252"}],"wp:attachment":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/media?parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/categories?post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/tags?post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}