| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Hidden Categories | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Hidden Categories
3.5.8-3.5.9 but may work on others
In the older version of x-cart, disabled categories were still viewable so you could have hidden categories. This was good for hidden categories, not so good if you actually wanted to disable the category. In the newer x-carts I've noticed they actually disable the category, but you can't have hidden categories. This mod just allows you to create a hidden category using the admin section. The category won't show up in the navigation, and will still accessible by direct link. Mod is pretty basic, was just difficult finding where the exclusion took place ----- First lets get it to allow the hidden categories. Open up /include/categories.php FIND: $categories_data = func_query("select $sql_tbl[categories].*, SUBSTRING_INDEX($sql_tbl[categories].category, '\/', -1) as category_name, SUBSTRING_INDEX($sql_tbl[categories].category, '\/', 1) as root_category_name from $sql_tbl[categories] ".($current_area=="C"?"where $sql_tbl[categories].avail='Y' $membership_condition ":"")." group by $sql_tbl[categories].categoryid order by ".($current_area=="C" ? "order_by" : "category")); REPLACE WITH: $categories_data = func_query("select $sql_tbl[categories].*, SUBSTRING_INDEX($sql_tbl[categories].category, '\/', -1) as category_name, SUBSTRING_INDEX($sql_tbl[categories].category, '\/', 1) as root_category_name from $sql_tbl[categories] ".($current_area=="C"?"where $sql_tbl[categories].avail='Y' OR $sql_tbl[categories].avail='H' $membership_condition ":"")." group by $sql_tbl[categories].categoryid order by ".($current_area=="C" ? "order_by" : "category")); The key here is just adding the: OR $sql_tbl[categories].avail='H' ----- Lets make hidden categories creatable from the admin Open /skin1/admin/category_modify.tpl FIND: <select name=avail> <option value='Y' {if ($current_category.avail eq 'Y')} selected {/if}>Enabled</option> <option value='N' {if ($current_category.avail eq 'N')} selected {/if}>Disabled</option> </select> REPLACE WITH: <select name=avail> <option value='Y' {if ($current_category.avail eq 'Y')} selected {/if}>Enabled</option> <option value='N' {if ($current_category.avail eq 'N')} selected {/if}>Disabled</option> <option value='H' {if ($current_category.avail eq 'H')} selected {/if}>Hidden</option> </select> ------------------------- Everything is working now, except they are still on the side navigation, so lets remove them. Open /skin1/customer/categories.tpl FIND BOTH INSTANCES OF: <font class=CategoriesList>{$categories[cat_num].category_name}</font> CHANGE TO: {if $categories[cat_num].avail ne "H"}<font class=CategoriesList>{$categories[cat_num].category_name}</font> {/if} NOTE: There are two links in this file, the categories and the subcategories. The modification needs to be made to both. ------------------------- That should do it. Feel free to paypal a donation to jon@hitemup.com if you feel this mod has saved you cost of some development time |
|||||||||
#2
|
|||||||||
|
|||||||||
NOTE: A small edit has been made to the categories.tpl modification. It needs to be implemented twice, once for the categories and once for the subcategories.
If your using this, please let me know so I know posting these mods isn't a waste of my time. Thanks |
|||||||||
#3
|
|||||||||
|
|||||||||
is there any way this can work in conjunction with fancy categories?
__________________
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 |
|||||||||
#4
|
|||||||||
|
|||||||||
I don't have the fancy categories module. I imagine it's just a matter of putting in the if statement. If you send me the module files I will have a look and see if I can implement for you.
Can I see what the fancy categories look like on your site? I'm not even really sure what they are. |
|||||||||
#5
|
|||||||||
|
|||||||||
jon, any luck on making this work with fancy cats?
thx
__________________
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 |
|||||||||
#6
|
|||||||||
|
|||||||||
None yet. Haven't had the chance to really get into it though, I should have a chance before the weekend.
|
|||||||||
#7
|
|||||||||
|
|||||||||
nice!
no rush of course. i think there are a lot of folks who could use this mod. mike
__________________
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 |
|||||||||
#8
|
|||||||||
|
|||||||||
jon,
any progress?
__________________
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 |
|||||||||
#9
|
|||||||||
|
|||||||||
Sorry I haven't had any time to address this.
I opened up the fancy categories code and it looks complex. Haven't had any time to go any further than that. Don't know if I will. |
|||||||||
#10
|
|||||||
|
|||||||
Thanks Jon! I was just about to write this but luckily found your post.
|
|||||||
|
|||
X-Cart forums © 2001-2020
|