Hi,
I am working on a Php Shopping cart software. The following piece of code is not going through. Something is wrong ( might be syntax or whatever) in the code. Can some one help me in this regard please!.
This function is the part of code (global.php). When the user clicks on the 'checkout' button, it checks the status of user and also checks the total items in the cart, it it is less than 1 it will send an error message. Also, it checks the subtotal of the products and if it is less than £15, it will through an error message. id the subtotal is more than £15 it should go to the 'Order Confirmation' page.
elseif ($action == "checkout") {
if (islogged() != "Yes") {
$navigation = $lang_los[los];
$show_categories = showcategories ();
$redirect = "checkout";
eval("\$templates[login_box] = \"".$templates[login_box]."\";");
$goback = "checkout";
$signupform = userform();
eval("\$login_signup = \"".$templates[login_signup]."\";");
$main_content = stripslashes($login_signup);
start();
}
else {
if ($cart[total_items] < 1) {
header("location: $settings[shopurl]index.php?action=viewcart&error=empty");
exit;
}
//<-- the problem arises after adding this bit of code! ------->
elseif ($subtotal < 15) {
header("location: $settings[shopurl]index.php?action=viewcart&error=below");
exit;
}
//<--------- end of problem area ------->
$navigation = "Order Confirmation";
$show_categories = showcategories("");
$main_content = revieworder();
start();
}
}
The above code is working fine, when I have added and extra condition (between the comments), there is an error. I have tried with diferrent option, but I could not get it through. Can some one help me please.
Thanks & Regards.
JD
http://www.jagdeeshraja.com