I have a problen getting some information to display on my internet
store's web page.
Normally, to view the store's shopping cart the user
clicks the "View Cart" button. If there are any items in
the cart with his/her alloted cartId, those items are
displayed in a formatted display. It works fine (see 'does display'
below).
If a user clicks the "Add to Cart" button displayed with
any product I want to display the cart immediately after the
product has been added.
However, the product item gets added to the cart OK, but the
"pageContentsCe ll" is blank. (see 'won't display' below).
Can anyone see where I'm going wrong???
*************** *************** *************** ***
<?php
$departmentId = null;
$categoryId = null;
$searchString = null;
$addProdId = null;
$cartId = getCartIdFromCo okie();
// if adding a product to the cart
// make sure we have a valid cartId
if (isset($_GET['PId'])) {
$addProdId = $_GET['PId'];
if (!$cartId) {
$cartId = getNewCartId();
setCartIdCookie ($cartId);
}
} else {
..... other conditions ....
}
html_header();
?>
........
code and html for title, menus, etc
........
</tr>
<tr>
<td id="pageContent sCell">
<?php
// All code for the content area goes in here
if ($addProdId) {
addItemToCart($ cartId, $addProdId);
displayShopping Cart($cartId); // <- won't display!!!
} else if (empty($_GET)) {
// first page
displayFirstPag e(24);
} else if (isset($_GET['viewCart'])) {
if ($cartId) {
displayShopping Cart($cartId); <- does display!!!
} else {
displayEmptyCar t();
}
......
other conditions...
......
?>
closing html
*************** *************** *************** ***
Comment