Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
billing.phtml
Go to the documentation of this file.
1 <?php
12 ?>
13 <div id="checkout-loader" data-role="checkout-loader" class="loading-mask" data-mage-init='{"billingLoader": {}}'>
14  <div class="loader">
15  <img src="<?= $block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')); ?>"
16  alt="<?= $block->escapeHtml(__('Loading...')); ?>"
17  style="position: absolute;">
18  </div>
19 </div>
20 <script>
21  window.checkoutConfig = <?= /* @noEscape */ $block->getCheckoutData()->getSerializedCheckoutConfigs(); ?>;
22  window.isCustomerLoggedIn = window.checkoutConfig.isCustomerLoggedIn;
23  window.customerData = window.checkoutConfig.customerData;
24 </script>
25 <div id="checkout" data-bind="scope:'checkoutMessages'">
26  <!-- ko template: getTemplate() --><!-- /ko -->
27  <script type="text/x-magento-init">
28  {
29  "#checkout": {
30  "Magento_Ui/js/core/app": {
31  "components": {
32  "checkoutMessages": {
33  "component": "Magento_Ui/js/view/messages",
34  "displayArea": "messages"
35  }
36  }
37  }
38  }
39  }
40  </script>
41 </div>
42 <form action="<?= $block->escapeUrl($block->getPostActionUrl()); ?>"
43  method="post"
44  id="multishipping-billing-form"
45  class="form multicheckout billing">
46  <div class="block block-billing">
47  <div class="block-content">
48  <div class="box box-billing-address">
49  <strong class="box-title">
50  <span><?= $block->escapeHtml(__('Billing Address')); ?></span>
51  <a href="<?= $block->escapeUrl($block->getSelectAddressUrl()); ?>" class="action">
52  <span><?= $block->escapeHtml(__('Change')); ?></span>
53  </a>
54  </strong>
55  <div class="box-content">
56  <address>
57  <?= /* @noEscape */ $block->getCheckoutData()->getAddressHtml($block->getAddress()); ?>
58  </address>
59  </div>
60  </div>
61  <div class="box box-billing-method">
62  <fieldset class="fieldset">
63  <legend class="legend box-title">
64  <span><?= $block->escapeHtml(__('Payment Method')); ?></span>
65  </legend><br>
66  <div class="box-content">
67  <?= $block->getChildHtml('payment_methods_before') ?>
68  <?php /* Payment methods forms list */ ?>
69  <dl class="checkout-payment-method" id="payment-methods">
70  <?php
71  $methods = $block->getMethods();
73  $methodsForms = $block->hasFormTemplates() ? $block->getFormTemplates(): [];
74 
75  foreach ($methods as $_method) :
76  $code = $_method->getCode();
77  $checked = $block->getSelectedMethodCode() === $code;
78 
79  if (isset($methodsForms[$code])) {
80  $block->setMethodFormTemplate($code, $methodsForms[$code]);
81  }
82  ?>
83  <dt class="item-title">
84  <?php if ($methodsCount > 1) : ?>
85  <input type="radio"
86  id="p_method_<?= $block->escapeHtml($code); ?>"
87  value="<?= $block->escapeHtml($code); ?>"
88  name="payment[method]"
89  title="<?= $block->escapeHtml($_method->getTitle()) ?>"
90  <?php if ($checked) : ?>
91  checked="checked"
92  <?php endif; ?>
93  class="radio"/>
94  <?php else : ?>
95  <input type="radio"
96  id="p_method_<?= $block->escapeHtml($code); ?>"
97  value="<?= $block->escapeHtml($code); ?>"
98  name="payment[method]"
99  checked="checked"
100  class="radio solo method" />
101  <?php endif; ?>
102  <label for="p_method_<?= $block->escapeHtml($code); ?>">
103  <?= $block->escapeHtml($_method->getTitle()) ?>
104  </label>
105  </dt>
106  <?php if ($html = $block->getChildHtml('payment.method.' . $code)) : ?>
107  <dd class="item-content <?= $checked ? '' : 'no-display'; ?>"
108  data-bind="scope: 'payment_method_<?= $block->escapeHtml($code);?>'">
109  <?= /* @noEscape */ $html; ?>
110  </dd>
111  <?php endif; ?>
112  <?php endforeach; ?>
113  </dl>
114  <?= $block->getChildHtml('payment_methods_after') ?>
115  <?= $block->getChildHtml('checkout_billing_items') ?>
116  </div>
117  </fieldset>
118  </div>
119  </div>
120  </div>
121  <div class="actions-toolbar">
122  <div class="primary">
123  <button id="payment-continue"
124  type="button"
125  class="action primary continue">
126  <span><?= $block->escapeHtml(__('Go to Review Your Order')); ?></span>
127  </button>
128  </div>
129  <div class="secondary">
130  <a href="<?= $block->escapeUrl($block->getBackUrl()); ?>" class="action back">
131  <span><?= $block->escapeHtml(__('Back to Shipping Information')); ?></span>
132  </a>
133  </div>
134  </div>
135 </form>
136 <script>
137  require(['jquery', 'mage/mage'], function(jQuery) {
138  var addtocartForm = jQuery('#multishipping-billing-form');
139 
140  addtocartForm.mage('payment', {
141  checkoutPrice: <?= (float)$block->getQuoteBaseGrandTotal() ?>
142  });
143 
144  addtocartForm.mage('validation', {
145  errorPlacement: function(error, element) {
146  if (element.attr('data-validate') && element.attr('data-validate').indexOf('validate-cc-ukss') >= 0) {
147  element.parents('form').find('[data-validation-msg="validate-cc-ukss"]').html(error);
148  } else {
149  element.after(error);
150  }
151  }
152  });
153  });
154 </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
if( $form)() ?>< script > require(['jquery' mage mage
Definition: save.phtml:15
__()
Definition: __.php:13
jquery extjs ext tree mage adminhtml form
Definition: tree.phtml:41
$block
Definition: block.php:8
$methods
Definition: billing.phtml:71
$methodsCount
Definition: billing.phtml:72
endif
Definition: billing.phtml:97
if($checked) else
Definition: billing.phtml:90
endforeach
Definition: billing.phtml:112
jQuery('.store-switcher .dropdown-menu li a').each(function()
Definition: switcher.phtml:203
$methodsForms
Definition: billing.phtml:73
$checked
Definition: billing.phtml:77
$code
Definition: info.phtml:12