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

Hide Category from sidebar

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-08-2015, 10:02 AM
 
Hanypa Hanypa is offline
 

Member
  
Join Date: Feb 2015
Location: West Allis, WI
Posts: 25
 

Default Hide Category from sidebar

Hello again,

I would like to know how to hide an active category item from the sidebar without disabling it.


P.S.
Not sure if I'm supposed to create a new thread for each new question or add on to my existing thread. If I'm in violation of any rules please let me know and I will adjust my post.

P.S.S.
Is there a way to bulk add existing products to a category? like the way you can add existing items to the Featured Products.
__________________
X-Cart 4.6.4 Gold Plus
X-Cart 5.2.4 Free
Reply With Quote
  #2  
Old 02-08-2015, 06:06 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Hide Category from sidebar

New questions, belong in new threads. Unless it is just an extension of the original question.

In answer to your PSS: You can modify multiple products at once, try doing this and adding them to category.

I don't believe that hiding an active category is possible without modification of smarty or PHP code. I would start by adding the option to the category page in admin, a simple checkbox for "hide". Then you can work on the front side, taking action based on that checkbox.

Adding a custom variable to a category is relatively simple to do. I have a tutorial that shows how to do it for a product: https://www.youtube.com/watch?v=-7ESOW0pKU4

Adapting what you learn there, the same technique can easily be applied to a category.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 02-08-2015, 09:45 PM
 
Hanypa Hanypa is offline
 

Member
  
Join Date: Feb 2015
Location: West Allis, WI
Posts: 25
 

Default Re: Hide Category from sidebar

Quote:
Originally Posted by totaltec
New questions, belong in new threads. Unless it is just an extension of the original question.

In answer to your PSS: You can modify multiple products at once, try doing this and adding them to category.

I don't believe that hiding an active category is possible without modification of smarty or PHP code. I would start by adding the option to the category page in admin, a simple checkbox for "hide". Then you can work on the front side, taking action based on that checkbox.

Adding a custom variable to a category is relatively simple to do. I have a tutorial that shows how to do it for a product: https://www.youtube.com/watch?v=-7ESOW0pKU4

Adapting what you learn there, the same technique can easily be applied to a category.

Thanks for the reply! I was hoping to be able to do it with custom CSS with an nth-child, something to the effect of

li.whateverclassname:nth-child(2){
display:none;
}

Since I've never even seen CSS before this past friday it's hard for me to figure out the class hierarchy when using inspect element in chrome. Also the seeming random use of line item class by xcart when generating the sidebar is confusing.

As for editing multiple products categories I don't seem to be able to do that. I can only delete, clone, enable, or disable multiple products at once.
__________________
X-Cart 4.6.4 Gold Plus
X-Cart 5.2.4 Free
Reply With Quote

The following user thanks Hanypa for this useful post:
totaltec (02-09-2015)
  #4  
Old 02-09-2015, 04:49 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Hide Category from sidebar

Ahh, we are talking about XC5. I was confused, thinking you meant XC4. You are right, there is no way to do this at the moment, besides perhaps an export/import involving modifying the spreadsheet.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #5  
Old 02-18-2015, 05:00 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Hide Category from sidebar

Do you mean that if you are in iGoods category, then this category should not be clickable as shown on my snapshot?

If so, then this can be achieved relatively easily via mod:
http://awesomescreenshot.com/0494fp3183
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #6  
Old 02-22-2015, 06:45 AM
 
Hanypa Hanypa is offline
 

Member
  
Join Date: Feb 2015
Location: West Allis, WI
Posts: 25
 

Default Re: Hide Category from sidebar

Quote:
Originally Posted by tony_sologubov
Do you mean that if you are in iGoods category, then this category should not be clickable as shown on my snapshot?

If so, then this can be achieved relatively easily via mod:
http://awesomescreenshot.com/0494fp3183

No, I would like to have igoods active but not show up in the category sidebar at all.
__________________
X-Cart 4.6.4 Gold Plus
X-Cart 5.2.4 Free
Reply With Quote
  #7  
Old 03-06-2015, 04:52 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Hide Category from sidebar

Quote:
Originally Posted by Hanypa
No, I would like to have igoods active but not show up in the category sidebar at all.

OK, got it.

In this case you need to create a module and decorate the getCategories() method of the \XLite\View\TopCategories class. There you should walk through each category object and put it into return array unless the category is not the same one you are in.

Please, let me know if it makes sense to you.

Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



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 04:14 PM.

   

 
X-Cart forums © 2001-2020