Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipping & Payment not displayed on Cart Checkout when user logged-in #7672

Closed
dimitrovv opened this issue Dec 3, 2016 · 8 comments
Closed

Comments

@dimitrovv
Copy link

dimitrovv commented Dec 3, 2016

I have come across a problem related to the Cart Checkout.
If you go to Checkout using the link Proceed to Checkout in checkout/cart then
Shipping & Payment Tab are not displays due to a JS Error.

Preconditions

Magento 2.1.x

I am having this problem on the following Web Server Configuration

  • Ubuntu 16.04.1 LTS
    • Apache 2.4.18
    • PHP 7.0.13
    • MySQL 5.7.16

I have also reproduced this issue on a OSX using PHP 5.6 & MySQL 5.7, so I think it is not related to a separate Server Configuration.

Steps to reproduce

  1. Create account @ Magento FrontSite
  2. Add your Shipping Address & set Billing Address to be the same as Shipping Address
  3. Select a Country, which does not have created Regions, so that the State field is not a DropDown.
  4. Logout from Magento FrontSite
  5. Login again using the previous account you created
  6. Add a non-virtual Product (Item that has weight) to Cart
  7. Click View and edit cart on Mini Cart on navigate manually to checkout/cart
  8. Click Proceed to Checkout, then the Shipping & Payment Tabs are displayed
  9. Then go back to the Cart again using the link View and edit cart on Mini Cart
  10. Navigate again to Checkout using the link Proceed to Checkout, then the Shipping & Payment Tabs are not displayed and JS Error (TypeError: value is undefined) occurs instead.

Expected result

  1. The Checkout page should be loaded correctly displaying the User Shipping Address and the available Shipping Methods.
    screen shot 2016-12-05 at 1 36 35 pm

Actual result

The Checkout Page breaks and no Shipping & Payment Tab is displayed.
screenshot from 2016-12-03 21-56-44

Additional Information

I tried to debug it to see what the problem could be.
A JS Error Type Error is generated in the following line of the vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js file

checkoutProvider.set(
    'shippingAddress',
    $.extend({}, checkoutProvider.get('shippingAddress'), shippingAddressData)
);
registry.async('checkoutProvider')(function (checkoutProvider) {
    var shippingAddressData = checkoutData.getShippingAddressFromData();

    if (shippingAddressData) {
        checkoutProvider.set(
            'shippingAddress',
            $.extend({}, checkoutProvider.get('shippingAddress'), shippingAddressData)
        );
    }
    checkoutProvider.on('shippingAddress', function (shippingAddressData) {
        checkoutData.setShippingAddressFromData(shippingAddressData);
    });
});

When shippingAddressData is null the Checkout Page is displayed correctly.
The same problem occurs when trying to restore the quote after unsuccessful payment using
the method restoreQuote of class \Magento\Checkout\Model\Session.

Note: This problem occurs only when you are doing a checkout not as a quest. If I do a guest checkout, everything works as expected.

@Tristan-N
Copy link

@dimitrovv I have the same issue. But the issue ONLY occurs with customer account migrated from magento 1.9. I do not have the problems with newly created accounts.

@dimitrovv
Copy link
Author

Hi all,

@Tristan-N
I have updated the Steps to Reproduce.
The Problem occurs when Billing & Shipping Information are the same and you have chosen a Country, which does not have configured Regions.

@Tristan-N
Copy link

@dimitrovv

Hi, thank your for your update.

We have been messing around a bit to figure out what happened and noticed that in the table customer_entity almost some customers had a value of 1 in the column created_in in our development environment.

We looked into the production site and saw the correct name everywhere. We changed the name for the store in created_in to 1, tried to order something and it worked. But, we couldn't order a second time. The same issue appeared again. We went back to the database, changed the value back to the actual store name and we where able to order again. But once again we couldn't order a second time.

We are not sure what the reason is yet, but we noticed that by changing this value in using mysql something is happening which makes us able to order successfully at least once.

Thank you for your update. We may be getting a step further with this information. I hope you can use our info as well.

@dimitrovv
Copy link
Author

@Tristan-N

Hi, thanks for submitting this information.

All looks good In my database, the value of created_in is set properly to Default Store View and it also works if I reset it to 1. I was able to process more than one order.

Thanks!

@Tristan-N
Copy link

Tristan-N commented Dec 5, 2016

@dimitrovv

Great to hear it works for you know. What's the value you had when when you where able to process more then one order?

Did you migrate some customers from a Magento 1 store or did you create entire new accounts?

@dimitrovv
Copy link
Author

@Tristan-N

The default value was Default Store View, but It was ok, when changing to 1.
I haven't done a migration from Magento 1.x.
It is a completely new Magento 2.1.1 Installation.

Greetings!

@Sil-B
Copy link

Sil-B commented Dec 5, 2016

@dimitrovv This fixed it for us: Setting Stores > Configuration > Customer > Customer Configuration > Name and Address Options: Number of Lines in a Street Address make it 1. #4921

@dimitrovv
Copy link
Author

dimitrovv commented Dec 5, 2016

@Sil-B

Thanks a lot for the hint. It works for me!
Sorry for submitting a known Issue, I have searched for an existing Issue, but I could not locate one.

I am closing this one!

Thanks for helping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants