shortcut.phtml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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\Shortcut $block
  9. */
  10. ?>
  11. <?php
  12. $labelPosition = '';
  13. if ($block->isOrPositionBefore()) {
  14. $labelPosition = ' before';
  15. } elseif ($block->isOrPositionAfter()) {
  16. $labelPosition = ' after';
  17. }
  18. $shortcutHtmlId = $block->escapeHtml($block->getShortcutHtmlId());
  19. $isInCatalogProduct = false;
  20. if ($block->getIsInCatalogProduct()) {
  21. $isInCatalogProduct = $block->getIsInCatalogProduct();
  22. }
  23. ?>
  24. <div data-label="<?= $block->escapeHtml(__('or')) ?>"
  25. class="paypal checkout <?= /* @noEscape */ $labelPosition ?> paypal-logo
  26. <?= /* @noEscape */ $shortcutHtmlId ?>"
  27. data-mage-init='{
  28. "paypalCheckout": {
  29. "isCatalogProduct": "<?= /* @noEscape */ !empty($isInCatalogProduct) ? (bool)$isInCatalogProduct : false ?>",
  30. "shortcutContainerClass": "<?= /* @noEscape */ "." . $shortcutHtmlId ?>"
  31. }
  32. }'
  33. >
  34. <input type="image" data-action="checkout-form-submit"
  35. data-checkout-url="<?= $block->escapeUrl($block->getCheckoutUrl()) ?>"
  36. src="<?= $block->escapeUrl($block->getImageUrl()) ?>"
  37. alt="<?= $block->escapeHtml(__('Checkout with PayPal')) ?>"
  38. title="<?= $block->escapeHtml(__('Checkout with PayPal')) ?>"/>
  39. <?php if ($block->getAdditionalLinkImage()): ?>
  40. <?php $linkImage = $block->getAdditionalLinkImage(); ?>
  41. <a href="<?= $block->escapeUrl($linkImage['href']) ?>">
  42. <img src="<?= $block->escapeHtml($linkImage['src']) ?>" />
  43. </a>
  44. <?php endif; ?>
  45. </div>