J.Silver Posted October 27, 2011 Share Posted October 27, 2011 Dear Sirs, I have an e-commerce program that is complete in all of its aspects but cannot pass the cart page—unable to Checkout to the next page. I am able to log into the site via either http or https protocols. In https, e.g., I can move through the index page, catalogue, browse, shopping, wish list, & cart pages. The cart page itself functions properly as designed in the sense of adding items, removing items to the wish list, deleting items, provision of correct product and shipping costs, and amending quantities. The only problem is when clicking the Checkout, it does not proceed to next page but rather gives error message. In IE it gives ‘Internet Explorer Cannot Display the Webpage.’ In Chrome, it does the same but the message is error 105, and in FF the error is server is not available. Working URLs: https://final.local/ , https://final.local/browse/coffee/Kona/3 , https://final.local/cart.php Not working URL (the URL which gives above error messages): https://www.final/local/checkout.php?session=9a31881e6c08e8277b133e22794a0042 Header, footer¸ and other includable files are included properly as per design. I have included both cart files, and would highly appreciate any suggestions/amendments to enable me Checkout from the cart page. Many thanks cart.html Note: begins with normal html view and table (not included here), which appears as designed. </table><br /><p align="center"><input type="submit" value="Amend Quantity" class="button" /></form></p><br /><p align="center"><a href="https://<?php echo BASE_URL; ?>checkout.php?session=<?php echo $uid; ?>" class="button">Checkout</a></p></div> Note: ends with the normal html view (not included here), which appears as designed. cart.php <?php require ('./includes/config.inc.php'); if (isset($_COOKIE['SESSION'])) { $uid = $_COOKIE['SESSION']; } else { $uid = md5(uniqid('biped',true)); } setcookie('SESSION', $uid, time()+(60*60*24*30)); $page_title = 'Your Shoppping Cart’; include ('./includes/header.html'); require (MYSQL); include ('./includes/product_functions.inc.php'); // If there's a SKU value in the URL, break it down into its parts: if (isset($_GET['sku'])) { list($sp_type, $pid) = parse_sku($_GET['sku']); } if (isset ($pid, $sp_type, $_GET['action']) && ($_GET['action'] == 'add') ) { // Add a new product to the cart: $r = mysqli_query($dbc, "CALL add_to_cart('$uid', '$sp_type', $pid, 1)"); } elseif (isset ($sp_type, $pid, $_GET['action']) && ($_GET['action'] == 'remove') ) { // Remove it from the cart. $r = mysqli_query($dbc, "CALL remove_from_cart('$uid', '$sp_type', $pid)"); } elseif (isset ($sp_type, $pid, $_GET['action'], $_GET['qty']) && ($_GET['action'] == 'move') ) { // Move it to the cart. // Determine the quantity: $qty = (filter_var($_GET['qty'], FILTER_VALIDATE_INT, array('min_range' => 1))) ? $_GET['qty'] : 1; // Add it to the cart: $r = mysqli_query($dbc, "CALL add_to_cart('$uid', '$sp_type', $pid, $qty)"); // Remove it from the wish list: $r = mysqli_query($dbc, "CALL remove_from_wish_list('$uid', '$sp_type', $pid)"); } elseif (isset($_POST['quantity'])) { // Update quantities in the cart. foreach ($_POST['quantity'] as $sku => $qty) { // Parse the SKU: list($sp_type, $pid) = parse_sku($sku); if (isset($sp_type, $pid)) { // Determine the quantity: $qty = (filter_var($qty, FILTER_VALIDATE_INT, array('min_range' => 0)) !== false) ? $qty : 1; // Update the quantity in the cart: $r = mysqli_query($dbc, "CALL update_cart('$uid', '$sp_type', $pid, $qty)"); } } // End of FOREACH loop. }// End of main IF. // Get the cart contents: $r = mysqli_query($dbc, "CALL get_shopping_cart_contents('$uid')"); if (mysqli_num_rows($r) > 0) { // Products to show! include ('./views/cart.html'); } else { // Empty cart! include ('./views/emptycart.html'); } include ('./includes/footer.html'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/249930-cart-checkout-problem/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.