News:

Support the VirtueMart project and become a member

Main Menu

Manufacturer description on category page

Started by techrahul87, May 01, 2012, 09:38:52 AM

Previous topic - Next topic

derek webster

This one seems to work for me in VM 3.6.2


<?php
$app 
JFactory::getApplication();
$virtuemart_manufacturer_id $app->input->getCmd('virtuemart_manufacturer_id''');
echo 
$virtuemart_manufacturer_id ;
 if (empty(
$this->keyword)) {
   echo 
$this->category->category_description ;
   
//check to see if category is manufacturer --> this below is added
   
$jinput JFactory::getApplication()->input;
   
$trigger$virtuemart_manufacturer_id;
   
$mid $trigger;
   if (!empty(
$mid)) {
      
$lang=&JFactory::getLanguage();
      
$dba=JFactory::getDBO();
      
$dba->setQuery("SELECT * FROM #__virtuemart_manufacturers_".str_replace("-","_",strtolower($lang->getTag()))." WHERE ".$trigger."=".$mid.";");
      
$dba->query();
      
$muresult=$dba->loadAssoc();
      
$dbb JFactory::getDBO();
      
$dbb->setQuery("SELECT virtuemart_media_id FROM #__virtuemart_manufacturer_medias WHERE virtuemart_manufacturer_id=".$mid.";");
      
$dbb->query();
      
$media_id $dbb->loadResult();
      
$dbc JFactory::getDBO();
      
$dbc->setQuery("SELECT file_url FROM #__virtuemart_medias WHERE virtuemart_media_id=".$media_id.";");
      
$dbc->query();
      
$file_url $dbc->loadResult();
   }
}
      
      if (!empty(
$file_url)) {
      
?>

         <img src="<? echo $file_url ?>" alt="<? echo $this->category->category_name ?>" align="right" style="margin:0 25px 0 25px">
      <?php 
      



echo 
$file_url;
echo 
"<h1>";


echo 
$this->category->category_name;
echo 
"</h1>";
      if(!empty(
$muresult['mf_desc'])) {
         echo 
$muresult['mf_desc'];
      }
       
?>