Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hiding the 'column_left' box


Guest

Recommended Posts

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

Link to comment
Share on other sites

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'); ?>*/

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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');

)

?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

<!-- 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...

Link to comment
Share on other sites

<!-- 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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...