X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Hidden Categories (https://forum.x-cart.com/showthread.php?t=20360)

hansmoen 03-07-2006 05:47 AM

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

cherie 03-16-2006 01:55 AM

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?

thundernugs 03-18-2006 10:44 PM

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!

=D>

hansmoen 03-20-2006 04:31 AM

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

Hyperdelicious 03-25-2006 09:16 AM

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?

stevebag 04-11-2006 02:20 AM

(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


All times are GMT -8. The time now is 11:59 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.