inventory icon indicating copy to clipboard operation
inventory copied to clipboard

"Quote does not have Pickup Location assigned." in Instant Purchase with Pickup Store

Open ghost opened this issue 4 years ago • 24 comments

Hello guys,

we developed a payment module with the Vault feature(https://github.com/dholidev/module-payu). Instant Purchase worked perfectly well with the other shipping methods, however, when using the new "Pickup Store" feature of Magento 2.4.0, it is not possible to finalize the purchase on the product page. We are getting the message "Quote does not have Pickup Location assigned.".

Looking at the documentation below, I found no restrictions to finalize the purchase using "Instant Purchase" with "Pickup Store".

  • https://docs.magento.com/user-guide/shipping/shipping-in-store-delivery.html

  • https://docs.magento.com/user-guide/sales/checkout-instant-purchase.html

  • https://devdocs.magento.com/guides/v2.4/payments-integrations/base-integration/integration-intro.html

  • https://devdocs.magento.com/guides/v2.4/payments-integrations/vault/vault-intro.html

Looking at the source code of the Magento\InventoryInStorePickupQuote\Model\Quote\ValidationRule\InStorePickupQuoteValidationRule file, line 116, the value returned from $address->getExtensionAttributes()->getPickupLocationCode() is empty.

As it is not the function of the Payment Method to set the value to "PickupLocationCode", I ask you if this is a bug in Magento 2.4.0 or a limitation like "Instant Purchase cannot be used with Braintree Credit Cards if 3D Secure is enabled. " found at this link https://docs.magento.com/user-guide/sales/checkout-instant-purchase.html.

You can reproduce the error with this product https://payu.dholi.dev/joust-duffle-bag.html, using the test cards from this link https://docs.dholi.dev/en/payu/sandbox.

Best Regards, Rodrigo

error InStorePickupQuoteValidationRule

ghost avatar Jan 30 '21 20:01 ghost

Hi @dholidev. Thank you for your report. To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

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

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


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Jan 30 '21 20:01 m2-assistant[bot]

Hi @engcom-Alfa. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Feb 01 '21 08:02 m2-assistant[bot]

Hi @dholidev .

Looks like this issue related to MSI functionality. @sdzhepa Could you move this ticket to the Inventory repository? Thanks!

engcom-Alfa avatar Feb 01 '21 12:02 engcom-Alfa

Hi @dholidev. 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 Feb 05 '21 22:02 m2-assistant[bot]

I have what appears to be the same problem.

Running Magento ver. 2.4.2 I am using MSI functionality

When I checkout using Pickup Instore option I get this error: Quote does not have pickup location defined. When I checkout using Paypal express and pickup instore I get this error: Quote does not have pickup location assigned.

Checked that the source is assigned correctly and pickup instore is active for that source and that there is stock for that source.

magneticeye avatar Apr 21 '21 03:04 magneticeye

@dholidev How are you dealing with this problem? Are you running an older version of magento? Or maybe an extension for custom shipping methods? Or have you just removed this functionality until it is fixed?

magneticeye avatar Apr 22 '21 05:04 magneticeye

@magneticeye all right. The customer uses Magento Commerce 2.4.2 and needs the "Pickup Store" feature.

The customer's option was to disable only the "Instant Purchase" on the product page and keep the feature of storing the credit card.

ghost avatar Apr 22 '21 16:04 ghost

@magento give me 2.4.3-p1 instance

zandreifurnica avatar Oct 04 '21 15:10 zandreifurnica

Hi @zandreifurnica. Thank you for your request. I'm working on Magento instance for you.

Hi @zandreifurnica, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

@magento give me 2.4.3-p1 instance

zandreifurnica avatar Oct 05 '21 06:10 zandreifurnica

Hi @zandreifurnica. Thank you for your request. I'm working on Magento instance for you.

Hi @zandreifurnica, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

Hello, any news related to this issue? We have similar problem.

main.CRITICAL: Placing an order with quote_id 3AxnMz1GsgP7B3RXdEjpcWBaCRbauow7 is failed: Quote does not have Pickup Location assigned. [] []

atomixstar avatar Oct 19 '21 23:10 atomixstar

Any updates here? This error also occurs in the latest 2.4.4

dbachmann avatar May 05 '22 15:05 dbachmann

@dbachmann I ended up getting an extension to cover this functionality, I couldn't wait for it to be fixed.

magneticeye avatar May 06 '22 01:05 magneticeye

@magneticeye What plugin did you get to help?

DylanBluescope avatar Jul 05 '22 10:07 DylanBluescope

still having the same problem, is there any solution ?

usud85 avatar Aug 08 '22 09:08 usud85

In our case (2.4.4), I found once the pickup location was set and the user pressed next, an AJAX request was sent to rest/default/V1/carts/mine/shipping-information with a JSON payload including the pickup_location_code. However there were two versions of the extension attributes element:

Screenshot 2022-09-28 at 15 43 16

I tracked with with a debugger and found that in various places it was using the empty "extension_attributes" variation, such as in vendor/magento/module-inventory-in-store-pickup-quote/Plugin/Quote/AddressCollection/GetPickupLocationInformationPlugin.php rather than the populated "extensionAttributes" one.

I can see that the "extensionAttributes" variation is used in JS here https://github.com/magento/inventory/blob/develop/InventoryInStorePickupFrontend/view/frontend/web/js/model/pickup-address-converter.js#L22 and here https://github.com/magento/inventory/blob/develop/InventoryInStorePickupFrontend/view/frontend/web/js/view/store-pickup.js#L293.

I'm not sure why it differs between the PHP and JS - perhaps some 3rd party module? I've overridden the two JS files above in our theme and changed the element name to "extension_attributes". For example:

return address.extension_attributes['pickup_location_code'];

This is working for us so far but I have more testing to do to figure out the cause.

craig-bartlett avatar Sep 28 '22 15:09 craig-bartlett

@craig-bartlett could you please be more specific about your solution? we are facing the same issue and I'm kind of stuck.

Thank you

rafaelcalero avatar Oct 14 '22 17:10 rafaelcalero

@rafaelcalero Hi, I copied the two JS files mentioned above (pickup-address-converter.js and store-pickup.js) into my theme. I then changed the references to "extensionAttributes" in them to "extension_attributes". I had to do the same with new-customer-address.js. I'm still unsure what brought this about as I have since been moved off this issue.

craig-bartlett avatar Oct 17 '22 09:10 craig-bartlett

In our case, it was a js from a 3rd party module that puts extension_attributes.additional_methods in the address, therefore we had the following information in the shipping-information AJAX call (rest/default/V1/carts/mine/shipping-information):

image

As @craig-bartlett said, in this case when Magento is going to validate the pickup address it does a shippingAddress->getExtensionAttributes(). If both exist in the JSON (extensionAttributes and extension_attributes), Magento will take extension_attributes and lose the extensionAttributes information.

Our solution was to search among the third-party modules for a .js containing "extension_attributes.additional_methods", override it and replace it with "extensionAttributes.additional_methods"

In our case, it is a problem with the third-party module, although a possible Magento solution would be to merge both elements in case both exist.

rafaelcalero avatar Oct 18 '22 09:10 rafaelcalero