예제 #1
0
 public function getItems()
 {
     $this->_basket = Session::getSession('basket');
     if (!empty($this->_basket)) {
         $objCatalogue = new Catalogue();
         foreach ($this->_basket as $key => $value) {
             $this->_items[$key] = $objCatalogue->getProduct($key);
         }
     }
 }
예제 #2
0
<?php

Login::restrictFront();
$token1 = mt_rand();
$token2 = Login::string2hash($token1);
Session::setSession('token2', $token2);
$objBasket = new Basket();
$out = array();
$session = Session::getSession('basket');
if (!empty($session)) {
    $objCatalogue = new Catalogue();
    foreach ($session as $key => $value) {
        $out[$key] = $objCatalogue->getProduct($key);
    }
}
require_once "_header.php";
?>

<h1>Order summary</h1>

<?php 
if (!empty($out)) {
    ?>

<div id="big_basket">

	<form action="" method="post" id="frm_basket">
		
		<table cellpadding="0" cellspacing="0" border="0" class="tbl_repeat">
		
			<tr>
예제 #3
0
	<table cellpadding="0" cellspacing="0" border="0" class="tbl_repeat">
		
		<tr>
			<th>Item</th>
			<th class="ta_r">Qty</th>
			<th class="ta_r col_15">Price</th>
		</tr>
		
		<?php 
        foreach ($items as $item) {
            ?>
		
			<tr>
				<td>
					<?php 
            $product = $objCatalogue->getProduct($item['product']);
            echo $product['name'];
            ?>
				</td>
				<td class="ta_r"><?php 
            echo $item['qty'];
            ?>
</td>
				<td class="ta_r">
					&pound;<?php 
            echo number_format($objBasket->itemTotal($item['price'], $item['qty']), 2);
            ?>
				</td>
			</tr>
		
		<?php 
예제 #4
0
<?php

$id = Url::getParam('id');
if (!empty($id)) {
    $objCatalogue = new Catalogue();
    $product = $objCatalogue->getProduct($id);
    if (!empty($product)) {
        $category = $objCatalogue->getCategory($product['category']);
        require_once '_header.php';
        echo "<h1>Catalogue :: " . $category['name'] . "</h1>";
        $image = !empty($product['image']) ? 'media/catalogue/' . $product['image'] : null;
        if (!empty($image)) {
            $width = Helper::getImgSize($image, 0);
            $width = $width > 120 ? 120 : $width;
            echo "<div class=\"fl_l\">";
            echo "<div class=\"lft\"><img src=\"{$image}\" alt=\"";
            echo Helper::encodeHTML($product['name'], 1);
            echo "\" width=\"{$width}\" /></div>";
        }
        echo "<div class=\"rgt\"><h3>" . $product['name'] . "</h3>";
        echo "<h4><strong>&pound;" . $product['price'] . "</strong></h4>";
        echo Basket::activeButton($product['id']);
        echo "</div></div>";
        echo "<div class=\"dev\">&#160;</div>";
        echo "<p>" . Helper::encodeHTML($product['description']) . "</p>";
        echo "<div class=\"dev br_td\">&#160;</div>";
        echo "<p><a href=\"javascript:history.go(-1)\">Go back</a></p>";
        require_once '_footer.php';
    } else {
        require_once 'error.php';
    }