Author Topic: Manufacturer description on category page  (Read 9846 times)

derek webster

  • Jr. Member
  • **
  • Posts: 78
Re: Manufacturer description on category page
« Reply #15 on: February 13, 2020, 13:30:57 pm »
This one seems to work for me in VM 3.6.2


Code: [Select]
<?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'];
      }
       
?>