is there a way to not show a certain category on the categories sidebox ?
is there a way to not show a certain category on the categories sidebox ?
In /includes/templates/your_template/sideboxes/tpl_categories.php, find this line near the top of the file:and addPHP Code:if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3)
} else {
($box_categories_array[$i]['path'] == 'cPath=23') or
to the beginning to getReplace the 23 with the correct cPath for your category so it reads (say) 'cPath=4_37'.PHP Code:if (($box_categories_array[$i]['path'] == 'cPath=23') or zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3), or category 23
} else {
THANKS !!!
Worked great
Hi
I am trying to get a link to category to disappear of a product page if you are in that category.
the code works but if I am on a different category and I want the same to happen but this is a subcategory then code does not seem to work. I am a novice at php and so have pinched code from else where to get it to work for the first bit.
elseif ($_GET['cPath'] != 11_233 )
does not seem to like the underscore in the cPath reference. Could some one help with the syntax
Thanks MG
You might try using quotes around the value, as it is a string and not a numeric value:
elseif ($_GET['cPath'] != '11_233' )
gjh42
I did try this but then this caused a complete error on the page and did not load at all.
MG
It's impossible to troubleshoot a partial line of code without context. What is the complete statement you are trying to use? (And the ones before and after might be relevant too.)
gjh42
this is in the tpl_product-info-diplay.php file:
current code is:
<div id="giftwrap"><?php if ($_GET['cPath'] != 194 )
echo '<a href ="http://www.funkymoose.co.uk/index.php?main_page=index&cPath=194" ><img src="/includes/templates/template_default/images/icons/giftwrap.gif"> Gift wrapping available </a>';
else
echo "";
This hides the gift wrap link if I am in the gift wrap catagory. I would like to also hide the link if I am on the greeting card category ( As I feel it is unlikely that some one wants to gift wrap a greeting card and it looks a bit odd having the link there. Of course if the worst comes to the worst it is not the end of the world but I am certainly curious about getting the code to work as I am sure it would hep with similar options.
I tried:
<div id="giftwrap"><?php if ($_GET['cPath'] != 11_223)
echo '<a href ="http://www.funkymoose.co.uk/index.php?main_page=index&cPath=194" ><img src="/includes/templates/template_default/images/icons/giftwrap.gif"> Gift wrapping available </a>';
else
echo "";
but I get the following error:
Parse error: syntax error, unexpected T_STRING in \includes\templates\mytemplate\templates\tpl_product_info_display.php on line 122
11_223 is the subcategory.
Ideally I thought I should be able to run it as an if, elseif, else so both the initial category and subcategory can work.
it might be that using if / case would be a better way to go???
Hope this is enough code to help
Sorry if this is a basic php question I am certainly a complete beginner.
thanks
MG
I don't know enough advanced PHP to know why the $_GET[] is better or necessary in certain circumstances, but the value of $cPath should be available in tpl_product_info_display.php. Instead of
if ($_GET['cPath'] != 11_223)
try
if ($cPath != '11_223')
and see if that works.
Just some feed back
if ($cPath != '11_223') - does not work.
However I have just re-written this using switch / case statement and it worked first time
Thanks
MG