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

Hidden Categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #61  
Old 02-09-2008, 03:45 AM
  LoveHurts's Avatar 
LoveHurts LoveHurts is offline
 

Advanced Member
  
Join Date: Mar 2007
Posts: 39
 

Default Re: Hidden Categories

nobody code for this? 4.1.6.

just want to hide one category. thanks yves
__________________
Core version: 5.3.4.4
PHP: 5.6
Web server: Apache
---stll running a---
x-cart PRO 4.1.6 [unix] updated to 4.1.9
Belgium
Reply With Quote
  #62  
Old 07-14-2009, 03:57 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: Hidden Categories

Anyone for 4.1.9 & 4.1.11?
__________________
4.6.1 Platinum


Reply With Quote
  #63  
Old 07-23-2009, 02:36 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: Hidden Categories for 4.0.17

Quote:
Originally Posted by More-Japan
Here is the code that I have been able to successfully use on my fresh install of 4.0.17. Some of the code and file locations are different on 4.0.17, but it seems to be stable-- search is functioning properly, as well as HTML catalog, etc.

I'm not a programmer, but understand the logic.. so if there is anything left out, best left to the pros.

This is a great mod that should have been integrated into the cart from the beginning.


Change include/categories.php
There are two instances of code that need to be changed:
This makes the newly added 'Hidden' option get translated as an 'Available' item


Instance 1:

Change:
Code:
$search_condition[] = "$sql_tbl[categories].avail='Y'";
To:
Code:
$search_condition[] = "$sql_tbl[categories].avail='Y' OR $sql_tbl[categories].avail='H'";

Instance 2:

Change:
Code:
$search_condition = "AND avail='Y' AND (membership='".addslashes($user_account["membership"])."' OR membership='')";

To:
Code:
$search_condition = "AND avail='Y' OR $sql_tbl[categories].avail='H' AND (membership='".addslashes($user_account["membership"])."' OR membership='')";



Change skin1/admin/main/category_modify.tpl
This adds the option to the backend admin


Find this code:
Code:
<SELECT name="avail"> <OPTION value='Y' {if ($current_category.avail eq 'Y')} selected {/if}>{$lng.lbl_enabled}</OPTION> <OPTION value='N' {if ($current_category.avail eq 'N')} selected {/if}>{$lng.lbl_disabled}</OPTION>

And add this to the bottom:
Code:
<OPTION value='H' {if ($current_category.avail eq 'H')} selected {/if}>{$lng.lbl_hidden}</OPTION>



Change /skin1/customer/categories.tpl
This tells the cart to hide the 'Hidden' categories from the lefthand category nav.


Change:
Code:
<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>

To:
Code:
{if $categories[cat_num].avail ne "H"}<FONT class="CategoriesList">{$categories[cat_num].category}</FONT> {/if}


There is a second instance of this code 2 lines down that looks similar, but not sure if it is necessary, since it is for the subcategories.

Will it work on 4.1.9 and 4.1.11?
__________________
4.6.1 Platinum


Reply With Quote
  #64  
Old 07-30-2009, 06:52 AM
  alec.thomas's Avatar 
alec.thomas alec.thomas is offline
 

Advanced Member
  
Join Date: Mar 2009
Location: Minnesota, USA
Posts: 78
 

Default Re: Hidden Categories

This is a nice mod, has anyone successfully done this for 4.2? This seems like the harder way to do things...
__________________
X-Cart Gold v4.2.0 [Linux]
Add-On: X-Magnifier
Altered Cart Add-On: One Page Checkout
Reply With Quote
  #65  
Old 08-07-2009, 02:08 AM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Hidden Categories

Is everyone just wanting to disable a cat but still wanting to access products in it?

I use X-Configurator to build jewellery items from components that I do not sell on their own so they are all in hidden cats.

I have this working for 4.1.8

Here is my search.php
Attached Files
File Type: php search.php (40.1 KB, 45 views)
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
  #66  
Old 08-07-2009, 04:59 AM
  alec.thomas's Avatar 
alec.thomas alec.thomas is offline
 

Advanced Member
  
Join Date: Mar 2009
Location: Minnesota, USA
Posts: 78
 

Default Re: Hidden Categories

no, not necessarily, what i'm trying to do is to add a category that does not show up in the category list, but is still accessible through URL ( http://www.mystore.com/hiddencategory/
__________________
X-Cart Gold v4.2.0 [Linux]
Add-On: X-Magnifier
Altered Cart Add-On: One Page Checkout
Reply With Quote
  #67  
Old 08-12-2009, 11:47 AM
 
Plucky Pear Plucky Pear is offline
 

Member
  
Join Date: Aug 2009
Posts: 15
 

Default Re: Hidden Categories

Is there a good code for this on 4.2 ?
__________________
Version 4.2.2

Mods
Special Offers
Download Expander
What's New

Plucky Pear Designs
Reply With Quote
  #68  
Old 08-13-2009, 10:16 PM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: Hidden Categories

Anyone for 4.1.9 and 4.1.11?
__________________
4.6.1 Platinum


Reply With Quote
  #69  
Old 09-10-2009, 04:28 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: Hidden Categories

In this codes the products added to the hidden category would not appear while trying to view the hidden category.I want to see the products when I click in the hidden category on URL ( but the category will remain invisible in the store front).
Also I need proper code for 4.1.9 and 4.1.11?Actually I want Hidden but available for sale option.

Can anyone help me?
__________________
4.6.1 Platinum


Reply With Quote
  #70  
Old 09-10-2009, 06:20 AM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Hidden Categories

Take out some points with Qualiteam - they will fix it for you
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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:54 AM.

   

 
X-Cart forums © 2001-2020