Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

How to stop Product Filter module hiding Category menu

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 10-04-2014, 03:24 AM
 
JannieB JannieB is offline
 

Senior Member
  
Join Date: Sep 2004
Posts: 117
 

Default How to stop Product Filter module hiding Category menu

The default behaviour of the product Filter module is to hide the category menu when a filter is being applied. I need to undo this functionality as I am using the topCategories module for subnavigation options in a horizontal menu, so no-one can navigate anywhere if these are hidden.

I tried setting the isVisible element to always be true, but then the filters wouldn't work properly.

I started this in another thread http://forum.x-cart.com/showthread.php?p=378089, but now it is a specific question ... maybe someone from x-cart can help???

(see previous thread for background ..)
__________________
Jan Beesley
(Currently Xcart 5
Previously XCart Gold from 3.5....)
Reply With Quote
  #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

The following 2 users thank qualiteam for this useful post:
JannieB (10-10-2014), tony_sologubov (10-14-2014)
  #3  
Old 10-10-2014, 07:21 AM
 
JannieB JannieB is offline
 

Senior Member
  
Join Date: Sep 2004
Posts: 117
 

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

You're a star ...! This worked....

I didn't know you could specify dependencies ... this might help me with some other issues too.

Thanks for your help.

Jan
__________________
Jan Beesley
(Currently Xcart 5
Previously XCart Gold from 3.5....)
Reply With Quote

The following user thanks JannieB for this useful post:
qualiteam (10-14-2014)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:48 PM.

   

 
X-Cart forums © 2001-2020