I'm working on a module which imports orders from an external system; the code is working and orders are being created, but are appearing under the wrong Store View.
Our installation uses only a single Website, Group, and Store View: "Main Website > Main Website Store > Default Store View", and so I was surprised to see orders being imported under "Admin > Default > Admin", with an Order Number / Increment Id which doesn't align with our other orders.
How do I assign the Store View to an Order which is programatically created?
After reviewing and comparing several code samples, would it be as simple as initializing the
The current code is simply:
...would the effect of omitting
setStoreId() be that the quote, order, and invoice are assigned to the "Admin" store view rather than the "Default Store View"?