I'm using Magento 2.4.1 and I want to retrieve the current quote in collectRates function in my Carrier model, but sometimes it will prompt an infinite loop error like this:
this is how i retrieve the current quote in My Carrier Model
class Standard extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements
\Magento\Shipping\Model\Carrier\CarrierInterface
{
public function collectRates(RateRequest $request)
{
$quote = $this->checkoutSession->getQuote();
$subTotal = $quote->getData('subtotal_with_discount');
$ddate = $quote->getShippingDeliveryDate(); // this is a custom column i made in quote table
}
}
The reason to get quotes is that I need to retrieve the quote attribute value to do some calculation in the collect rates function