467,213 Members | 1,096 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,213 developers. It's quick & easy.

Why a blank page??

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'

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???

$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();
} else {

..... other conditions ....


code and html for title, menus, etc


<td id="pageContentsCell">
// 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
} else if (isset($_GET['viewCart'])) {
if ($cartId) {
displayShoppingCart($cartId); <- does display!!!
} else {
other conditions...


closing html


Feb 11 '07 #1
  • viewed: 1498
1 Reply

Not sure why this is happening. You could add some debugging messages
to displayShoppingCart or addItemToCart to see what might be going
on. Maybe it's exiting before that point or encountering an error?

I would set error_reporting(E_ALL) if necessary to check if there's
some unexpected conditions.

Feb 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by dmcconkey@yahoo.com | last post: by
6 posts views Thread by Melissa | last post: by
6 posts views Thread by noway@here.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.