View Single Post
  #8  
Old 12-17-2014, 08:55 PM
 
juancho juancho is offline
 

Advanced Member
  
Join Date: Mar 2014
Posts: 47
 

Default Re: How eliminate the display options and sorting tabs in product pages

An addition to my previous email:

when I run just this code:

PHP Code:
<?php 

namespace  XLite\Module\Astur\SirtoliSkin\View\Custom

/** 
 * 
 * @ListChild (list="center.bottom", zone="customer", weight="300") 
 */ 

class ProductsOnHomePage extends \XLite\View\ItemsList\Product\Customer\Category\ACategory 

    protected 
$allProducts null

    protected function 
getHead() 
    { 
        
'My products'
    } 

// this method defines that products will be displayed only in the main page 
    
public static function getAllowedTargets()  
    {  
        
$return = array('main'); 

        return 
$return;  
    }  

// this method defines that you do not need pagination 
    
protected function getPagerClass() 
    { 
        return 
'\XLite\View\Pager\Infinity'
    } 

// this method defines that all products must be displayed in this section 
    
protected function getData(\XLite\Core\CommonCell $cnd$countOnly false
    { 
        if (!isset(
$this->allProducts)) { 
            
$this->allProducts = \XLite\Core\Database::getRepo('XLite\Model\Product')->findAll(); 
          } 

        return 
true == $countOnly 
            
count($this->allProducts
            : 
$this->allProducts
    } 

}

both, the display and sort menu are visible but when you try to use them by changing to a different option then no product at all is displayed.
__________________
X-Cart Business 5.0.12
Reply With Quote