review.phtml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /**
  8. * @var \Magento\Paypal\Block\Express\Review $block
  9. */
  10. ?>
  11. <div class="paypal-review view">
  12. <div class="block block-order-details-view">
  13. <div class="block-content">
  14. <?php if ($block->getShippingAddress()): ?>
  15. <div class="box box-order-shipping-method">
  16. <strong class="box-title">
  17. <span><?= $block->escapeHtml(__('Shipping Method')) ?></span>
  18. </strong>
  19. <div class="box-content">
  20. <form method="post" id="shipping-method-form"
  21. action="<?= $block->escapeUrl($block->getShippingMethodSubmitUrl()) ?>"
  22. class="form">
  23. <?php if ($block->canEditShippingMethod()): ?>
  24. <?php if ($groups = $block->getShippingRateGroups()): ?>
  25. <?php $currentRate = $block->getCurrentShippingRate(); ?>
  26. <div class="field shipping required">
  27. <select name="shipping_method" id="shipping-method" class="select">
  28. <?php if (!$currentRate): ?>
  29. <option value=""><?= $block->escapeHtml(__(
  30. 'Please select a shipping method...'
  31. )); ?></option>
  32. <?php endif; ?>
  33. <?php foreach ($groups as $code => $rates): ?>
  34. <optgroup label="<?= $block->escapeHtml($block->getCarrierName(
  35. $code
  36. )); ?>">
  37. <?php foreach ($rates as $rate): ?>
  38. <option value="<?= $block->escapeHtml(
  39. $block->renderShippingRateValue($rate)
  40. ); ?>"
  41. <?= ($currentRate === $rate) ?
  42. ' selected="selected"' : '';
  43. ?>>
  44. <?php /* @noEscape */ echo
  45. $block->renderShippingRateOption($rate);
  46. ?>
  47. </option>
  48. <?php endforeach; ?>
  49. </optgroup>
  50. <?php endforeach; ?>
  51. </select>
  52. </div>
  53. <div class="actions-toolbar">
  54. <div class="primary">
  55. <button id="update-shipping-method-submit" type="submit"
  56. class="action update primary">
  57. <span>
  58. <?= $block->escapeHtml(__('Update Shipping Method')) ?>
  59. </span>
  60. </button>
  61. </div>
  62. </div>
  63. <?php else: ?>
  64. <p>
  65. <?= $block->escapeHtml(__(
  66. 'Sorry, no quotes are available for this order right now.'
  67. )); ?>
  68. </p>
  69. <?php endif; ?>
  70. <?php else: ?>
  71. <p>
  72. <?php /* @noEscape */ echo $block->renderShippingRateOption(
  73. $block->getCurrentShippingRate()
  74. ); ?>
  75. </p>
  76. <?php endif; ?>
  77. </form>
  78. </div>
  79. </div>
  80. <div class="box box-order-shipping-address">
  81. <strong class="box-title">
  82. <span><?= $block->escapeHtml(__('Shipping Address')) ?></span>
  83. </strong>
  84. <div class="box-content">
  85. <address>
  86. <?= $block->escapeHtml(
  87. $block->renderAddress($block->getShippingAddress()),
  88. ['br']
  89. );?>
  90. </address>
  91. </div>
  92. <?php if ($block->getCanEditShippingAddress()): ?>
  93. <div class="box-actions">
  94. <a href="<?= $block->escapeUrl($block->getEditUrl()) ?>" class="action edit">
  95. <span><?= $block->escapeHtml(__('Edit')) ?></span>
  96. </a>
  97. </div>
  98. <?php endif; ?>
  99. </div>
  100. <?php endif; ?>
  101. <div class="box box-order-billing-address">
  102. <strong class="box-title"><span><?= $block->escapeHtml(__('Payment Method')) ?></span></strong>
  103. <div class="box-content">
  104. <?= $block->escapeHtml($block->getPaymentMethodTitle()) ?><br>
  105. <?= $block->escapeHtml($block->getEmail()) ?> <br>
  106. <img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png"
  107. alt="<?= $block->escapeHtml(__('Buy now with PayPal')) ?>"/>
  108. </div>
  109. <?php if ($block->getEditUrl()): ?>
  110. <div class="box-actions">
  111. <a href="<?= $block->escapeUrl($block->getEditUrl()) ?>" class="action edit">
  112. <span><?= $block->escapeHtml(__('Edit Payment Information')) ?></span>
  113. </a>
  114. </div>
  115. <?php endif ?>
  116. </div>
  117. </div>
  118. </div>
  119. <div class="paypal-review-discount">
  120. <?= $block->getChildHtml('paypal.additional.actions') ?>
  121. </div>
  122. <div class="paypal-review-items">
  123. <div class="paypal-review-title">
  124. <strong><?= $block->escapeHtml(__('Items in Your Shopping Cart')) ?></strong>
  125. <a href="<?= $block->escapeUrl($block->getUrl('checkout/cart')) ?>" class="action edit">
  126. <span><?= $block->escapeHtml(__('Edit Shopping Cart')) ?></span>
  127. </a>
  128. </div>
  129. <?= $block->getChildHtml('details') ?>
  130. <form method="post" id="order-review-form" action="<?= $block->escapeUrl($block->getPlaceOrderUrl()) ?>"
  131. class="form order-review-form">
  132. <?= $block->getChildHtml('agreements') ?>
  133. <div class="actions-toolbar" id="review-buttons-container">
  134. <div class="primary">
  135. <button type="button" id="review-button" class="action checkout primary"
  136. value="<?= $block->escapeHtml(__('Place Order')) ?>">
  137. <span><?= $block->escapeHtml(__('Place Order')) ?></span>
  138. </button>
  139. <button type="button" id="review-submit" class="action checkout primary"
  140. value="<?= $block->escapeHtml(__('Place Order')) ?>">
  141. <span><?= $block->escapeHtml(__('Place Order')) ?></span>
  142. </button>
  143. </div>
  144. <span class="please-wait load indicator" id="review-please-wait" style="display: none;"
  145. data-text="<?= $block->escapeHtml(__('Submitting order information...')) ?>">
  146. <span><?= $block->escapeHtml(__('Submitting order information...')) ?></span>
  147. </span>
  148. </div>
  149. </form>
  150. </div>
  151. </div>
  152. <script type="text/x-magento-init">
  153. {
  154. "#order-review-form": {
  155. "validation": {},
  156. "orderReview": {
  157. "shippingSubmitFormSelector": "#shipping-method-form",
  158. "shippingSelector": "#shipping-method",
  159. "shippingMethodUpdateUrl": "<?= $block->escapeUrl($block->getUpdateShippingMethodsUrl()) ?>",
  160. "isAjax": <?= /* @noEscape */ $block->getUseAjax() ? 'true' : 'false' ?>,
  161. "canEditShippingMethod": <?= /* @noEscape */ $block->canEditShippingMethod() ? 'true' : 'false' ?>
  162. }
  163. }
  164. }
  165. </script>