Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Weird behavior with tableBox class


windf4ll

Recommended Posts

I was re-arraning the infoBoxes between the right and left columns. In doing so, I put the Information infoBox on the right side, bottom of column_right.php like such:

 

  //require(DIR_WS_BOXES . 'reviews.php');
 require(DIR_WS_BOXES . 'information.php');

 if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
//    include(DIR_WS_BOXES . 'languages.php');
//    include(DIR_WS_BOXES . 'currencies.php');
 }

 

On the main index page, everything is fine. But as soon as I click on the Categories link (and go to the Categories display) the page layout breaks (the copyright notice and whatever is supposed to be below that is on the bottom of the right hand column, not at the bottom of the page).

 

I found that the error is happening around line 67 of boxes.php in catalog/includes/classes

 

The index page's HTML looks like:

 

<!-- information //-->

<tr>   

  <td>

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

      <tr>

        <!-- Contents Removed - everything in here was fine -->

      </tr>

    </table>

    <table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">

      <tr>

 

        <td>

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

            <tr>

              <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>

            </tr>

            <tr>

              <!-- Contents Removed - everything in here was fine -->

            </tr>

            <tr>

              <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>

            </tr>

          </table>

        </td>

      </tr>

 

    </<!-- PROBLEM HERE -->

  </td>

</tr>

<!-- information_eof //-->

 

 

But I've found, that if I add the comment to tableBox_string on line 68 of boxes.php:

      $tableBox_string .= '</table>' . "\n";

      $tableBox_string .= '<!--END-->' . "\n";

 

 

I get the following HTML for the index page (and the formatting is correct - ie the copyright notice is on the bottom of the page):

 

<!-- information //-->

<tr>   

  <td>

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

      <tr>

        <!-- Contents Removed - everything in here was fine -->

      </tr>

    </table>

    <table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">

      <tr>

 

        <td>

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

            <tr>

              <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>

            </tr>

            <tr>

              <!-- Contents Removed - everything in here was fine -->

            </tr>

            <tr>

              <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>

            </tr>

          </table>

        </td>

      </tr>

 

    </table>

    <!-- PROBLEM HERE -->

  </td>

</tr>

<!-- information_eof //-->

 

And, just to show where the PROBLEM HERE comment is coming from - I just added the following line to information.php in catalog/includes/boxes

 

  new infoBox($info_box_contents);

?>

<!-- PROBLEM HERE -->

            </td>

          </tr>

<!-- information_eof //-->

 

So it looks like the close table tag is getting cut off somewhere, but I haven't been able to locate how or why. Anyone have any ideas as to what might be going on here? Can anyone even reproduce this problem?

It seems like a minor problem, but it really screws up the page layout in the category view.

Link to comment
Share on other sites

post a url so that we can see what the issue is

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Did you guys resolve this problem? I have a similar one. Please see http://www.oakshop.co.uk/. The copyright appears on the right hand side of the screen, half way up, rather than at the bottom centre. This only seems to happen the first time the page is loaded, refreshing it moves the copyright back to where it belongs. This is a plain vanilla install, no mods yet.

Link to comment
Share on other sites

I don't have a live site up, so I can't send a link, but Charlie's problem is very similiar (at least in the layout issue - not neccessarily the cause).

 

I did find that my error occurs in a special case - here's my example

 

I have the following Category strucure:

 

<dir>Top

 <category>LP's
   <category>Rock
     <product>Skynyrd</product>
   </category>
   <!-- Note: no individual proucts (like Bob Dylan below) at this level -->
 </category> 

 <category>45's
   <product>Bob Dylan</product>
   <category>Picture Sleeves
     <product>Beach Boys Picture Sleeve</product>
    </category>
 </category>

 <category>Other
    <product>Bob Marley Cassette</product>
 </category>

</dir>

 

And the problem only happens when I'm browsing the LP's (when I have sub-categories, but no products right under the LP category). But when I browse the 45's (where I have sub-categories and produts directly under the 45 category) the layout is fine.

 

And if add a product directly under the LP category, like:

  <category>LP's
   <category>Rock
     <product>Skynyrd</product>
   </category>
   <product>Some other LP</product>
 </category>

 

Everything works fine.

 

Any ideas what might be causing this? Thanks for the quick replies.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...