<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/**
 * Shoping cart sidebar
 *
 * @see Mage_Checkout_Block_Cart_Sidebar
 */
?>
<?php if ($this->getIsNeedToDisplaySideBar()): ?>
<?php
    $theme = $this->helper('ultimo');
    $cartClasses = '';

    $_cartQty = $this->getSummaryCount();
    if (!$_cartQty) {
        $cartClasses .= ' is-empty';
    }
    else {
        $cartClasses .= ' is-not-empty';
    }

    $showLabel = $theme->getCfg('header/cart_label');
    $canApplyMsrp = FALSE; //$this->canApplyMsrp();
?>
<div id="mini-cart-wrapper-regular">
<div id="mini-cart" class="mini-cart dropdown<?php echo $cartClasses; ?>">

    <a href="#header-cart" class="mini-cart-heading dropdown-heading cover skip-link skip-cart">
        <span>
        
            <span class="icon ic ic-cart"></span>
            <?php if ($_cartQty > 0): ?>
                <span class="count"><?php echo $_cartQty; ?></span>
            <?php endif; ?>
            <span class="label<?php if (!$showLabel) echo ' no-display'; ?>"><?php echo $this->__('Cart'); ?></span>
            <?php /* Comment-out to remove the subtotal from the mini-cart heading
            <?php if ($_cartQty > 0): ?>
                <?php if (!$canApplyMsrp): ?>
                    <span class="summary hide-below-960"><?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()); ?></span>
                <?php endif; ?>
            <?php else: ?>
                <span class="summary hide-below-960"><?php echo Mage::helper('checkout')->formatPrice(0); ?></span>
            <?php endif; ?>
            */ ?>
            <span class="caret">&nbsp;</span>

        </span>
    </a> <!-- end: heading -->
    
    <?php $_items = $this->getRecentItems(); ?>
    <?php if (count($_items)): ?>
        <div id="header-cart" class="mini-cart-content dropdown-content left-hand block block-cart skip-content skip-content--style">
            <div class="">

                <?php if ($tmpHtml = $this->getChildHtml('block_mini_cart_above_products')): ?>
                    <div class="block_mini_cart_above_products"><?php echo $tmpHtml; ?></div>
                <?php endif; ?>
            
                <div class="block-subtitle"><?php echo $this->__('Recently added item(s)') ?></div>
                <ol id="cart-sidebar" class="mini-products-list clearer">
                <?php foreach($_items as $_item): ?>
                    <?php echo $this->getItemHtml($_item) ?>
                <?php endforeach; ?>
                </ol>
                <script type="text/javascript">decorateList('cart-sidebar', 'none-recursive')</script>

                <div class="subtotal">
                    <?php if ($canApplyMsrp): ?>
                        <span class="map-cart-sidebar-total"><?php echo $this->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?></span>
                    <?php else: ?>
                        <span class="label"><?php echo $this->__('Cart Subtotal:') ?></span> <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>
                        <?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?>
                            <br />
                            <span class="incl-tax">(<?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?> <?php echo Mage::helper('tax')->getIncExcText(true) ?>)</span>
                        <?php endif; ?>
                    <?php endif; ?>
                </div>

                <div class="actions clearer">
                    <button type="button" title="<?php echo $this->__('View all items in your shopping cart') ?>" class="button btn-inline" onclick="setLocation('<?php echo $this->getUrl('checkout/cart') ?>')"><span><span><?php echo $this->__('View All') ?></span></span></button>
                    
                    <?php if($_cartQty && $this->isPossibleOnepageCheckout()): ?>
                        <button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-checkout btn-inline " onclick="setLocation('<?php echo $this->getCheckoutUrl(); ?>')"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
                        <?php echo $this->getChildHtml('extra_actions') ?>
                    <?php endif; ?>
                </div>

            </div> <!-- end: inner block -->
        </div> <!-- end: dropdown-content -->
    <?php else: ?>
        <div id="header-cart" class="mini-cart-content dropdown-content left-hand block block block-cart skip-content skip-content--style">
            <div class="block-content-inner">

                <?php if ($tmpHtml = $this->getChildHtml('block_mini_cart_above_products')): ?>
                    <div class="block_mini_cart_above_products"><?php echo $tmpHtml; ?></div>
                <?php endif; ?>
                <div class="empty"><?php echo $this->__('You have no items in your shopping cart.') ?></div>

            </div> <!-- end: inner block -->
        </div> <!-- end: dropdown-content -->
    <?php endif ?>

</div> <!-- end: mini-cart -->
</div> <!-- end: mini-cart-wrapper-regular -->

<?php endif;?>
