VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: edina on April 18, 2016, 14:19:32 PM

Title: Remove category list from manufacturer's page
Post by: edina on April 18, 2016, 14:19:32 PM
Hi!

I've read and tried all the other posts and solutions, but nothing worked. I would like to remove category list before a manufacturer's products list.

Joomla 3.5.1
Virtuemart 3.0.16
PHP 5.4.45

Thanks

Title: Re: Remove category list from manufacturer's page
Post by: jenkinhill on April 18, 2016, 15:44:41 PM
This override works OK for me to hide categories with VM3.0.16   http://forum.virtuemart.net/index.php?topic=129223.msg444797#msg444797

If you are alreay using an override category default.php then it is that file you will need to edit.
Title: Re: Remove category list from manufacturer's page
Post by: edina on April 19, 2016, 11:36:36 AM
I tried again, but nothing happened.
My file looks like this before modification:

defined ('_JEXEC') or die('Restricted access');

?> <div class="category-view"> <?php
$js = "
jQuery(document).ready(function () {
   jQuery('.orderlistcontainer').hover(
      function() { jQuery(this).find('.orderlist').stop().show()},
      function() { jQuery(this).find('.orderlist').stop().hide()}
   )
});
";
vmJsApi::addJScript('vm.hover',$js);

if (empty($this->keyword) and !empty($this->category)) {
   ?>
<div class="category_description">
   <?php echo $this->category->category_description; ?>
</div>
<?php
}

// Show child categories
if (VmConfig::get ('showCategory', 1) and empty($this->keyword)) {
   if (!empty($this->category->haschildren)) {

      echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children));

   }
}

if($this->showproducts){
?>
<div class="browse-view">
<?php

if (!empty($this->keyword)) {
   //id taken in the view.html.php could be modified
   $category_id  = vRequest::getInt ('virtuemart_category_id', 0); ?>
   <h3><?php echo $this->keyword; ?></h3>

   <form action="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=category&limitstart=0', FALSE); ?>" method="get">

      <!--BEGIN Search Box -->
      <div class="virtuemart_search">
         <?php echo $this->searchcustom ?>
         <br/>
         <?php echo $this->searchCustomValues ?>
         <input name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>"/>
         <input type="submit" value="<?php echo vmText::_ ('COM_VIRTUEMART_SEARCH') ?>" class="button" onclick="this.form.keyword.focus();"/>
      </div>
      <input type="hidden" name="search" value="true"/>
      <input type="hidden" name="view" value="category"/>
      <input type="hidden" name="option" value="com_virtuemart"/>
      <input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id; ?>"/>

   </form>
   <!-- End Search Box -->
<?php  } ?>

<?php // Show child categories

   ?>
<div class="orderby-displaynumber">
   <div class="floatleft vm-order-list">
      <?php echo $this->orderByList['orderby']; ?>
      <?php echo $this->orderByList['manufacturer']; ?>
   </div>
   <div class="vm-pagination vm-pagination-top">
      <?php echo $this->vmPagination->getPagesLinks (); ?>
      <span class="vm-page-counter"><?php echo $this->vmPagination->getPagesCounter (); ?></span>
   </div>
   <div class="floatright display-number"><?php echo $this->vmPagination->getResultsCounter ();?><br/><?php echo $this->vmPagination->getLimitBox ($this->category->limit_list_step); ?></div>


   <div class="clear"></div>
</div> <!-- end of orderby-displaynumber -->

<h1><?php echo vmText::_($this->category->category_name); ?></h1>

   <?php
   if (!empty($this->products)) {
   $products = array();
   $products[0] = $this->products;
   echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

   ?>

<div class="vm-pagination vm-pagination-bottom"><?php echo $this->vmPagination->getPagesLinks (); ?><span class="vm-page-counter"><?php echo $this->vmPagination->getPagesCounter (); ?></span></div>

   <?php
} elseif (!empty($this->keyword)) {
   echo vmText::_ ('COM_VIRTUEMART_NO_RESULT') . ($this->keyword ? ' : (' . $this->keyword . ')' : '');
}
?>
</div>

<?php } ?>
</div>

<?php
$j = "Virtuemart.container = jQuery('.category-view');
Virtuemart.containerSelector = '.category-view';";

vmJsApi::addJScript('ajaxContent',$j);
?>
<!-- end browse-view -->

Thanks
Title: Re: Remove category list from manufacturer's page
Post by: GJC Web Design on April 19, 2016, 11:53:21 AM
//echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children));

??
Title: Re: Remove category list from manufacturer's page
Post by: edina on April 19, 2016, 12:52:22 PM
I don't know what is it. This is the original file.
Title: Re: Remove category list from manufacturer's page
Post by: Jörgen on April 19, 2016, 13:05:57 PM
Hello Edina

GJC gave You the solution. If You can not see that, then maybe You should consider hiring someone to do it for You.

regards

Jörgen @ Kreativ Fotografi

Title: Re: Remove category list from manufacturer's page
Post by: jenkinhill on April 19, 2016, 13:12:26 PM
What original file? From components/com_virtuemart/views/category/tmpl  or from template overrides, as that is not the default file from VM3.0.16.

The GJC suggested easy edit would remove category display from the category pages as well as from manufacturer.