Shopping Cart
Im sure there has been a post about this before, but im having extreme troubles with this.. I even contacted people before and they couldnt even figure out the problem. The problem is when you add a product to your cart and you view your cart, 1 you cant change the quantities and you cant go to the checkout each time you click the checkout button it says that there is no item in the cart.. so if you can will anyone please help me!!!
Thanks so much!!!!
attached is my website if you would like to download it to see the scripts.. i believe the problem resides in "show_cart.php" and/or "checkout.php" below is the scripts...
<?php
include ('book_sc_fns.php');
// The shopping cart needs sessions, so start one
session_start();
@ $new = $GET['new'];
if($new)
{
//new item selected
if(!session_is_registered('cart'))
{
$SESSION['cart'] = array();
$SESSION['items'] = 0;
$SESSION['total_price'] ='0.00';
}
if(isset($SESSION['cart'][$new]))
$SESSION['cart'][$new]++;
else
$SESSION['cart'][$new] = 1;
$SESSION['total_price'] = calculate_price($SESSION['cart']);
$SESSION['items'] = calculate_items($SESSION['cart']);
}
if(isset($SESSION['save']))
{
foreach ($SESSION['cart'] as $modelnum => $qty)
{
if
($SESSION[$modelnum]=='0')
unset($SESSION['cart'][$modelnum]);
else
$SESSION['cart'][$modelnum] = $SESSION[$modelnum];
}
$SESSION['total_price'] = calculate_price($SESSION['cart']);
$SESSION['items'] = calculate_items($SESSION['cart']);
}
do_html_header('Your Shopping Cart');
if($SESSION['cart']&&array_count_values($SESSION['cart']))
display_cart($SESSION['cart']);
else
{
echo '<p>There are no items in your cart</p>';
echo '<hr />';
}
$target = 'index.php';
// if we have just added an item to the cart, continue shopping in that category
if($new)
{
$details = get_book_details($new);
if($details['catid'])
$target = 'show_cat.php?catid='.$details['catid'];
}
display_button($target, 'continue-shopping', 'Continue Shopping');
// use this if SSL is set up
// $path = $HTTP_SERVER_VARS['PHP_SELF'];
// $server = $HTTP_SERVER_VARS['SERVER_NAME'];
// $path = str_replace('show_cart.php', '', $path);
// display_button('https://'.$server.$path.'checkout.php','go-to-checkout', 'Go To Checkout');
// if no SSL use below code
display_button('checkout.php', 'go-to-checkout', 'Go To Checkout');
do_html_footer();
?>
and here is the checkout.php script
<?php
//include our function set
include ('book_sc_fns.php');
// The shopping cart needs sessions, so start one
session_start();
do_html_header('Checkout');
if($SESSION['cart']&&array_count_values($SESSION['cart']))
{
display_checkout_form();
display_cart($_SESSION['cart'], true, 1);
}
else
echo '<p>There are no items in your cart</p>';
display_button('show_cart.php', 'continue-shopping', 'Continue Shopping');
do_html_footer();
?>
if you can help me please
my email is;
ibo_dngo@yahoo.com