1

I'm frequently getting this" No such entity with cartId =xxxxx " When I try to edit order by set order status to another status or assign order to customer. I've taken a look at the database and there is no row in "quote" with an entity_id of cartid that shows on the browser. I guess for some reason when I edit order, it try to retrive order quote id then when it is not found, gave me that error. I know some quotes deleted from quote table by magento cron every 30 days. Please How do I fix this?

2 Answers 2

0

I'd try to find this error in server error logs or Magento error logs (this may need your webserver to be setting up differently if you don't log the errors currently).

Once the error is found, you will see a trail for this error and it will become easy to pinpoint the module that is giving you this error.

Once you know the module. You may add a try/catch block to go around the error if the module is in app/code. Otherwise, you might create a plugin/preference to implement this try/catch but not compromising your code file.

5
  • Thank you @Herve. I couldn't find any error logs
    – mido
    Sep 21, 2020 at 18:46
  • Finally it fixed by Magento certified
    – mido
    Sep 26, 2020 at 10:34
  • Can you please share what you did to fix the issue?
    – Indian
    Oct 30, 2020 at 17:02
  • my answer is just a set of steps to follow to find your issue, there is no code as this issue can be triggered by different causes Oct 30, 2020 at 17:06
  • Yes in the best of worlds that would work, in this case there is no error logging and this issue has been known since many years without a fix
    – cjohansson
    Oct 20, 2022 at 11:55
0

in \vendor\magento\module-quote\Model\QuoteRepository.php

add this

public function get($cartId, array $sharedStoreIds = [])
{
 
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $extensionUser = $objectManager->get('Magento\Backend\Model\Auth\Session')->isLoggedIn();
     if($extensionUser){
            if($cartId){
                $cartitemp = $cartId; 
            }
            else{
                $cartId = $cartitemp;
             
            }
    }
    if (!isset($this->quotesById[$cartId])) {
        $quote = $this->loadQuote('loadByIdWithoutStore', 'cartId', $cartId, $sharedStoreIds);
        $this->getLoadHandler()->load($quote);
        $this->quotesById[$cartId] = $quote;
    }
    return $this->quotesById[$cartId];
}

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.