<?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) 2013 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Shopping cart template
 *
 * @see Mage_Checkout_Block_Cart
 */
?>
<div class="cart">
    <div class="page-title">
<h2><?php echo $this->__('Shopping Cart') ?></h2>
</div>
    <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
    <?php echo $this->getChildHtml('form_before') ?>
    <form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
        <?php echo $this->getBlockHtml('formkey'); ?>
        <fieldset>
            <table id="shopping-cart-table" class="data-table cart-table">
                <col width="1" />
                <col />
                <col width="1" />
            <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
                <col width="1" />
            <?php endif ?>
            <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
                <col width="1" />
            <?php endif; ?>
            <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
                <col width="1" />
            <?php endif; ?>
                <col width="1" />
            <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
                <col width="1" />
            <?php endif; ?>
            <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
                <col width="1" />
            <?php endif; ?>
                <col width="1" />

            <?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>
                <thead>
                    <tr>
                        <th rowspan="<?php echo $mergedCells; ?>">&nbsp;</th>
                        <th rowspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Product Name') ?></span></th>
                        <th rowspan="<?php echo $mergedCells; ?>"></th>
                        <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
                        <th rowspan="<?php echo $mergedCells; ?>" class="a-center"><span class="nobr"><?php echo $this->__('Move to Wishlist') ?></span></th>
                        <?php endif ?>
                        <th class="a-center" colspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Unit Price') ?></span></th>
                        <th rowspan="<?php echo $mergedCells; ?>" class="a-center"><?php echo $this->__('Qty') ?></th>
                        <th class="a-center" colspan="<?php echo $mergedCells; ?>"><?php echo $this->__('Subtotal') ?></th>
                        <th rowspan="<?php echo $mergedCells; ?>" class="a-center">&nbsp;</th>
                    </tr>
                    <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
                    <tr>
                        <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
                        <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
                        <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
                        <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
                    </tr>
                    <?php endif; ?>
                </thead>
                <tfoot>
                    <tr>
                        <td colspan="50" class="a-right">
                            <?php if($this->getContinueShoppingUrl()): ?>
                                <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
                            <?php endif; ?>
                            <button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Cart'); ?>" class="button btn-update"><span><span><?php echo $this->__('Update Cart'); ?></span></span></button>
                            <button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Clear Cart'); ?>" class="button btn-empty" id="empty_cart_button"><span><span><?php echo $this->__('Clear Cart'); ?></span></span></button>
                            <!--[if lt IE 8]>
                            <input type="hidden" id="update_cart_action_container" />
                            <script type="text/javascript">
                            //<![CDATA[
                                Event.observe(window, 'load', function()
                                {
                                    // Internet Explorer (lt 8) does not support value attribute in button elements
                                    $emptyCartButton = $('empty_cart_button');
                                    $cartActionContainer = $('update_cart_action_container');
                                    if ($emptyCartButton && $cartActionContainer) {
                                        Event.observe($emptyCartButton, 'click', function()
                                        {
                                            $emptyCartButton.setAttribute('name', 'update_cart_action_temp');
                                            $cartActionContainer.setAttribute('name', 'update_cart_action');
                                            $cartActionContainer.setValue('empty_cart');
                                        });
                                    }

                                });
                            //]]>
                            </script>
                            <![endif]-->
                        </td>
                    </tr>
                </tfoot>
                <tbody>
                <?php foreach($this->getItems() as $_item): ?>
                    <?php echo $this->getItemHtml($_item) ?>
                <?php endforeach ?>
                </tbody>
            </table>
            <script type="text/javascript">decorateTable('shopping-cart-table')</script>
        </fieldset>
    </form>


   <!-- BEGIN CART COLLATERALS -->


<div class="cart-collaterals"> 
<!-- BEGIN COL2 SEL COL 1 -->
<div class="totals col-2">

<?php /* Extensions placeholder */ ?>
<h3><?php echo $this->__('Shopping Cart Total')?></h3>
<div class="inner">
<?php echo $this->getChildHtml('totals'); ?>
<?php if(!$this->hasError()): ?>  
<ul class="checkout">           
<?php foreach ($this->getMethods('methods') as $method): ?>
<?php if ($methodHtml = $this->getMethodHtml($method)): ?>
<li><?php echo $methodHtml; ?></li><br />
<?php endif; ?>
<?php endforeach; ?>
</ul>                
<?php endif; ?>
</div><!--inner-->

</div> <!--totals col-2-->

<!-- BEGIN TOTALS COL 2 -->
<div class="col2-set col-1">

<?php echo $this->getChildHtml('checkout.cart.extra') ?>
<?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?> 
<?php echo $this->getChildHtml('coupon') ?> 



</div> <!--col2-set col-1-->
</div> <!--cart-collaterals-->
<?php echo $this->getChildHtml('crosssell') ?>
</div>  <!--cart-->
