1

I'm trying to custom the checkout of Magento 2 by hiding specific customer addresses on checkout.

Everything is working fine except for the file "magento/web/vendor/magento/module-checkout/view/frontend/web/js/model/shipping-save-processor/default.js", I would like from this file to access the customer address list defined in shipping-address/list.js but I do not understand how can I do it ?

I tried the code below but I have the error : Uncaught TypeError: billingAddress.getCacheKey is not a function

var customerData = window.customerData;
var shippingAddress = quote.shippingAddress();

customerData.addresses.forEach(function (address) {
   if(shippingAddress['customerId'] == address['customer_id'] && address['default_billing'] == true) {
       selectBillingAddressAction(address);
   }
});

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.