View Single Post
  #2  
Old 10-10-2014, 04:51 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: How to stop Product Filter module hiding Category menu

Hello Jan,

It looks like doing this right now is not as simple as it could be.

I've reported this to the XC5 team: https://bt.x-cart.com/view.php?id=43921
Perhaps, they could improve this in the next XC5 version.

The problem is that ProductVariants override the isVisible() method for TopCategories as follows:
Code:
protected function isVisible() { return parent::isVisible() && 'category_filter' != $this->getTarget(); }


So, you can't hack on top and get rid of this check from your module. And you can't just return "true", as this will make the menu visible on every website page (that may be a problem).

Try the following: override the method and copy&paste the code from the original TopCategories class. Add ProductFilter to the @LC_Dependencies tag so that your method will stack on top of the ProductFilter's one:

Code:
namespace XLite\Module\CustomSkin\View; /** * @inherit * * @LC_Dependencies ("XC\ProductFilter") */ class TopCategories extends \XLite\View\TopCategories implements \XLite\Base\IDecorator { /** * @inherit */ protected function isVisible() { return $this->checkTarget() && $this->checkMode() && $this->checkACL(); } }

This may work for you.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote