Ajeh:
I think you are correct that there is something off ... but ... there are several IFs in there that may also be confusing the issue ...
You're right. The IFs do confuse the issue. More so than I originally thought when I skimmed the code.
As I result, it now appears to me that although there are the right number of opening and closures of divs, the IFs mean that they don't match up in all circumstances.
Specifically, it seems that the Content div is only opened (line 14) if there is something in the cart and only closed (line 61) if the customer is logged on.
This allows two potential problems1. customer puts something in the cart before logging on, opening the div, but not closing it.
2. the customer is logged on but with nothing in the cart, resulting in a superfluous div closing tag
Number 1 is the reported bug and exists. It can be easily reproduced though would not normally be visually obvious. The specific circumstances that highlighted it were the adding of vertically repeating background image to this div that then proceeded to continue downwards to all lower boxes. I could replicate this on a publically visible site if you would find this helpful.
Number 2 I suspect is theoretical rather than actual, as I don't believe that this template is invoked if the cart is empty, and if it were to happen, then it is possible that a parent div would be prematurely closed with very obvious results. However, I'm not certain as I haven't tracked down where it is supressed and this would imply that the first IF/ELSE statement and the code in the ELSE part of it are redundant.
A possible solution, which appears to fix problem 1 with no side effects is to move the opening div to before the IF statement and the closing tag to after the last IF. I attach a zip of the Attachment #80 that I have tested successfully.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)