$session->
clear();
$session->
migrate(true
);
Shopware()->
Session()->
offsetSet('sessionId',
$session->
getId());
Shopware()->
Container()->
set('sessionid',
$session->
getId());
Shopware()->
Session()->
set('Admin', true
);
Shopware()->
System()->_POST =
[ 'email' =>
$user['email'
],
'passwordMD5' =>
$user['password'
],
];
Shopware()->
Modules()->
Admin()->
sLogin(true
);
$hash =
$this->container->
get(OptinServiceInterface::
class)->
add(OptinServiceInterface::TYPE_CUSTOMER_LOGIN_FROM_BACKEND, 300,
[ 'sessionId' =>
Shopware()->
Session()->
get('sessionId'
),
'shopId' =>
$shop->
getId(),
]);
$url =
$this->
Front()->
ensureRouter()->
assemble([ 'action' => 'performOrderRedirect',
'hash' =>
$hash,
'fullPath' => true,
]);