Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Oct 28, 2018

Description (*)

I think we should remove check !quote.billingAddress() in file Magento/Checkout/view/frontend/web/js/model/shipping-save-processor/default.js

Due to this we are getting address which is selected first time.

Fixed Issues (if relevant)

  1. Unable to select payment method according to country of the address at checkout time #18907: Unable to select payment method according to country of the address at checkout time

Manual testing scenarios (*)

  1. Allow 2 payment methods from backend. like Bank Transfer and Purchase Order
  2. Allow Bank Transfer method only for United States.
  3. Allow Purchase Order method only for India
  4. In frontend, login with customer account.
  5. Add 2 address in customer account. one address with country India and other with country United States.
  6. Now add product in Cart.
  7. Go to Checkout page.
  8. Select address with country United States. payment methods will appear
  9. Now click on shipping section.
  10. Select address with country India

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Backport for #18909

@magento-engcom-team
Copy link
Contributor

Hi @rahulwebkul. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@ghost ghost requested a review from omiroshnichenko October 28, 2018 11:34
@VladimirZaets VladimirZaets self-assigned this Oct 28, 2018
@sidolov sidolov changed the title fixed - Unable to select payment method according to country of the address at checkout time [Backport] fixed - Unable to select payment method according to country of the address at checkout time Oct 29, 2018
@PrithweemaD
Copy link

I was facing the same issue in Magento 2.2.1. The basic issue is solved, but there is another issue, If I click on other addresses or input new shipping address, the payment methods are not reloading i.e. required for changing the available methods. Please help.

@ghost
Copy link
Author

ghost commented Oct 30, 2018

@PrithweemaD - I will look into the issue.

@magento-engcom-team magento-engcom-team added this to the Release: 2.2.8 milestone Oct 31, 2018
@magento-engcom-team
Copy link
Contributor

Hi @VladimirZaets, thank you for the review.
ENGCOM-3348 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

Hi @rahulwebkul. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

@luukschakenraad
Copy link
Contributor

@VladimirZaets @rahulwebkul This pull requests causes the billing address to be reset to the shipping address after every shipping information save.

In our case for example we build a store pick up function. After you select a store, we do a saveShippingInformation-call and set the address of the store as shipping address.

After this fix, every time we do this, the billing address of the customer is set to the shipping address of the store.

I think the original code is correct. You only want to set the billing address to be the same as the shipping address if no billing address is set. If a billing address is set, it should not change to be the same as the shipping address.

@VladimirZaets I would suggest to revert this change.
@rahulwebkul I would suggest to find another solution for your issue.

@vovayatsyuk
Copy link
Member

Agree with @luukschakenraad.

It's not convenient for customers in current implementation. Take a look at how it's looks like in 2.2.8 (the only Magento version with this patch):

  1. Fill shipping info
  2. Fill different billing address
  3. Return to the shipping info step, don't change anything. Just press "Continue".
  4. Billing address is equal will shipping 🙅‍♂️

I think the correct way of this PR is something like this (didn't test it, though):

if ((!quote.billingAddress() ||
        quote.billingAddress().isAddressSameAsShipping()) && 
    quote.shippingAddress().canUseForBilling()) {

    selectBillingAddressAction(quote.shippingAddress());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants