Why a blank page??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • crater

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

    *************** *************** *************** ***

  • petersprc

    #2
    Re: Why a blank page??

    Hi,

    Not sure why this is happening. You could add some debugging messages
    to displayShopping Cart 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.

    Comment

    Working...