<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**  @var $block \Magento\Checkout\Block\Cart */
?>
<div id="cart-cart" class="cart-cart col-md-9 col-lg-8">
    <?php $mergedCells = ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices() ? 2 : 1); ?>
    <?php echo $block->getChildHtml('form_before') ?>
    <form action="<?php /* @escapeNotVerified */ echo $block->getUrl('checkout/cart/updatePost') ?>"
              method="post"
              id="form-validate"
              data-mage-init='{"validation":{}}'
              class="form form-cart">
        <?php echo $block->getBlockHtml('formkey'); ?>
        <div class="cart table-responsive table-wrapper<?php echo $mergedCells == 2 ? ' detailed' : ''; ?>">
            <table id="shopping-cart-table"
                   class="cart items data table table-sm"
                   data-mage-init='{"shoppingCart":{"emptyCartButton": "action.clear",
                   "updateCartActionContainer": "#update_cart_action_container"}}'>
                <thead>
                    <tr>
                        <th class="item" scope="col"><span><?php /* @escapeNotVerified */ echo __('Item') ?></span></th>
                        <th class="price" scope="col"><span><?php /* @escapeNotVerified */ echo __('Price') ?></span></th>
                        <th class="qty" scope="col"><span><?php /* @escapeNotVerified */ echo __('Qty') ?></span></th>
                        <th class="subtotal" scope="col"><span><?php /* @escapeNotVerified */ echo __('Subtotal') ?></span></th>
                        <th class="cart-actions"></th>
                    </tr>
                </thead>
                <?php foreach ($block->getItems() as $_item): ?>
                    <?php echo $block->getItemHtml($_item) ?>
                <?php endforeach ?>
            </table>
        </div>
        <div class="cart main actions text-right">
            <?php if ($block->getContinueShoppingUrl()): ?>
                <a class="action continue btn btn-secondary btn-sm"
                   href="<?php echo $block->escapeUrl($block->getContinueShoppingUrl()) ?>"
                   title="<?php echo $block->escapeHtml(__('Continue Shopping')); ?>">
                    <span><?php /* @escapeNotVerified */ echo __('Continue Shopping') ?></span>
                </a>
            <?php endif; ?>
            <button type="submit"
                    name="update_cart_action"
                    data-cart-empty=""
                    value="empty_cart"
                    title="<?php echo $block->escapeHtml(__('Clear Shopping Cart')); ?>"
                    class="action clear btn btn-secondary btn-sm" id="empty_cart_button">
                <span><?php /* @escapeNotVerified */ echo __('Clear Shopping Cart'); ?></span>
            </button>
            <button type="submit"
                    name="update_cart_action"
                    data-cart-item-update=""
                    value="update_qty"
                    title="<?php echo $block->escapeHtml(__('Update Shopping Cart')); ?>"
                    class="action update btn btn-primary btn-sm">
                <span><?php /* @escapeNotVerified */ echo __('Update Shopping Cart'); ?></span>
            </button>
            <input type="hidden" value="" id="update_cart_action_container" data-cart-item-update=""/>
        </div>
    </form>
    <?php echo $block->getChildHtml('checkout.cart.order.actions') ?>
    <?php echo $block->getChildHtml('shopping.cart.table.after'); ?>
</div>
