Guest Posted August 27, 2010 Posted August 27, 2010 Hello All, I am relatively new to PHP but osCommerce seems to work fine for the most part for those of us who don't know this programming language. However, I am trying to hide the column_left box only at the index.php page. So, if you go to my site (eg. www.mysite.com/index.php) I would like to hide it, but as soon as you click on a category, it should pop up. Below you will find the code I used (standard oscommerce code): <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <?php I have searched on the forum but I can't find this anywhere:(... Thanks in advance for your replys! Mike
OsWebDesign Posted August 27, 2010 Posted August 27, 2010 Hello All, I am relatively new to PHP but osCommerce seems to work fine for the most part for those of us who don't know this programming language. However, I am trying to hide the column_left box only at the index.php page. So, if you go to my site (eg. www.mysite.com/index.php) I would like to hide it, but as soon as you click on a category, it should pop up. Below you will find the code I used (standard oscommerce code): <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <?php I have searched on the forum but I can't find this anywhere:(... Thanks in advance for your replys! Mike Try adding /* before that code, and */ after it. That will disable it for the time being. See if that works. /*<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>*/
Guest Posted August 27, 2010 Posted August 27, 2010 Try adding /* before that code, and */ after it. That will disable it for the time being. See if that works. /*<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>*/ Thanks for your fast reply! However, the problem is that when I click on a category I would still like to display it. So if you go to: index.php it should be hided, however if you click on a random a category and go to 'index.php?cPath=' it should be visible again. Don't know if this is easy to do? Thanks and regards, Mike
NodsDorf Posted August 27, 2010 Posted August 27, 2010 Thanks for your fast reply! However, the problem is that when I click on a category I would still like to display it. So if you go to: index.php it should be hided, however if you click on a random a category and go to 'index.php?cPath=' it should be visible again. Don't know if this is easy to do? Thanks and regards, Mike Hi Mike, You need some code to test the category depth of the site. I believe this code is somewhere in osc already. I believe it is used to test if it should display the WRITE A REVIEW, or TELL A FRIEND boxes. However I think it would need to be modified a bit to simply test if you are 1 deep into the categories. Hope this helps, Don
Hotclutch Posted August 27, 2010 Posted August 27, 2010 It's not that easy, because index.php generates your categories (and different types at that) as well as your homepage and manufacturers. All from the same page. You can try something like this, but it will exclude your top categories as well. Please backup before trying it. Replace <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> with <?php if (($category_depth != 'top') || ($category_depth = 'nested') || ($category_depth = 'products')) ( require(DIR_WS_INCLUDES . 'column_left.php'); ) ?>
Hotclutch Posted August 27, 2010 Posted August 27, 2010 Or just this <?php if (($category_depth = 'nested') || ($category_depth = 'products')) ( require(DIR_WS_INCLUDES . 'column_left.php'); ) ?> Should hide the column on the homepage and top categories
Guest Posted August 27, 2010 Posted August 27, 2010 Or just this <?php if (($category_depth = 'nested') || ($category_depth = 'products')) ( require(DIR_WS_INCLUDES . 'column_left.php'); ) ?> Should hide the column on the homepage and top categories Hi Hotclutch, I will try in a minute and let you know. Thanks anyway!:) Regards, Mike
Guest Posted August 27, 2010 Posted August 27, 2010 Or just this <?php if (($category_depth = 'nested') || ($category_depth = 'products')) ( require(DIR_WS_INCLUDES . 'column_left.php'); ) ?> Should hide the column on the homepage and top categories Hi Hotclutch, I just tried it and I'm getting a syntax error just before 'require(DIR_WS_INCLUDES'... Do you know what went wrong? I exactly replaced the original code by yours. Regards, Mike
Hotclutch Posted August 27, 2010 Posted August 27, 2010 Replace what I gave with <?php if (($category_depth == 'nested') || ($category_depth == 'products')) require(DIR_WS_INCLUDES . 'column_left.php'); ?>
roya.k Posted August 27, 2010 Posted August 27, 2010 <!-- left_navigation //--> <?php if ( ($category_depth == 'nested') || ($category_depth == 'products') ) require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> Open source n'est pas un échange à sens unique ... La plupart du temps un simple merci ou quelques mots d'encouragement suffisent...
Guest Posted August 27, 2010 Posted August 27, 2010 <!-- left_navigation //--> <?php if ( ($category_depth == 'nested') || ($category_depth == 'products') ) require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> Hi Hotclutch and roya.k, Thanks you both so much! It's working, this is exactly what I need! Perfect. Regards, Mike
Recommended Posts
Archived
This topic is now archived and is closed to further replies.