form.phtml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /** @var $block \Magento\Checkout\Block\Cart\Grid */
  8. ?>
  9. <?php $mergedCells = ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices() ? 2 : 1); ?>
  10. <?= $block->getChildHtml('form_before') ?>
  11. <form action="<?= /* @escapeNotVerified */ $block->getUrl('checkout/cart/updatePost') ?>"
  12. method="post"
  13. id="form-validate"
  14. data-mage-init='{"Magento_Checkout/js/action/update-shopping-cart":
  15. {"validationURL" : "/checkout/cart/updateItemQty"}
  16. }'
  17. class="form form-cart">
  18. <?= $block->getBlockHtml('formkey') ?>
  19. <div class="cart table-wrapper<?= $mergedCells == 2 ? ' detailed' : '' ?>">
  20. <?php if ($block->getPagerHtml()): ?>
  21. <div class="cart-products-toolbar cart-products-toolbar-top toolbar" data-attribute="cart-products-toolbar-top"><?= $block->getPagerHtml() ?></div>
  22. <?php endif ?>
  23. <table id="shopping-cart-table"
  24. class="cart items data table"
  25. data-mage-init='{"shoppingCart":{"emptyCartButton": ".action.clear",
  26. "updateCartActionContainer": "#update_cart_action_container"}}'>
  27. <caption class="table-caption"><?= /* @escapeNotVerified */ __('Shopping Cart Items') ?></caption>
  28. <thead>
  29. <tr>
  30. <th class="col item" scope="col"><span><?= /* @escapeNotVerified */ __('Item') ?></span></th>
  31. <th class="col price" scope="col"><span><?= /* @escapeNotVerified */ __('Price') ?></span></th>
  32. <th class="col qty" scope="col"><span><?= /* @escapeNotVerified */ __('Qty') ?></span></th>
  33. <th class="col subtotal" scope="col"><span><?= /* @escapeNotVerified */ __('Subtotal') ?></span></th>
  34. </tr>
  35. </thead>
  36. <?php foreach ($block->getItems() as $_item): ?>
  37. <?= $block->getItemHtml($_item) ?>
  38. <?php endforeach ?>
  39. </table>
  40. <?php if ($block->getPagerHtml()): ?>
  41. <div class="cart-products-toolbar cart-products-toolbar-bottom toolbar" data-attribute="cart-products-toolbar-bottom"><?= $block->getPagerHtml() ?></div>
  42. <?php endif ?>
  43. </div>
  44. <div class="cart main actions">
  45. <?php if ($block->getContinueShoppingUrl()): ?>
  46. <a class="action continue"
  47. href="<?= $block->escapeUrl($block->getContinueShoppingUrl()) ?>"
  48. title="<?= $block->escapeHtml(__('Continue Shopping')) ?>">
  49. <span><?= /* @escapeNotVerified */ __('Continue Shopping') ?></span>
  50. </a>
  51. <?php endif; ?>
  52. <button type="submit"
  53. name="update_cart_action"
  54. data-cart-empty=""
  55. value="empty_cart"
  56. title="<?= $block->escapeHtml(__('Clear Shopping Cart')) ?>"
  57. class="action clear" id="empty_cart_button">
  58. <span><?= /* @escapeNotVerified */ __('Clear Shopping Cart') ?></span>
  59. </button>
  60. <button type="submit"
  61. name="update_cart_action"
  62. data-cart-item-update=""
  63. value="update_qty"
  64. title="<?= $block->escapeHtml(__('Update Shopping Cart')) ?>"
  65. class="action update">
  66. <span><?= /* @escapeNotVerified */ __('Update Shopping Cart') ?></span>
  67. </button>
  68. <input type="hidden" value="" id="update_cart_action_container" data-cart-item-update=""/>
  69. </div>
  70. </form>
  71. <?= $block->getChildHtml('checkout.cart.order.actions') ?>
  72. <?= $block->getChildHtml('shopping.cart.table.after') ?>