Originally Posted by
Dave224
Thank you DrByte! Works great. I have one more minor problem. When I add one prohibited item to an empty cart, that the extra cart action removes, the message I want displayed doesn't appear on the empty cart page using $messageStack->add_session('shopping_page',...). I got around that by using $messageStack->add_session('header',...) which displays the message at the top of the empty cart page. But I would prefer the message be displayed in the center column. I also tried $messageStack->add('shopping_cart',...), but that didn't help. Everything works perfectly if there are other items in the cart.
How can I get the message to display in the center column on the empty cart page?
Thank you.
Dave
For whatever reason, the as-shipped tpl_shopping_cart_default.php doesn't invoke the messageStack on an empty cart. Find this section (starting on line 181 for the zc157 template_default version):
Code:
<?php
} else {
?>
<h2 id="cartEmptyText"><?php echo TEXT_CART_EMPTY; ?></h2>
<?php
$show_display_shopping_cart_empty = $db->Execute(SQL_SHOW_SHOPPING_CART_EMPTY);
while (!$show_display_shopping_cart_empty->EOF) {
?>
... and add the message-stack display:
Code:
<?php
} else {
?>
<h2 id="cartEmptyText"><?php echo TEXT_CART_EMPTY; ?></h2>
<?php if ($messageStack->size('shopping_cart') > 0) echo $messageStack->output('shopping_cart'); ?>
<?php
$show_display_shopping_cart_empty = $db->Execute(SQL_SHOW_SHOPPING_CART_EMPTY);
while (!$show_display_shopping_cart_empty->EOF) {
?>
Bookmarks