0

I have a plugin from the shipping company that is not working good at this moment. On the moment that I click on place order, it is doing a redirect loop. I am using standard checkout.

#0 /web/generated/code/Magento/Checkout/Model/Session/Interceptor.php(63): Magento\Checkout\Model\Session->getQuote()
#1 /web/app/code/Zitec/Dpd/Model/Shipping/Carrier/Dpd.php(165): Magento\Checkout\Model\Session\Interceptor->getQuote()
#2 /web/vendor/magento/module-shipping/Model/Shipping.php(337): Zitec\Dpd\Model\Shipping\Carrier\Dpd->collectRates(Object(Magento\Quote\Model\Quote\Address\RateRequest))
#3 /web/vendor/magento/module-shipping/Model/Shipping.php(259): Magento\Shipping\Model\Shipping->collectCarrierRates('zitecDpd', Object(Magento\Quote\Model\Quote\Address\RateRequest))
#4 /web/vendor/magento/module-quote/Model/Quote/Address.php(1026): Magento\Shipping\Model\Shipping->collectRates(Object(Magento\Quote\Model\Quote\Address\RateRequest))
#5 /web/vendor/magento/module-quote/Model/Quote/Address.php(960): Magento\Quote\Model\Quote\Address->requestShippingRates()
#6 /web/vendor/magento/module-quote/Model/Quote/Address/Total/Shipping.php(84): Magento\Quote\Model\Quote\Address->collectShippingRates()
#7 /web/vendor/magento/module-quote/Model/Quote/TotalsCollector.php(274): Magento\Quote\Model\Quote\Address\Total\Shipping->collect(Object(Magento\Quote\Model\Quote\Interceptor), Object(Magento\Quote\Model\ShippingAssignment), Object(Magento\Quote\Model\Quote\Address\Total))
#8 /web/vendor/magento/module-quote/Model/Quote/TotalsCollector.php(148): Magento\Quote\Model\Quote\TotalsCollector->collectAddressTotals(Object(Magento\Quote\Model\Quote\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#9 /web/vendor/magento/module-quote/Model/Quote.php(1995): Magento\Quote\Model\Quote\TotalsCollector->collect(Object(Magento\Quote\Model\Quote\Interceptor))
#10 /web/generated/code/Magento/Quote/Model/Quote/Interceptor.php(1064): Magento\Quote\Model\Quote->collectTotals()
#11 /web/vendor/magento/module-checkout/Model/Session.php(278): Magento\Quote\Model\Quote\Interceptor->collectTotals()
#12 /web/generated/code/Magento/Checkout/Model/Session/Interceptor.php(63): Magento\Checkout\Model\Session->getQuote()
#13 /web/vendor/magento/module-checkout/Model/Cart.php(221): Magento\Checkout\Model\Session\Interceptor->getQuote()
#14 /web/generated/code/Magento/Checkout/Model/Cart/Interceptor.php(76): Magento\Checkout\Model\Cart->getQuote()
#15 /web/app/code/Zitec/Dpd/Model/Observer/TotalsCheckout.php(63): Magento\Checkout\Model\Cart\Interceptor->getQuote()
#16 /web/vendor/magento/framework/Event/Invoker/InvokerDefault.php(88): Zitec\Dpd\Model\Observer\TotalsCheckout->execute(Object(Magento\Framework\Event\Observer))
#17 /web/vendor/magento/framework/Event/Invoker/InvokerDefault.php(74): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Zitec\Dpd\Model\Observer\TotalsCheckout), Object(Magento\Framework\Event\Observer))
#18 /web/generated/code/Magento/Framework/Event/Invoker/InvokerDefault/Interceptor.php(24): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
#19 /web/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault\Interceptor->dispatch(Array, Object(Magento\Framework\Event\Observer))
#20 /web/generated/code/Magento/Framework/Event/Manager/Interceptor.php(24): Magento\Framework\Event\Manager->dispatch('sales_quote_pay...', Array)
#21 /web/generated/code/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager\Interceptor->dispatch('sales_quote_pay...', Array)
#22 /web/vendor/magento/module-quote/Model/Quote/Payment.php(176): Magento\Framework\Event\Manager\Proxy->dispatch('sales_quote_pay...', Array)
#23 /web/generated/code/Magento/Quote/Model/Quote/Payment/Interceptor.php(50): Magento\Quote\Model\Quote\Payment->importData(Object(Magento\Framework\DataObject))
#24 /web/vendor/magento/module-quote/Model/PaymentMethodManagement.php(79): Magento\Quote\Model\Quote\Payment\Interceptor->importData(Array)
#25 /web/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Quote\Model\PaymentMethodManagement->set('98079', Object(Magento\Quote\Model\Quote\Payment\Interceptor))
#26 /web/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Quote\Model\PaymentMethodManagement\Interceptor->___callParent('set', Array)
#27 /web/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Quote\Model\PaymentMethodManagement\Interceptor->Magento\Framework\Interception\{closure}('98079', Object(Magento\Quote\Model\Quote\Payment\Interceptor))
#28 /web/generated/code/Magento/Quote/Model/PaymentMethodManagement/Interceptor.php(26): Magento\Quote\Model\PaymentMethodManagement\Interceptor->___callPlugins('set', Array, Array)
#29 /web/vendor/magento/module-quote/Model/GuestCart/GuestPaymentMethodManagement.php(49): Magento\Quote\Model\PaymentMethodManagement\Interceptor->set('98079', Object(Magento\Quote\Model\Quote\Payment\Interceptor))
#30 /web/vendor/magento/module-checkout/Model/GuestPaymentInformationManagement.php(156): Magento\Quote\Model\GuestCart\GuestPaymentMethodManagement->set('ihTmd3TaJbYUD8W...', Object(Magento\Quote\Model\Quote\Payment\Interceptor))
#31 /web/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Checkout\Model\GuestPaymentInformationManagement->savePaymentInformation('ihTmd3TaJbYUD8W...', 'andrei.popescu@...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#32 /web/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callParent('savePaymentInfo...', Array)
#33 /web/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->Magento\Framework\Interception\{closure}('ihTmd3TaJbYUD8W...', 'andrei.popescu@...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#34 /web/generated/code/Magento/Checkout/Model/GuestPaymentInformationManagement/Interceptor.php(39): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callPlugins('savePaymentInfo...', Array, Array)
#35 /web/vendor/magento/module-checkout/Model/GuestPaymentInformationManagement.php(107): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->savePaymentInformation('ihTmd3TaJbYUD8W...', 'andrei.popescu@...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#36 /web/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Checkout\Model\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder('ihTmd3TaJbYUD8W...', 'andrei.popescu@...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#37 /web/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callParent('savePaymentInfo...', Array)
#38 /web/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->Magento\Framework\Interception\{closure}('ihTmd3TaJbYUD8W...', 'andrei.popescu@...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#39 /web/generated/code/Magento/Checkout/Model/GuestPaymentInformationManagement/Interceptor.php(26): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callPlugins('savePaymentInfo...', Array, Array)
#40 [internal function]: Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->savePaymentInformationAndPlaceOrder('ihTmd3TaJbYUD8W...', 'andrei.popescu@...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#41 /web/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)
#42 /web/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))
#43 /web/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#44 /web/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)
#45 /web/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#46 /web/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(26): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)
#47 /web/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#48 /web/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#49 /web/vendor/magento/framework/App/Bootstrap.php(261): Magento\Framework\App\Http\Interceptor->launch()
#50 /web/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#51 {main}

can someone please help me understand where I have to look and fix?

1
  • You should include which version of Magento you are using.
    – Olivier
    Commented Jun 1, 2020 at 13:35

1 Answer 1

0

The function Session->getQuote() gets called in a loop,

The problem starts with app/code/Zitec/Dpd/Model/Observer/TotalsCheckout.php(63), which calls Session->getQuote(). This triggers a recalculation of totals, which eventually calls Session->getQuote() again at app/code/Zitec/Dpd/Model/Shipping/Carrier/Dpd.php(165)

One way to fix this is to set the totalsCollectedFlag to false before calling getQuote(), so as to avoid this call: #11 /web/vendor/magento/module-checkout/Model/Session.php(278): Magento\Quote\Model\Quote\Interceptor->collectTotals() 

1
  • Thank you! Based on the feedback from you I've manage to fix it.
    – andy1786
    Commented Jun 6, 2020 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.