magento2: Uncaught ReferenceError: Unable to process binding "if: function(){return (addressOptions.length > 1) }" Message: addressOptions is not defined
Preconditions (*) Magento CE 2.3.2, PHP 7.1.30, Ubuntu 18.04, MariaDb 14.14, Magento caching enabled
Steps to reproduce install Magento 2.3.2 add any product to cart proceed to checkout enter login details click to Next check to Free Shipping and then click to next in the checkout payment page error occurs
Expected result (*) Checkout Payment successfully with no errors
Actual result (*) There is data-bind error - knockout.js:3391 Uncaught ReferenceError: Unable to process binding “if: function(){return (addressOptions.length > 1) }”
Message: addressOptions is not defined. Message: addressOptions is not defined at if (eval at createBindingsStringEvaluator (knockout.js:2992), <anonymous>:3:55) at ko.computed.disposeWhenNodeIsRemoved (knockout.js:4391) at Function.evaluateImmediate_CallReadThenEndDependencyDetection (knockout.js:2183) at Function.evaluateImmediate_CallReadWithDependencyDetection (knockout.js:2150) at Function.evaluateImmediate (knockout.js:2111) at Object.ko.computed.ko.dependentObservable (knockout.js:1964) at init (knockout.js:4390) at knockout.js:3368 at Object.ignore (knockout.js:1480) at knockout.js:3367
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 29 (3 by maintainers)
It’s seems the problem is with template difference 2.3.1 with 2.3.2 If you rewrote the template vendor/magento/module-checkout/view/frontend/web/template/billing-address.html in your theme for magento 2.3.1, you can not see that this template is changed a lot in 2.3.2. In old version (2.3.1) the template Magento_Checkout/billing-address/list inserted directly in billing-address.html, but in 2.3.2 it is renders via “getRegion(‘billing-address-list’)” with ui component. So just make shure that billing-address.html in your theme is corresponded to billing-address.html in vendor
@celorodovalho I have fixed this issue by editing magento core file in
vendordir atvendor/magento/module-checkout/Block/Checkout/LayoutProcessor.phpYou can see the change in my Git diff here: https://gist.github.com/hmphu/b752d3f1c401fd862bf5ee0552507322
Please try and share your result here if this work
Just delete: From: vendor/magento/module-checkout/Block/Checkout/LayoutProcessor.php Around Line 160
After upgrading to 2.3.3, I also had same issue:
Updating template: \app\design\frontend\THEME\PACKAGE\Magento_Checkout\web\template\billing-address.html from: \vendor\magento\module-checkout\view\frontend\web\template\billing-address.html worked for me.
This fix really works!