Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
form.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php ?>
11 <?php $_shippingRateGroups = $block->getShippingRates(); ?>
12 <?php if ($_shippingRateGroups): ?>
13  <div id="order-shipping-method-choose" class="control" style="display:none">
14  <dl class="admin__order-shipment-methods">
15  <?php foreach ($_shippingRateGroups as $code => $_rates): ?>
16  <dt class="admin__order-shipment-methods-title"><?= $block->escapeHtml($block->getCarrierName($code)) ?></dt>
17  <dd class="admin__order-shipment-methods-options">
18  <ul class="admin__order-shipment-methods-options-list">
19  <?php foreach ($_rates as $_rate): ?>
20  <?php $_radioProperty = 'name="order[shipping_method]" type="radio" onclick="order.setShippingMethod(this.value)"' ?>
21  <?php $_code = $_rate->getCode() ?>
22  <li class="admin__field-option">
23  <?php if ($_rate->getErrorMessage()): ?>
24  <div class="messages">
25  <div class="message message-error error">
26  <div><?= $block->escapeHtml($_rate->getErrorMessage()) ?></div>
27  </div>
28  </div>
29  <?php else: ?>
30  <?php $_checked = $block->isMethodActive($_code) ? 'checked="checked"' : '' ?>
31  <input <?= /* @escapeNotVerified */ $_radioProperty ?> value="<?= /* @escapeNotVerified */ $_code ?>"
32  id="s_method_<?= /* @escapeNotVerified */ $_code ?>" <?= /* @escapeNotVerified */ $_checked ?>
33  class="admin__control-radio required-entry"/>
34  <label class="admin__field-label" for="s_method_<?= /* @escapeNotVerified */ $_code ?>">
35  <?= $block->escapeHtml($_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> -
36  <strong>
37  <?php $_excl = $block->getShippingPrice($_rate->getPrice(), $this->helper('Magento\Tax\Helper\Data')->displayShippingPriceIncludingTax()); ?>
38  <?php $_incl = $block->getShippingPrice($_rate->getPrice(), true); ?>
39 
40  <?= /* @escapeNotVerified */ $_excl ?>
41  <?php if ($this->helper('Magento\Tax\Helper\Data')->displayShippingBothPrices() && $_incl != $_excl): ?>
42  (<?= /* @escapeNotVerified */ __('Incl. Tax') ?> <?= /* @escapeNotVerified */ $_incl ?>)
43  <?php endif; ?>
44  </strong>
45  </label>
46  <?php endif ?>
47  </li>
48  <?php endforeach; ?>
49  </ul>
50  </dd>
51  <?php endforeach; ?>
52  </dl>
53  </div>
54  <?php if ($_rate = $block->getActiveMethodRate()): ?>
55  <div id="order-shipping-method-info" class="order-shipping-method-info">
56  <dl class="admin__order-shipment-methods">
57  <dt class="admin__order-shipment-methods-title">
58  <?= $block->escapeHtml($block->getCarrierName($_rate->getCarrier())) ?>
59  </dt>
60  <dd class="admin__order-shipment-methods-options">
61  <?= $block->escapeHtml($_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> -
62  <strong>
63  <?php $_excl = $block->getShippingPrice($_rate->getPrice(), $this->helper('Magento\Tax\Helper\Data')->displayShippingPriceIncludingTax()); ?>
64  <?php $_incl = $block->getShippingPrice($_rate->getPrice(), true); ?>
65 
66  <?= /* @escapeNotVerified */ $_excl ?>
67  <?php if ($this->helper('Magento\Tax\Helper\Data')->displayShippingBothPrices() && $_incl != $_excl): ?>
68  (<?= /* @escapeNotVerified */ __('Incl. Tax') ?> <?= /* @escapeNotVerified */ $_incl ?>)
69  <?php endif; ?>
70  </strong>
71  </dd>
72  </dl>
73  <a href="#"
74  onclick="$('order-shipping-method-info').hide();$('order-shipping-method-choose').show();return false"
75  class="action-default">
76  <span><?= /* @escapeNotVerified */ __('Click to change shipping method') ?></span>
77  </a>
78  </div>
79  <?php else: ?>
80  <script>
81 require(['prototype'], function(){
82  $('order-shipping-method-choose').show();
83 });
84 </script>
85  <?php endif; ?>
86 <?php elseif ($block->getIsRateRequest()): ?>
87  <div class="order-shipping-method-summary">
88  <strong class="order-shipping-method-not-available"><?= /* @escapeNotVerified */ __('Sorry, no quotes are available for this order.') ?></strong>
89  </div>
90 <?php else: ?>
91  <div id="order-shipping-method-summary" class="order-shipping-method-summary">
92  <a href="#" onclick="order.loadShippingRates();return false" class="action-default">
93  <span><?= /* @escapeNotVerified */ __('Get shipping methods and rates') ?></span>
94  </a>
95  <input type="hidden" name="order[has_shipping]" value="" class="required-entry" />
96  </div>
97 <?php endif; ?>
98 <div style="display: none;" id="shipping-method-overlay" class="order-methods-overlay">
99  <span><?= /* @escapeNotVerified */ __('You don\'t need to select a shipping method.') ?></span>
100 </div>
101 <script>
102  require(["Magento_Sales/order/create/form"], function(){
103 
104  order.overlay('shipping-method-overlay', <?php if ($block->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
105  order.overlay('address-shipping-overlay', <?php if ($block->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
106 
107  <?php if ($block->getQuote()->isVirtual()): ?>
108  order.isOnlyVirtualProduct = true;
109  <?php endif; ?>
110  });
111 </script>
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
$_incl
Definition: form.phtml:38
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
endforeach
Definition: form.phtml:122
endif
Definition: form.phtml:34
$_shippingRateGroups
Definition: form.phtml:11
__()
Definition: __.php:13
$_code
Definition: attribute.phtml:19
$block
Definition: block.php:8
$code
Definition: form.phtml:10
if( $_rate=$block->getActiveMethodRate())( $block->getCarrierName( $_rate->getCarrier())) ?></dt >< dd class $_excl
Definition: form.phtml:63
$_rates
Definition: matrix.phtml:18