Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
sidebar.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
14 ?>
15 <div class="block block-reorder" data-bind="scope: 'lastOrderedItems'">
16  <div class="block-title no-display"
17  data-bind="css: {'no-display': !lastOrderedItems().items || lastOrderedItems().items.length === 0}">
18  <strong id="block-reorder-heading" role="heading" aria-level="2"><?= /* @escapeNotVerified */ __('Recently Ordered') ?></strong>
19  </div>
20  <div class="block-content no-display"
21  data-bind="css: {'no-display': !lastOrderedItems().items || lastOrderedItems().items.length === 0}"
22  aria-labelledby="block-reorder-heading">
23  <form method="post" class="form reorder"
24  action="<?= /* @escapeNotVerified */ $block->getFormActionUrl() ?>" id="reorder-validate-detail">
25  <strong class="subtitle"><?= /* @escapeNotVerified */ __('Last Ordered Items') ?></strong>
26  <ol id="cart-sidebar-reorder" class="product-items product-items-names"
27  data-bind="foreach: lastOrderedItems().items">
28  <li class="product-item">
29  <div class="field item choice no-display" data-bind="css: {'no-display': !is_saleable}">
30  <label class="label" data-bind="attr: {'for': 'reorder-item-' + id}">
31  <span><?= /* @escapeNotVerified */ __('Add to Cart') ?></span>
32  </label>
33  <div class="control">
34  <input type="checkbox" name="order_items[]"
35  data-bind="attr: {id: 'reorder-item-' + id, value: id}"
36  title="<?= /* @escapeNotVerified */ __('Add to Cart') ?>"
37  class="checkbox" data-validate='{"validate-one-checkbox-required-by-name": true}'/>
38  </div>
39  </div>
40  <strong class="product-item-name">
41  <a data-bind="attr: {href: url}" class="product-item-link">
42  <span data-bind="text: name"></span>
43  </a>
44  </strong>
45  </li>
46  </ol>
47  <div id="cart-sidebar-reorder-advice-container"></div>
48  <div class="actions-toolbar">
49  <div class="primary no-display"
50  data-bind="css: {'no-display': !lastOrderedItems().isShowAddToCart}">
51  <button type="submit" title="<?= /* @escapeNotVerified */ __('Add to Cart') ?>" class="action tocart primary">
52  <span><?= /* @escapeNotVerified */ __('Add to Cart') ?></span>
53  </button>
54  </div>
55  <div class="secondary">
56  <a class="action view" href="<?= /* @escapeNotVerified */ $block->getUrl('customer/account') ?>">
57  <span><?= /* @escapeNotVerified */ __('View All') ?></span>
58  </a>
59  </div>
60  </div>
61  </form>
62  </div>
63  <script>
64  require(["jquery", "mage/mage"], function(jQuery){
65  jQuery('#reorder-validate-detail').mage('validation', {
66  errorPlacement: function(error, element) {
67  error.appendTo('#cart-sidebar-reorder-advice-container');
68  }
69  });
70  });
71  </script>
72 </div>
73 <script type="text/x-magento-init">
74 {
75  "*": {
76  "Magento_Ui/js/core/app": {
77  "components": {
78  "lastOrderedItems": {
79  "component": "Magento_Sales/js/view/last-ordered-items"
80  }
81  }
82  }
83  }
84 }
85 </script>
__()
Definition: __.php:13
jquery extjs ext tree mage adminhtml form
Definition: tree.phtml:41
jQuery('.store-switcher .dropdown-menu li a').each(function()
Definition: switcher.phtml:203