Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
iframe.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
10 $params = $block->getParams();
11 ?>
12 <html>
13  <head>
14  <script>
15  <?php if (isset($params['redirect'])): ?>
16  window.location="<?= $block->escapeUrl($params['redirect']) ?>";
17  <?php elseif (isset($params['redirect_parent'])): ?>
18  var require = window.top.require;
19  require(
20  [
21  'jquery'
22  ],
23  function($) {
24  var parent = window.top;
25  $(parent).trigger('clearTimeout');
26  parent.location="<?= $block->escapeUrl($params['redirect_parent']) ?>";
27  }
28  );
29  <?php elseif (isset($params['error_msg'])): ?>
30  var require = window.top.require;
31  require(
32  [
33  'jquery',
34  'Magento_Ui/js/model/messageList',
35  'mage/translate',
36  'Magento_Checkout/js/model/full-screen-loader'
37  ],
38  function($, globalMessageList, $t, fullScreenLoader) {
39  var parent = window.top;
40  $(parent).trigger('clearTimeout');
41  fullScreenLoader.stopLoader();
42  globalMessageList.addErrorMessage({
43  message: $t(
44  'A server error stopped your order from being placed. Please try to place your order again.'
45  )
46  });
47  }
48  );
49  <?php elseif (isset($params['multishipping'])): ?>
50  var require = window.top.require;
51  require(
52  [
53  'jquery'
54  ],
55  function($) {
56  var parent = window.top;
57  $(parent).trigger('clearTimeout');
58  $(parent.document).find('#multishipping-billing-form').submit();
59  }
60  );
61  <?php elseif (isset($params['order_success'])): ?>
62  window.top.location = "<?= $block->escapeUrl($params['order_success']) ?>";
63  <?php else: ?>
64  var require = window.top.require;
65  require(
66  [
67  'jquery',
68  'Magento_Checkout/js/model/quote',
69  'Magento_Checkout/js/action/place-order',
70  'Magento_Checkout/js/action/redirect-on-success',
71  'Magento_Checkout/js/model/full-screen-loader'
72  ],
73  function($, quote, placeOrderAction, redirectOnSuccessAction, fullScreenLoader) {
74  var parent = window.top;
75 
76  $(parent).trigger('clearTimeout');
77  $.when(
78  placeOrderAction({'method': quote.paymentMethod().method})
79  ).done(
80  function () {
81  redirectOnSuccessAction.execute();
82  }
83  ).fail(
84  function () {
85  var parent = window.top;
86  $(parent).trigger('clearTimeout');
87  fullScreenLoader.stopLoader();
88  }
89  );
90  }
91  );
92  <?php endif; ?>
93  </script>
94  </head>
95  <body></body>
96 </html>
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
taxRateField find('.mselect-list') .on( 'click.mselect-edit'
Definition: edit.phtml:162
$block
Definition: block.php:8
$params
Definition: iframe.phtml:12
endif
Definition: iframe.phtml:20