![]() |
I don't know if this will help anyone, but in version 4.014 I wanted to be able to access a category via a link, but not have it visible in the Categories list.
So I worked in some code from one of Carrie's posts. In skin1/categories.tpl After: {section name=cat_num loop=$categories} add: {if $categories[cat_num].order_by < 500} Then close the {/if} right before you close that {/section} And of course in admin, make any categories you want hidden have an order number above 500. |
Thanks pauldodman,
That works perfectly for what we want to do in version 4.0.13 |
Any ideas if this will be in Xcart 4.1? I am rather hesitant to modify my code since it seems to be a hit an miss.
Would it be worth spending money on to get the Xcart dev's do custom coding ?? |
is the include/search.php code for version 4.0.16
Change: Code:
$search_condition .= " AND $sql_tbl[categories].membership IN ('','".addslashes(@$user_account['membership'])."') AND $sql_tbl[categories].avail = 'Y'"; to: Code:
$search_condition .= " AND $sql_tbl[categories].membership IN ('','".addslashes(@$user_account['membership'])."') AND ($sql_tbl[categories].avail = 'Y' OR $sql_tbl[categories].avail='H')"; to see the products it is corrected? |
Hidden Categories for 4.0.17
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'"; 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"> 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: To: Code:
{if $categories[cat_num].avail ne "H"}<FONT class="CategoriesList">{$categories[cat_num].category}</FONT> 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. |
The very above mod is still not quite right, if you type in a URL with a non-exist cat number, the hidden cat always shown up, if you have 2 hidden cat configured, all 2 hidden cat links all point to the first hidden cat, the 501 position approach works, but with less flexibilty
|
Hi Guys not sure if theres a fix for this but ....
I have installed the Hidden Categories and all works a treat Until ... If i add another Hidden cat with a different name it only goes to the 1st Hidden Cat and wont find the new one, any suggestions anyone ?? Many thanx |
I have the problem that some of my categories' title are the same as the hidden categorie??
anyone who has a solution for this? thnx |
nobody?
|
Commercial Hidden Categories Mod
We have created a commercial mod for this which will be fully supported:
http://www.websitecm.com/customer/product.php?productid=136 |
Quote:
http://forum.x-cart.com/viewtopic.php?p=128691 If you did the modification in categories.php you are probably only missing a '(' and a ')' Where it used to say Quote:
it should now say Quote:
If not the SQL query will always return more than 1 row, including the hidden category, and if the hidden category was created before the category you're viewing, the title will reflect the hidden category. HK |
Quote:
I found I had to add an 'if' too. Without it if you mark a category as hidden, then products in this category can be searched for. Try changing FROM: if($current_area == 'C') { $search_condition .= " AND $sql_tbl[categories].membership IN ('','".addslashes(@$user_account['membership'])."') AND $sql_tbl[categories].avail = 'Y'"; } TO: if($current_area == 'C' and !empty($condition)) { $search_condition .= " AND $sql_tbl[categories].membership IN ('','".addslashes(@$user_account['membership'])."') AND ($sql_tbl[categories].avail = 'Y' )"; } else { $search_condition .= " AND $sql_tbl[categories].membership IN ('','".addslashes(@$user_account['membership'])."') AND ($sql_tbl[categories].avail = 'Y' OR $sql_tbl[categories].avail='H')"; } -- Basically, only show 'H'idden category products if the search string is empty... ie; not searched for. |
Hi,
i installed this mod for version 3.5.14 How can the Hidden categories be excluded out of the Drop down menu (Category) in the advance search? TIA Saskia |
Good questions and questions
Quote:
Hmmm... Thats a good question Saskia. As you see I'm a bit of a newbie, and I was introduced to xcart in version 4.0.17. In this version they do not show up (as you can see on http://www.pchealth.ie ). Hopefully some of the oldboys can help you out. Hasse |
Re: Hidden Categories
can you hide category in v 4.1.6
|
Re: Hidden Categories
Quote:
Anybody ever found a solution for that page title "bug"? I've got everything working with the exception of the category title & page title. All the hidden categories display the category & page title of the first hidden category... 8O Any help would be very welcomed! :D Thanks in advance! UPDATE: I fixed it by changing line 179 from include/categories.php from $search_condition = "AND avail='Y' OR $sql_tbl[categories].avail='H' AND (membership='".addslashes($user_account["membership"])."' OR membership='')"; to $search_condition = "AND (avail='Y' OR avail = 'H') AND (membership='".addslashes($user_account["membership"])."' OR membership='')"; Page and category title of hidden categories are now displaying correctly :D/ |
Re: Hidden Categories
Just piping in to confirm that the "brackets" are the solution to the title issue.
|
Re: Hidden Categories
I want to apply the 501 solution but cant find that code to replace in my categories.tpl (this is in "the customer directory correct?)
here is my code can someone explain what to change Quote:
|
Re: Hidden Categories
This works good. I'm using it for MAP pricing (one distributor complained that the only way to discount is with "entering an email address to see products"). MAP for other products are not displayed until the customer logs in.
So I modified my cart so that the customer can enter their email address, then an automated email is sent with the direct link to the hidden category (with hidden products in it). |
Re: Hidden Categories
Quote:
Has anyone used this for 4.1.17? I tried to follow the codes, but the codes are not there anymore in this latest version |
Re: Hidden Categories
nobody code for this? 4.1.6.
just want to hide one category. thanks yves |
Re: Hidden Categories
Anyone for 4.1.9 & 4.1.11?
|
Re: Hidden Categories for 4.0.17
Quote:
Will it work on 4.1.9 and 4.1.11? |
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...
|
Re: Hidden Categories
1 Attachment(s)
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 |
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/
|
Re: Hidden Categories
Is there a good code for this on 4.2 ?
|
Re: Hidden Categories
Anyone for 4.1.9 and 4.1.11?
|
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? |
Re: Hidden Categories
Take out some points with Qualiteam - they will fix it for you
|
Re: Hidden Categories
Quote:
Why support from Qualiteam?Though it is a complete custom mods, but it is not complete!!! I want support from forum members.There are many X-cart experts for these smart coding. Thanks to all. |
Re: Hidden Categories
Anyone who want this working on 4.2 do the following. The only difference is I made it so you can change the status on the admin categories page without going into each category one at a time and modifying them to be hidden.
Hope this helps someone. ---------------------------------------------------- 1) Open skin1/admin/main/categories.tpl Find: Code:
<option value="N"{if $c.avail eq "N"} selected="selected"{/if}>{$lng.lbl_no}</option> Add Below: Code:
<option value='H'{if $c.avail eq 'H'} selected="selected"{/if}>Hidden</option> 2) Open skin1/admin/main/category_modify.tpl Find: Code:
<option value='Y' {if ($current_category.avail eq 'Y')} selected="selected"{/if}>{$lng.lbl_enabled}</option> Add under: Code:
<option value='H' {if ($current_category.avail eq 'H')} selected="selected"{/if}>Hidden</option> 3) Open include/func/func.category.php NOTE: REPLACE ALL INSTANCES!! Find All: Code:
$sql_tbl[categories].avail = 'Y' Replace With: Code:
($sql_tbl[categories].avail='Y' OR $sql_tbl[categories].avail='H') 4) Open skin1/customer/categories.tpl Find: Code:
<li><a href="home.php?cat={$c.categoryid}" title="{$c.category|escape}">{$c.category}</a></li> Replace With: Code:
{if $c.avail ne "H"} 5) Open admin/process_category.php Find: Code:
"avail" => ($v["avail"] == "Y" ? "Y" : "N") Replace with: Code:
"avail" => $v["avail"] 6) Open include/search.php Find: Code:
$sql_tbl[categories].avail = 'Y' Replace with: Code:
($sql_tbl[categories].avail = 'Y' OR $sql_tbl[categories].avail = 'H') Thats it :) - THANKS FOR THE MOD BTW :) |
Re: Hidden Categories
Quote:
Is it possible for 4.1.9 and 4.1.11? Any help from forum member...??? |
Re: Hidden Categories
Should be possible. Looks for similiar coding in areas all of us have specified. Mine are available for sale even though the category is hidden. I just link to it with an advertisement link. Update 4.1.9 and 4.1.11 accordingly.
|
Re: Hidden Categories
Quote:
No mrerotic these codes are not properly written for 4.1.9 and 4.1.11 !!! I can not find the features hidden but available for sale here. Can you help me ? Thank you. |
Re: Hidden Categories
Sorry I dont have those versions. You simply need to search through your coding and between everyones postings you should be able to find the fields you need to edit. I'm not saying there going to be exact since mine is a different version, but between mine and theirs before posted you should be able to figure it out. Just be patient spend some time and search it out. Sorry, if I had it it I would help you. :(
|
Re: Hidden Categories
I have already posted to forum-
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. But the reply from forum is- Quote:
Quote:
If the codes will not work for all versions then how it is completed mods !!!! Any response !!!! |
Re: Hidden Categories
Quote:
I followed your steps exactly. However, it doesn't seem to be working. When I check a category as "hidden" in admin, it deactivates it instead and returns a 404 error page when I try to visit the category URL. Then if I check "enable" it works fine again. I am using 4.2.2 -- any thoughts on what went wrong? |
Re: Hidden Categories
I was able to install this mod successfully, for the most part, on my version 4.3.2. The only problem I am seeing is all the hidden categories show up on the search result page(s). Do you know how to fix this?
|
Re: Hidden Categories
Quote:
I am using 4.4.3 and was having the same problem but I have found out the error. Look in 'include/func/func.category.php' for : Code:
$search_condition = "AND $sql_tbl[categories].avail='Y' AND ($sql_tbl[category_memberships].membershipid = '".$user_account["membershipid"]."' OR and change to ... Code:
$search_condition = "AND ($sql_tbl[categories].avail='Y' OR $sql_tbl[categories].avail='H') AND ($sql_tbl[category_memberships].membershipid = '".$user_account["membershipid"]."' OR Hopefully its the same coding within v4.2 |
All times are GMT -8. The time now is 01:23 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.