3

Is it possible to access variable addressConverter from custom js file.

Filename: Magento_Checkout/js/action/create-shipping-address.js

/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
/*global define*/
define(
    [
        'Magento_Customer/js/model/address-list',
        'Magento_Checkout/js/model/address-converter'
    ],
    function(addressList, addressConverter) {
        "use strict";
        return function(addressData) {
            var address = addressConverter.formAddressDataToQuoteAddress(addressData);
            var isAddressUpdated = addressList().some(function(currentAddress, index, addresses) {
                if (currentAddress.getKey() == address.getKey()) {
                    addresses[index] = address;
                    return true;
                }
                return false;
            });
            if (!isAddressUpdated) {
                addressList.push(address);
            } else {
                addressList.valueHasMutated();
            }
            return address;
        };
    }
);

I am trying to add custom temporary shipping address, If customer selects temporary shipping address then store pickup shipping method will display.

If customer selects any other shipping address then other shipping methods will display except store pickup method.

Can any one help how to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.