inventory icon indicating copy to clipboard operation
inventory copied to clipboard

Error in Checkout when switching from Store-Pickup to Shipping

Open LyraGhost opened this issue 5 years ago • 2 comments

Preconditions (*)

  1. Magento 2.4.0 with sample data (clean installation)
  2. Inventory 1.2.0

Steps to reproduce (*)

  1. Create 1 or more new sources with Use as Pickup Location option enabled in it.
  2. Create new stock for default website using newly created sources
  3. Assign products to newly created sources and add inventory in it so it can be available for pickup.
  4. Enable In store Delivery shipping method from Store Config/Sales/Delivery Methods (and at least one other method)
  5. Login with account with at least one (1) default shipping address
  6. Add product to cart
  7. View cart, select In-Store Pickup in shipping estimate, and proceed to checkout
  8. Switch from Pick In Store to Shipping

Expected result (*)

  1. Default shipping address should be selected
  2. no errors in console
  3. able to proceed to payment step

Actual result (*)

  1. Error in console
rules.js:69 Uncaught TypeError: Cannot read property 'length' of null
    at Object.handler (rules.js:69)
    at validate (validator.js:44)
    at validator.js:84
    at Function._.every._.all (underscore.js:237)
    at validator (validator.js:82)
    at UiClass.validate (abstract.js:406)
    at UiClass.onUpdate (abstract.js:431)
    at Function.notifySubscribers (knockout.js:1320)
    at Function.valueHasMutated (knockout.js:1538)
    at UiClass.observable [as value] (knockout.js:1504)
    ...
  1. unable to proceed to payment step

Notes

~~My initial guess is the error has to do with new address form, as the stack trace mentions validate and ui form/element/abstract.~~ Edit: It seems to be an issue with setting the shipping address when switching methods, as even trying to enter a new address:

  • add new address via popup (if it lets you)
  • switching to store pickup and switching back (even without having selected a store)

Overall the implementation here is very buggy and needs significant work to get it working.

Also, if you return to the shopping cart (regardless of method) and proceed to checkout again, only the sidebar loads and the same error is presented in the console. You need to log out and log back in to be able to load the checkout fully again.

LyraGhost avatar Oct 19 '20 21:10 LyraGhost

Hi @LyraGhost. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Oct 19 '20 21:10 m2-assistant[bot]

Hello, is there a solution for this error or workaround? I have the same problem, issue persists on login.

Uncaught TypeError: Cannot read property 'length' of null at Object.handler (rules.js:69) at validate (validator.js:44) at validator.js:84 at Function..every..all (underscore.js:237) at validator (validator.js:82) at UiClass.validate (abstract.js:406) at UiClass._super (wrapper.js:106) at UiClass.validate (setAdditionalParams.js:20) at UiClass.validate (wrapper.js:109) at UiClass.onUpdate (abstract.js:431)

i370w avatar Jun 18 '21 10:06 i370w