Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define(
- [
- 'jquery',
- 'ko',
- 'Magento_Customer/js/model/customer',
- 'Magento_Checkout/js/view/shipping'
- ],
- function(
- $,
- ko,
- customer,
- Component
- ) {
- 'use strict';
- return Component.extend({
- defaults: {
- template: 'Prince_CheckoutStep/shipping',
- },
- visible: function(){
- if(!customer.isLoggedIn())
- {
- ko.observable(false);
- }
- else
- {
- ko.observable(true);
- }
- },
- initialize: function () {
- var self = this;
- this._super();
- }
- });
- }
- );
- <li id="shipping" class="checkout-shipping-address" data-bind="fadeVisible: visible">
- <div class="step-title" data-bind="i18n: 'Shipping Address'" data-role="title"></div>
- <div id="checkout-step-shipping"
- class="step-content"
- data-role="content">
- <!-- ko if: (!quoteIsVirtual) -->
- <!-- ko foreach: getRegion('customer-email') -->
- <!-- ko template: getTemplate() --><!-- /ko -->
- <!--/ko-->
- <!--/ko-->
- <!-- ko foreach: getRegion('address-list') -->
- <!-- ko template: getTemplate() --><!-- /ko -->
- <!--/ko-->
- <!-- ko foreach: getRegion('address-list-additional-addresses') -->
- <!-- ko template: getTemplate() --><!-- /ko -->
- <!--/ko-->
- <!-- Address form pop up -->
- <!-- ko if: (!isFormInline) -->
- <button type="button"
- data-bind="click: showFormPopUp, visible: !isNewAddressAdded()"
- class="action action-show-popup">
- <span data-bind="i18n: 'New Address'"></span></button>
- <div id="opc-new-shipping-address" data-bind="visible: isFormPopUpVisible()">
- <!-- ko template: 'Magento_Checkout/shipping-address/form' --><!-- /ko -->
- </div>
- <!-- /ko -->
- <!-- ko foreach: getRegion('before-form') -->
- <!-- ko template: getTemplate() --><!-- /ko -->
- <!--/ko-->
- <!-- Inline address form -->
- <!-- ko if: (isFormInline) -->
- <!-- ko template: 'Magento_Checkout/shipping-address/form' --><!-- /ko -->
- <!-- /ko -->
- </div>
- </li>
- if (!isCustomerLoggedIn){
- self.visible(false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement