Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. define(
  2. [
  3. 'jquery',
  4. 'ko',
  5. 'Magento_Customer/js/model/customer',
  6. 'Magento_Checkout/js/view/shipping'
  7. ],
  8. function(
  9. $,
  10. ko,
  11. customer,
  12. Component
  13. ) {
  14. 'use strict';
  15. return Component.extend({
  16. defaults: {
  17. template: 'Prince_CheckoutStep/shipping',
  18. },
  19. visible: function(){
  20. if(!customer.isLoggedIn())
  21. {
  22. ko.observable(false);
  23. }
  24. else
  25. {
  26. ko.observable(true);
  27. }
  28. },
  29.  
  30. initialize: function () {
  31. var self = this;
  32. this._super();
  33. }
  34. });
  35. }
  36. );
  37.  
  38. <li id="shipping" class="checkout-shipping-address" data-bind="fadeVisible: visible">
  39. <div class="step-title" data-bind="i18n: 'Shipping Address'" data-role="title"></div>
  40. <div id="checkout-step-shipping"
  41. class="step-content"
  42. data-role="content">
  43.  
  44. <!-- ko if: (!quoteIsVirtual) -->
  45. <!-- ko foreach: getRegion('customer-email') -->
  46. <!-- ko template: getTemplate() --><!-- /ko -->
  47. <!--/ko-->
  48. <!--/ko-->
  49.  
  50. <!-- ko foreach: getRegion('address-list') -->
  51. <!-- ko template: getTemplate() --><!-- /ko -->
  52. <!--/ko-->
  53.  
  54. <!-- ko foreach: getRegion('address-list-additional-addresses') -->
  55. <!-- ko template: getTemplate() --><!-- /ko -->
  56. <!--/ko-->
  57.  
  58. <!-- Address form pop up -->
  59. <!-- ko if: (!isFormInline) -->
  60. <button type="button"
  61. data-bind="click: showFormPopUp, visible: !isNewAddressAdded()"
  62. class="action action-show-popup">
  63. <span data-bind="i18n: 'New Address'"></span></button>
  64. <div id="opc-new-shipping-address" data-bind="visible: isFormPopUpVisible()">
  65. <!-- ko template: 'Magento_Checkout/shipping-address/form' --><!-- /ko -->
  66. </div>
  67. <!-- /ko -->
  68.  
  69. <!-- ko foreach: getRegion('before-form') -->
  70. <!-- ko template: getTemplate() --><!-- /ko -->
  71. <!--/ko-->
  72.  
  73. <!-- Inline address form -->
  74. <!-- ko if: (isFormInline) -->
  75. <!-- ko template: 'Magento_Checkout/shipping-address/form' --><!-- /ko -->
  76. <!-- /ko -->
  77. </div>
  78. </li>
  79.  
  80. if (!isCustomerLoggedIn){
  81. self.visible(false);
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement