notices.phtml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <?php
  9. /**
  10. * @var $block \Magento\Theme\Block\Html\Notices
  11. */
  12. ?>
  13. <?php if ($block->displayNoscriptNotice()): ?>
  14. <noscript>
  15. <div class="message global noscript">
  16. <div class="content">
  17. <p>
  18. <strong><?= /* @escapeNotVerified */ __('JavaScript seems to be disabled in your browser.') ?></strong>
  19. <span><?= /* @escapeNotVerified */ __('For the best experience on our site, be sure to turn on Javascript in your browser.') ?></span>
  20. </p>
  21. </div>
  22. </div>
  23. </noscript>
  24. <?php endif; ?>
  25. <?php if ($block->displayNoLocalStorageNotice()): ?>
  26. <div class="notice global site local_storage" style="display: none;">
  27. <div class="content">
  28. <p>
  29. <strong><?= /* @escapeNotVerified */ __('Local Storage seems to be disabled in your browser.') ?></strong><br />
  30. <?= /* @escapeNotVerified */ __('For the best experience on our site, be sure to turn on Local Storage in your browser.') ?>
  31. </p>
  32. </div>
  33. </div>
  34. <script>
  35. require(['jquery'], function(jQuery){
  36. // <![CDATA[
  37. (function($) {
  38. var test = 'test';
  39. try {
  40. localStorage.setItem(test, test);
  41. localStorage.removeItem(test);
  42. } catch(e) {
  43. $(".notice.global.site.local_storage").show();
  44. }
  45. })(jQuery);
  46. // ]]>
  47. });
  48. </script>
  49. <?php endif; ?>
  50. <?php if ($block->displayDemoNotice()): ?>
  51. <div class="message global demo">
  52. <div class="content">
  53. <p><?= /* @escapeNotVerified */ __('This is a demo store. No orders will be fulfilled.') ?></p>
  54. </div>
  55. </div>
  56. <?php endif; ?>