Thanks for looking up quickly. Here's the error:
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /Applications/xampp/xamppfiles/htdocs/XML/p7c/cart2.php on line 89
Also, I just copied that statement "if($cart) {...} else {print "Your Cart is empty!}" somewhere that I don't remember now. Is that where the problem could be? I am repasting the code where I added the if and else statement that didn't work. If the total is equal to or more than $100, it should take them to the delivery page, but if not, then to pick-up page. Or is there any better alternative?
I really appreciate your help.
Maria
-----
<?
$xml = new SimpleXMLElement(file_get_contents("store.xml"));
session_start();
$cart = $_SESSION["cart"];
?>
<? require_once("head.php"); ?>
<?
if($cart)
{
?>
(X)ItemSizeQuantityUnit PriceItem Subtotal <?
$keys = array_keys($cart);
foreach($keys as $key)
{
$array = explode(".", $key);
$name = $array[0];
$size = $array[1];
$quantity = $cart["$key"];
$price = $xml->xpath("//item[@name=$name]/price[@size=$size]");
$unitPrice = (float) $price[0];
$itemSubtotal = $unitPrice * $quantity;
$total = $total + $itemSubtotal;
?>
remove
<? print($name); ?>
<? print($size); ?>
<? print($quantity); ?>
$<? printf("%0.2f", $unitPrice); ?>
$<? printf("%0.2f", $itemSubtotal); ?>
<?
}
?>
Total: $<? printf("%0.2f", $total); ?>
<?
?>
<?
}
else
{
?>
Your cart is empty!
<? } ?>
<?
if ($total=>100)
{
header ('Location: Delivery.php');
}
else
{
header ('Location: pickUp.php');
}
?>
Go Back to Shopping
<? require_once("end.php"); ?>