Skip to content

Multi-website: Exception: No such entity with cartId = ... #19

Closed
@alexpoletaev

Description

@alexpoletaev

Preconditions

  1. Multi-website Magento instance

Steps to reproduce

  1. Create an order from the admin panel, but NOT for the default store

Expected result

  1. An order placed successfully

Actual result

  1. The No such entity with cartId = ... error occurs

Possible fix

Find this method \ShipperHQ\Shipper\Observer\RecordAdminOrder::execute() and set the current store before recording the order (do not forget to inject the StoreManagerInterface to the constructor):

public function execute(EventObserver $observer)
    {
        if ($this->shipperDataHelper->getConfigValue('carriers/shipper/active')) {
            $order = $observer->getEvent()->getData('order');
            $this->storeManager->setCurrentStore($order->getStoreId());
            if($order->getIncrementId()) {
                $this->recordOrder($order);
            }
        }
    }

Look at this magento/magento2#6522 core bug for more info.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions