Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="Checkout-step" data-bind="visible: canVisibleBlock()">
- ...
- </div>
- define(
- [
- 'jquery',
- 'ko',
- 'Magento_Checkout/js/model/quote',
- 'uiComponent',
- ],
- function ($, ko, quote, Component) {
- 'use strict';
- var show_hide_custom_blockConfig = window.checkoutConfig.show_hide_custom_block;
- return Component.extend({
- defaults: {
- template: 'Module_Name/checkout/shipping/additional-block'
- },
- canVisibleBlock: function () {
- if (show_hide_custom_blockConfig) { // returns true when enabled in admin
- if (quote.isVirtual()) {
- return true;
- }
- }
- return false;
- }
- });
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement