Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <div class="Checkout-step" data-bind="visible: canVisibleBlock()">
  2. ...
  3. </div>
  4.  
  5. define(
  6. [
  7. 'jquery',
  8. 'ko',
  9. 'Magento_Checkout/js/model/quote',
  10. 'uiComponent',
  11. ],
  12. function ($, ko, quote, Component) {
  13. 'use strict';
  14.  
  15. var show_hide_custom_blockConfig = window.checkoutConfig.show_hide_custom_block;
  16.  
  17. return Component.extend({
  18. defaults: {
  19. template: 'Module_Name/checkout/shipping/additional-block'
  20. },
  21. canVisibleBlock: function () {
  22. if (show_hide_custom_blockConfig) { // returns true when enabled in admin
  23. if (quote.isVirtual()) {
  24. return true;
  25. }
  26. }
  27.  
  28. return false;
  29. }
  30. });
  31. }
  32. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement