I am having an issue where the box is being marked automatically. I want to unmark it.
1 Answer
Copy the following file to your theme:
vendor/magento/module-checkout/view/frontend/web/js/model/checkout-data-resolver.js
and comment out the lines like below:
applyBillingAddress: function () {
var shippingAddress;
if (quote.billingAddress()) {
selectBillingAddress(quote.billingAddress());
return;
}
shippingAddress = quote.shippingAddress();
// This comment is for uncheck the billing address on payment page
/*if (shippingAddress &&
shippingAddress.canUseForBilling() &&
(shippingAddress.isDefaultShipping() || !quote.isVirtual())
) {
selectBillingAddress(quote.shippingAddress());
}*/
}
And also copy the following file to your theme:
vendor/magento/module-checkout/view/frontend/web/js/model/shipping-save-processor/default.js
and comment out the lines like below:
saveShippingInformation: function () {
var payload;
// This comment is for uncheck the billing address on payment page
/*if (!quote.billingAddress()) {
selectBillingAddressAction(quote.shippingAddress());
}*/
payload = {
addressInformation: {
'shipping_address': quote.shippingAddress(),
'billing_address': quote.billingAddress(),
'shipping_method_code': quote.shippingMethod()['method_code'],
'shipping_carrier_code': quote.shippingMethod()['carrier_code']
}
};
payloadExtender(payload);
fullScreenLoader.startLoader();
return storage.post(
resourceUrlManager.getUrlForSetShippingInformation(quote),
JSON.stringify(payload)
).done(
function (response) {
quote.setTotals(response.totals);
paymentService.setPaymentMethods(methodConverter(response['payment_methods']));
fullScreenLoader.stopLoader();
}
).fail(
function (response) {
errorProcessor.process(response);
fullScreenLoader.stopLoader();
}
);
}
Don't forget to run static-content:deploy and cache flush.
-
-
-
Flush the cache. Delete the pub/static/front-end and then run static content deploy. It should work. Jul 12, 2018 at 17:18
-
-
Yes may be updated file is not generating. If not then try to update the same on vendor and check it in private browser. Jul 12, 2018 at 17:41