magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.55k stars 9.32k forks source link

Checkout error "Current customer does not have an active cart." and dont go to checkout success page #33188

Closed daniloab closed 3 years ago

daniloab commented 3 years ago

Preconditions (*)

  1. Magento 2.4.2

Steps to reproduce (*)

Hi, I'm implementing a new payment method into Magento2.

I'm implementing using the AbstracMethod being extended into my PaymentModel.

As expect, I have a function called order. This function does the following:

The problem is on the last item: when the order function ends, it is expected that the customer is redirected to checkout success.

But, it is returning an error:

https://user-images.githubusercontent.com/19939822/121237045-02dd9a80-c86d-11eb-9d5d-a5fa2ef1ec1c.png

My PaymentModel Class: https://gist.github.com/daniloab/a7fe06297fac8ec135c084676c502332

Expected result (*)

  1. Expected that after the order is completed should redirect the user to the checkout success

Actual result (*)

  1. https://user-images.githubusercontent.com/19939822/121237045-02dd9a80-c86d-11eb-9d5d-a5fa2ef1ec1c.png

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 3 years ago

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

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


: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] commented 3 years ago

Hi @engcom-Echo. 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:

engcom-Echo commented 3 years ago

Hi @daniloab ,

Request you to kindly provide screenshots/snapshots of your implementation for custom payment method. Also , I would suggest to change your implementation as Magento\Payment\Model\Method\AbstractMethod has been deprecated, try to follow the new guidelines for custom payment method creation here at https://devdocs.magento.com/guides/v2.4/howdoi/checkout/checkout_payment.html .

Thanks

daniloab commented 3 years ago

My problem at really it was on the checkout success page. When trying to get there something broke and try to return to checkout

as the order have been already done, does not exist a customer cart active anymore

so, when checkout success break how is the best way to debug there?

more specific into phtml files. I cant found anything in the log files.

engcom-Echo commented 3 years ago

Hi @daniloab ,

It will be very difficult to debug without understanding the full implementation ,as per your comments it looks like the user is getting redirected to cart page after successful payment where in he should be redirected to checkout success page , this looks like a problem with checkout session I think it might be getting empty thats why core code is redirecting to cart page instead. I would suggest you to debug on the checkout session.

Also I would suggest to implement the payment method as per the docs https://devdocs.magento.com/guides/v2.4/howdoi/checkout/checkout_payment.html

Also it looks like more of an implementation issue rather than a bug. Please comment back if you get anything .

Thanks

daniloab commented 3 years ago

I guess we can close this one. The problem it was with the code from checkout success.

m2-assistant[bot] commented 3 years ago

Hi @engcom-Hotel. 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:

engcom-Hotel commented 3 years ago

Hi @daniloab ,

As per your last comment, we are closing this issue. Still if you are facing any issue, you can create new tickets.

r-martins commented 2 years ago

In my case this was caused by a module's event.xml file containing

<event name="customer_login">
    <observer name="loadCustomerQuote" disabled="true"/>
</event>
Collapse011 commented 2 years ago

Bom dia Ricardo como vai ? @r-martins

pelo admin conseguimos resolver esse problema ?

r-martins commented 2 years ago

@Collapse011 não sei. Meu caso foi bem específico de um módulo/erro meu mesmo. Não teria como fazer nada pelo admin.