1

I have a custom module for checkout part, I just need to know how to modify some elements and for begin I am trying to place the Billing Address part on another side after shipping details.

I have that: checkout_index_index.xml

................
<item name="custom-billing" xsi:type="array">
    <item name="component" xsi:type="string">Custom_Module/js/view/billing-address</item>
    <item name="displayArea" xsi:type="string">custom-billing</item>
</item>
<item name="before-shipping-method-form" xsi:type="array">
     <item name="component" xsi:type="string">uiComponent</item>
     <item name="displayArea" xsi:type="string">before-shipping-method-form</item>
     <item name="children" xsi:type="array">
         <!-- address-list-additional-addresses -->
     </item>
</item>
...............

And inside web/templates/shipping.html

<div class="col-md-12">
<!-- ko foreach: getRegion('custom-billing') -->
    <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
</div>

The component something want to display but it gives a js error:

 Uncaught TypeError: Unable to process binding "attr: function (){return {id:'billing-address-same-as-shipping-'+ $parent.getCode()} }"
Message: $parent.getCode is not a function
at attr (eval at createBindingsStringEvaluator (knockout.js:2624),     <anonymous>:3:214)
at update (knockout.js:3659)
at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3004)
at evaluateImmediate (knockout.js:1737)
at Object.ko.computed.ko.dependentObservable (knockout.js:1946)
at knockout.js:3002
at Object.arrayForEach (knockout.js:151)
at applyBindingsToNodeInternal (knockout.js:2974)
at applyBindingsToNodeAndDescendantsInternal (knockout.js:2854)
at applyBindingsToDescendantsInternal (knockout.js:2836)

So Message: $parent.getCode is not a function, but I am stuck with this.

Anyone tried that?

1
  • Does this issue still persists? Jun 6, 2017 at 7:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.