<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category   AW
 * @package    AW_Mobile
 * @copyright  Copyright (c) 2010-2011 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */
?>
<?php
/**
 * Shoping cart sidebar
 *
 * @see Mage_Checkout_Block_Cart_Sidebar
 */
?>
<?php if($this->getCanDisplayCart() && $this->getIsNeedToDisplaySideBar()): ?>
<div class="box base-mini mini-cart">
    <div class="head">
        <?php $_cartQty = $this->getSummaryCount() ?>
        <h4><?php echo $this->__('My Cart') ?></h4>
        <?php if ($_cartQty>0): ?>
            <?php if ($_cartQty==1): ?>
            <?php echo $this->__('There is <a href="%s"><strong>1 item</strong></a> in your cart.', $this->getUrl('checkout/cart')) ?>
            <?php else: ?>
            <?php echo $this->__('There are <a href="%s"><strong>%s items</strong></a> in your cart.', $this->getUrl('checkout/cart'), $_cartQty) ?>
            <?php endif ?>
           <p class="subtotal">
           <?php echo $this->__('Cart Subtotal:') ?> <strong><?php echo Mage::helper('core')->currency($this->getSubtotal()) ?></strong>
           <?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?>
               <br />(<strong><?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?></strong> <?php echo Mage::helper('tax')->getIncExcText(true) ?>)
           <?php endif; ?>
           </p>
        <?php endif ?>
    </div>
    <?php $_items = $this->getRecentItems() ?>
    <?php if(count($_items)): ?>
        <div class="actions">
            <button class="form-button" type="button" onclick="setLocation('<?php echo $this->getUrl('checkout/onepage') ?>')"><span><?php echo $this->__('Checkout') ?></span></button>
        </div>
    <?php endif ?>
    <?php if(count($_items)): ?>
    <h5><?php echo $this->__('Recently added item(s)') ?></h5>
    <ol id="cart-sidebar">
    <?php foreach($_items as $_item): ?>
        <li>
            <div class="product-images">
                <a href="<?php echo $_item->getProductUrl() ?>"><img src="<?php echo $this->helper('catalog/image')->init($_item->getThumbnailObject(), 'thumbnail')->resize(50, 50)->setWatermarkSize('30x10'); ?>" alt="<?php echo $this->htmlEscape($_item->getProductName()) ?>" width="50" height="50" /></a>
            </div>
            <div class="product-details">
                <a href="<?php echo $this->getRemoveItemUrl($_item) ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="widget-btn"><img src="<?php echo $this->getSkinUrl('images/list_remove_btn.gif') ?>" alt="<?php echo $this->__('Remove Product') ?>" /></a>
                <a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getProductName()) ?></a>
                <?php echo $_item->getProductDescription() ?>
                <br /><strong><?php echo 1*$_item->getQty() ?></strong> x

                <?php $_excl = $_item->getPrice(); ?>
                <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
                <?php if ($this->helper('tax')->displayCartPriceInclTax()): $_excl = $_incl; endif; ?>

                <?php echo $this->helper('checkout')->formatPrice($_excl); ?>
                <?php if ($this->helper('tax')->displayCartBothPrices() && $_incl != $_excl): ?>
                    <br />(<span><?php echo $this->helper('checkout')->formatPrice($_incl); ?></span> <?php echo Mage::helper('tax')->__('Incl. Tax') ?>)
                <?php endif; ?>
            </div>
        </li>
    <?php endforeach; ?>
    </ol>
    <script type="text/javascript">decorateList('cart-sidebar')</script>
    <?php else: ?>
    <div class="content"><p><?php echo $this->__('You have no items in your shopping cart.') ?></p></div>
    <?php endif ?>
</div>
<!-- [ends] .cart-sidebar // -->
<?php endif ?>
