Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Less is More


Guest

Recommended Posts

I would like to reduce the cluttered look of osCommerce by having the left and right columns only show when the user is at the top level of the catalog.

 

I know this will mess with some things like the Manufacturers and Reviews boxes, and will think of finding a solution to that at a later point - perhaps making them appear at the bottom of the page or on the individual product page.

 

any help would be greatly appreciated

Link to comment
Share on other sites

if (strstr($REQUEST_URI, "default.php")) {

  column

}

 

Untested. You will need to amend each column in each of the pages like this:

 

<?php

if (strstr($REQUEST_URI, "default.php")) {

<td class="sidebar" width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

   </table></td>

<?php

}

?>

 

That might work, or something like it. Go and read www.php.net as you need to learn PHP to do stuff like this.

Link to comment
Share on other sites

Of course an alternative approach would be to use the column controller contribution. Then you need only have one column and you can easily change what shows up there. A thoroughly recommended and simple solution to the default cluttered appearance.

Link to comment
Share on other sites

Yeah, thanks David.... I've had a look at that and *may* make some use of it..... I have already removed references to the columns in other pages such as contact.php, create_account.php etc..... that was easy and those pages are now clean looking as I want.

 

I had a quick look at Burt's option... not really what I am after as iI have already done the above to clean up other pages....

 

What I need help with or learn to do is to have perhaps an "if" statement in default.php so that if the user is at the top level of the catalog the columns will show, but if they are deeper into the catalog, or product listing, they will not..... something like:

 

 

if ($category_depth == 'top' ) {

include (DIR_WS_INCLUDES . 'page_left.php');

{

 

 

would this work?

Link to comment
Share on other sites

Well... it works! Here's the code:

 

<!-- left_navigation //-->

<?php

if ($category_depth == 'top') {

include(DIR_WS_INCLUDES . 'page_left.php');

}

?>

<!-- left_navigation_eof //-->

 

If you use 'nested' rather than 'top' the column disappears once you get into a category listing...... just what I was after.... aren't you guys proud of my self help???

Link to comment
Share on other sites

Oooooppppsssss.... please take note that I have renamed column_left.php to page_left.php..... I do this to make things harder for those who wanna mess with things....

Link to comment
Share on other sites

This code mod is REALLY helpful! Thanks Johnson!

 

One thing I noticed about this code mod, though... it keeps the space where the left or right column would normally be. It looks like the table is still there, but the Column is not beinig displayed. Basically, you end up with a big blank spot where the column would normally be.

 

I expanded the above "if statement" to also include the table that is created for use by the column. This way, the center section will expand to utilize the now empty space created by the removal of the left or right column. It's the same code, just placed a bit differently.

 

In default.php (and in any other page you want the columns removed from), locate the following code...

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

 <tr>

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

   </table></td>

<!-- body_text //-->

and change it to this...

<!-- body_text_eof //-->

<?php 

if ($category_depth == 'top') { 

?>

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

   </table></td>

<?php 

} 

?> 

 </tr>

</table>

<!-- body_eof //-->

I'm using it to remove my "column_right". To remove "column_left", you would use the same code around the "column_left" statement.

 

Here are the benifits...

 

1. The columns will still appear on your main page, but will be removed when you go into category, sub-category and product listing pages

 

1. You gain valuable space to optimally display products or categories, which previously may have been getting lost in the clutter!

 

2. If your thumbnail images are larger than the preset itsy-bitsy little images that you can barely see (My thumbnail images are 175x126)... than this code mod is PERFECT for you. I can now adequately display 3 products across and not have the items looking "scrunched" together.

 

Hey Linda... Is there any way to incorporate this column functionality into the Column Controller contribution? Right now, the contribution allows you to either show the column, or not, but its effects are site-wide. With this additional functionality, you would also be able to control which pages the columns will show up.

 

Hope this helps you as much as its helped me!

 

Good Luck!

 

-R

Link to comment
Share on other sites

Hey Randy,

 

Glad you found it as helpful as i did.... regarding the space... yeah, I pointed it out in my post in "tips and tricks", ..... on some other pages where i remove the columns altogether, like create_account.php I leave the space as I think the form looks better.

 

I think the code could be easily expanded so that particular boxes appear on whichever pages you desire..... for me, reducing the cluttered look when customers are viewing the catalog was the big issue.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...