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
  #1  
Old 03-07-2006, 05:47 AM
 
hansmoen hansmoen is offline
 

Member
  
Join Date: Dec 2005
Posts: 12
 

Default Hidden Categories

Just to tidy up John's beautiful mod

http://forum.x-cart.com/viewtopic.php?t=11326

I have successfully applied it to X-Cart 4.0.17 with X-Fancy-Category
All that needed to be done is:

/skin1/admin/category_modify.tpl

Find:
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> </SELECT>

Replace with:
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> <OPTION value='H' {if ($current_category.avail eq 'H')} selected {/if}>Hidden</OPTION> </SELECT>

and
/include/categories.php

Find:
Code:
if ($current_area == "C" || $current_area == "B") $search_condition = "AND avail='Y' AND (membership='".addslashes($user_account["membership"])."' OR membership='')";

Replace with:
Code:
if ($current_area == "C" || $current_area == "B") $search_condition = "AND (avail='Y' OR avail = 'H') AND (membership='".addslashes($user_account["membership"])."' OR membership='')";


Hope you find this helpful.

HK
__________________
Hasse
Reply With Quote
  #2  
Old 03-16-2006, 01:55 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default

Unless I'm missing something, the products added to the hidden category would not appear while trying to view the hidden category. fablot had the right idea in the other thread about adding to the search_condition in include/search.php. Now the products appear for me. This is with 4.0.18. Can anyone verify this is the correct adjustment to not adversely affect other product searches?
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #3  
Old 03-18-2006, 10:44 PM
  thundernugs's Avatar 
thundernugs thundernugs is offline
 

Senior Member
  
Join Date: May 2003
Location: Bend, OR
Posts: 117
 

Default

HK - hansmoen,
nice work, i am on a fairly fresh install of 4.0.17 and NOT using fancy cats, but the code posted earlier by tanabemike was not working for me. it seemed to work, but after more testing/browsing, some goofy things started to happen. sorry, not enough time to go into it. i was about to scrap the mod, but your code made it all better.

many thanks!

__________________
X-Cart Gold 4.0.17 & 4.0.18
Linux Server
Hands-On Hosting
http://www.CoreCases.com - Ipod Cases
http://www.InnovativeOutlet.com - Pet Plants and other cool stuff you need
Reply With Quote
  #4  
Old 03-20-2006, 04:31 AM
 
hansmoen hansmoen is offline
 

Member
  
Join Date: Dec 2005
Posts: 12
 

Default

Quote:
Originally Posted by cherie
Unless I'm missing something, the products added to the hidden category would not appear while trying to view the hidden category. fablot had the right idea in the other thread about adding to the search_condition in include/search.php. Now the products appear for me. This is with 4.0.18. Can anyone verify this is the correct adjustment to not adversely affect other product searches?

It works no problem on 4.0.17. Don't know about previous or later versions, but you can see it working on http://testsrv.pchealth.ie

Take a look in "End of life" items under "Specials".
You will also see this item if you do a search for "wow".


And Thanks Thundernugs! Glad you found it useful!

HK
Reply With Quote
  #5  
Old 03-25-2006, 09:16 AM
  Hyperdelicious's Avatar 
Hyperdelicious Hyperdelicious is offline
 

Senior Member
  
Join Date: Sep 2002
Location: In the Middle of Nowhere
Posts: 138
 

Default

Great mod.... Would love to add this to my x-cart I'm currently updating but it doesn't seem to work with the newest X-cart 4.1.0 (RC3) version any ideas?
Reply With Quote
  #6  
Old 04-11-2006, 02:20 AM
 
stevebag stevebag is offline
 

Member
  
Join Date: Jul 2003
Posts: 23
 

Default

(v4.0.17) --- Plus you will need to add

<OPTION value="H"{if $subcategories[cat_num].avail eq "H"} selected{/if}>Hidden</OPTION>

below

<OPTION value="Y"{if $subcategories[cat_num].avail eq "Y"} selected{/if}>{$lng.lbl_yes}</OPTION>
<OPTION value="N"{if $subcategories[cat_num].avail eq "N"} selected{/if}>{$lng.lbl_no}</OPTION>

in skin1/admin/main/categories.tpl
__________________
Version 4.0.18
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 10:17 AM.

   

 
X-Cart forums © 2001-2020