QuestionQ32

VerifiedOrders, Payments, Shipping, and Tax

Since the most recent production deployment, customers have been unable to complete checkout. The error logs repeatedly show this message:

Question Image

The Architect identifies a deployed feature intended to limit delivery for certain postcodes. The Architect finds the following deployed code in etc/webapi_rest/di.xml and etc/frontend/di.xml:

Question Image

LimitRates.php:

Question Image

Which action should the Architect take to resolve the issue?

Explanation

Calling Magento\Checkout\Model\Session::getQuote() from a plugin that runs while shipping rates are being collected can re-enter quote/totals and shipping-rate collection, causing an infinite loop. Retrieve the existing quote directly through Magento\Quote\Api\CartRepositoryInterface with the session quote ID instead, so the interceptor does not invoke the checkout session’s quote-loading flow. Commerce uses a quote to determine shipping costs, and its quote APIs operate on a quote identified by its cart/quote ID.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!