13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

850 Chapter 33 Connecting to <strong>Web</strong> Services with XML <strong>and</strong> SOAP<br />

Listing 33.13<br />

Continued<br />

name=\"submit.add-to-cart\" value=\"Buy<br />

From Amazon.com\"><br />

When you have finished shopping press checkout to add all<br />

the items in your Tahuayo cart to your Amazon cart <strong>and</strong><br />

complete your purchase.<br />

<br />

<br />

If you have finished with this cart, you can empty it<br />

of all items.<br />

<br />

<br />

Cart Contents";<br />

showSummary($products, 1, count($products), $mode, 0, true);<br />

}<br />

// show the small overview cart that is always on the screen<br />

// only shows the last three items added<br />

function showSmallCart() {<br />

global $_SESSION;<br />

echo "<br />

Your Cart $".<br />

number_format(cartPrice(), 2)."<br />

".cartContents()."";<br />

// form to link to an Amazon.com shopping cart<br />

echo "<br />

";<br />

foreach($_SESSION['cart'] as $ASIN=>$product) {<br />

$quantity = $_SESSION['cart'][$ASIN]['quantity'];<br />

echo "";<br />

echo "";<br />

}<br />

echo "

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!