1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- // @codingStandardsIgnoreFile
- /**
- * Last ordered items sidebar
- *
- * @var $block \Magento\Sales\Block\Reorder\Sidebar
- */
- ?>
- <div class="block block-reorder" data-bind="scope: 'lastOrderedItems'">
- <div class="block-title no-display"
- data-bind="css: {'no-display': !lastOrderedItems().items || lastOrderedItems().items.length === 0}">
- <strong id="block-reorder-heading" role="heading" aria-level="2"><?= /* @escapeNotVerified */ __('Recently Ordered') ?></strong>
- </div>
- <div class="block-content no-display"
- data-bind="css: {'no-display': !lastOrderedItems().items || lastOrderedItems().items.length === 0}"
- aria-labelledby="block-reorder-heading">
- <form method="post" class="form reorder"
- action="<?= /* @escapeNotVerified */ $block->getFormActionUrl() ?>" id="reorder-validate-detail">
- <strong class="subtitle"><?= /* @escapeNotVerified */ __('Last Ordered Items') ?></strong>
- <ol id="cart-sidebar-reorder" class="product-items product-items-names"
- data-bind="foreach: lastOrderedItems().items">
- <li class="product-item">
- <div class="field item choice">
- <label class="label" data-bind="attr: {'for': 'reorder-item-' + id}">
- <span><?= /* @escapeNotVerified */ __('Add to Cart') ?></span>
- </label>
- <div class="control">
- <input type="checkbox" name="order_items[]"
- data-bind="attr: {
- id: 'reorder-item-' + id,
- value: id,
- title: is_saleable ? '<?= /* @escapeNotVerified */ __('Add to Cart') ?>' : '<?= /* @escapeNotVerified */ __('Product is not salable.') ?>'
- },
- disable: !is_saleable"
- class="checkbox" data-validate='{"validate-one-checkbox-required-by-name": true}'/>
- </div>
- </div>
- <strong class="product-item-name">
- <a data-bind="attr: {href: url}" class="product-item-link">
- <span data-bind="text: name"></span>
- </a>
- </strong>
- </li>
- </ol>
- <div id="cart-sidebar-reorder-advice-container"></div>
- <div class="actions-toolbar">
- <div class="primary"
- data-bind="visible: isShowAddToCart">
- <button type="submit" title="<?= /* @escapeNotVerified */ __('Add to Cart') ?>" class="action tocart primary">
- <span><?= /* @escapeNotVerified */ __('Add to Cart') ?></span>
- </button>
- </div>
- <div class="secondary">
- <a class="action view" href="<?= /* @escapeNotVerified */ $block->getUrl('customer/account') ?>">
- <span><?= /* @escapeNotVerified */ __('View All') ?></span>
- </a>
- </div>
- </div>
- </form>
- </div>
- <script>
- require(["jquery", "mage/mage"], function(jQuery){
- jQuery('#reorder-validate-detail').mage('validation', {
- errorPlacement: function(error, element) {
- error.appendTo('#cart-sidebar-reorder-advice-container');
- }
- });
- });
- </script>
- </div>
- <script type="text/x-magento-init">
- {
- "*": {
- "Magento_Ui/js/core/app": {
- "components": {
- "lastOrderedItems": {
- "component": "Magento_Sales/js/view/last-ordered-items"
- }
- }
- }
- }
- }
- </script>
|