Replace hardcoded store ID = 1 with either input argument or detected default store ID.

Not working for me.

The order was created, right, but no quote object was assigned to it.