|
Posted by crater on 02/11/07 18:26
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
"pageContentsCell" 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 = getCartIdFromCookie();
// 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="pageContentsCell">
<?php
// All code for the content area goes in here
if ($addProdId) {
addItemToCart($cartId, $addProdId);
displayShoppingCart($cartId); // <- won't display!!!
} else if (empty($_GET)) {
// first page
displayFirstPage(24);
} else if (isset($_GET['viewCart'])) {
if ($cartId) {
displayShoppingCart($cartId); <- does display!!!
} else {
displayEmptyCart();
}
......
other conditions...
......
?>
closing html
************************************************
Navigation:
[Reply to this message]
|