Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2007
    Posts
    34
    Plugin Contributions
    0

    Default MessageStack Errors + layout

    In templates/tpl_shopping_cart_default.php I have this:

    Code:
    <?php if ($messageStack->size('shopping_cart') > 0) echo $messageStack->output('shopping_cart'); ?>
    Which outputs the following:

    Code:
    <div class="messageStackCaution larger"><img src="includes/templates/alt_jungle/images/icons/warning.gif" alt="Warning" title=" Warning " width="20" height="20" />  Please update your order ...<br />Product Name: Test Product<br />We are sorry but this product has been removed from our inventory at this time.<br />This item has been removed from your shopping basket.<br /></div>
    Now I'd like to wrap that inside an addition <div> without having that extra <div> show when the error message isn't there.

    So obviously,

    Code:
    <div class="my_extra_div"><?php if ($messageStack->size('shopping_cart') > 0) echo $messageStack->output('shopping_cart'); ?></div>
    doesn't work as the <div> will always be displayed.

    Code:
    <?php if ($messageStack->size('shopping_cart') > 0) echo '<div class="my_extra_div">' . $messageStack->output('shopping_cart') . '</div>; ?>
    Doesn't work either.. it seems the error is generated before the echo, and I'm useless at php.




    Where are the <div="messageStackCaution Larger"> being generated?

  2. #2
    Join Date
    Jan 2007
    Posts
    34
    Plugin Contributions
    0

    Default Re: MessageStack Errors + layout

    ok, I seem to have got it working with this:

    Code:
    <?php if ($messageStack->size('shopping_cart') > 0) { ?>
    <div class="my_extra_div">
    	<?php if ($messageStack->size('shopping_cart') > 0) echo $messageStack->output('shopping_cart'); ?>
    </div>
    <?php } ?>
    I have no idea if that is right or will give me problems somewhere down the line, but it works :)

 

 

Similar Threads

  1. Added my own MessageStack for Additional Credit Card Processing Errors
    By RoboPhung in forum PayPal Website Payments Pro support
    Replies: 4
    Last Post: 8 Sep 2012, 09:49 AM
  2. Layout Errors on Laptops
    By colnixon in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 17 Feb 2009, 02:10 PM
  3. Layout controller errors
    By robbok in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 1 Feb 2007, 08:36 PM
  4. Layout errors in IE. Firefox ok
    By strelitzia in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Nov 2006, 11:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR