Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,27 @@ define([
*/
applyBillingAddress: function () {
var shippingAddress;
var isBillingAddressInitialized;

if (quote.billingAddress()) {
selectBillingAddress(quote.billingAddress());

return;
}
shippingAddress = quote.shippingAddress();

if (shippingAddress &&
if(quote.isVirtual()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @LucasCalazans,
Please add space between ifand (.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @williankeller, thanks for your review, I've just added this alteration.

isBillingAddressInitialized = addressList.some(function (addrs) {
if (addrs.isDefaultBilling()) {
selectBillingAddress(addrs);
return true;
}
return false;
});
}

shippingAddress = quote.shippingAddress();
if (!isBillingAddressInitialized &&
shippingAddress &&
shippingAddress.canUseForBilling() &&
(shippingAddress.isDefaultShipping() || !quote.isVirtual())
) {
Expand Down