Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alexpoletaev opened this issue Jan 31, 2017 · 3 comments
Closed

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

alexpoletaev opened this issue Jan 31, 2017 · 3 comments
Assignees

Comments

@alexpoletaev
Copy link

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.

@wsagen wsagen self-assigned this Feb 1, 2017
@wsagen
Copy link
Contributor

wsagen commented Feb 1, 2017

Thanks for raising - this is clearly a Magento core issue but we are reviewing to see if we can implement a work around

@vkalchenko
Copy link

Hi, we have exactly the same issue with Multi-website and admin orders for non-default store. As a workaround, I think passing store_id of the order should be more less safe...
See pull request #20

@wsagen
Copy link
Contributor

wsagen commented Mar 3, 2017

Thanks for your contribution. We appreciate the pull request, our internal process means that changes are not pushed directly to this repository. However we've implemented your pull request in full @vkalchenko and have credited you in the code.
Latest release includes this fix so I am closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants