コード例 #1
0
ファイル: cart.php プロジェクト: TheProjecter/skeleton
<form action="index.php/cart/" method="get">
<h1>Shopping Cart</h1>
<?php 
$carturl = new A_Cart_Url();
$carturl->setManager($cart);
$cartitems = $cart->getItems();
if ($cartitems) {
    ?>
<table  cellpadding="5">
<tr>
	<td>SKU</td>
	<td>Name</td>
	<td>Price</td>
	<td>Quantity</td>
	<td>Sub-Total</td>
	<td>delete</td>
</tr>
<?php 
    foreach ($cartitems as $item) {
        echo "<tr>\r\n\t<td>" . $item->getProductId() . "</td>\r\n\t<td>" . $item->getData('name') . "</td>\r\n\t<td>" . $cart->moneyFormat($item->getUnitPrice()) . "</td>\r\n\t<td>" . $carturl->cartSetQuantityFormTextField($item->getId(), $item->getQuantity()) . "</td>\r\n\t<td>" . $cart->moneyFormat($item->getPrice()) . "</td>\r\n\t<td>" . $carturl->cartDeleteFromCheckbox($item->getId()) . "</td>\r\n</tr>";
    }
    ?>
<tr>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>Total:</td>
	<td><?php 
    echo $cart->moneyFormat($cart->getGrandTotal());
    ?>
</td>
コード例 #2
0
ファイル: listing.php プロジェクト: TheProjecter/skeleton
<form action="index.php/cart/" method="get">
<h2>Product Listing</h2>
<h3>Category <?php 
echo $category;
?>
</h3>
<table cellpadding="5">
<tr>
<td>SKU</td>
<td>Name</td>
<td>Price</td>
<td>Quantity</td>
</tr>
<?php 
$carturl = new A_Cart_Url();
$rows = $product->findProductsInCategory($category);
foreach ($rows as $row) {
    echo "<tr>\r\n<td>{$row['sku']}</td>\r\n<td>{$row['name']}</td>\r\n<td>\$" . number_format($row['price'], 2) . "</td>\r\n<td>" . $carturl->pageAddItemFormText($row['sku'], 0) . "</td>\r\n</tr>";
}
?>
</table>
<input type="submit" name="buy" value="buy"/>
</form>
<p><a href="index.php/product_category/"/>Return to Product Categories</a> | <a href="index.php/cart/"/>View Shopping Cart</a></p>