diff --git a/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl index d0969a9d86aa1..89bfcc8a85bf0 100644 --- a/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -593,7 +593,8 @@ {if ($customer->isGuest())} {l s='This order has been placed by a guest.' d='Admin.Orderscustomers.Feature'} {if (!Customer::customerExists($customer->email))} -
+

{l s='This feature will generate a random password and send an email to the customer.' d='Admin.Orderscustomers.Help'}

diff --git a/src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php b/src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php index 7177bf55b3447..8fe62c6c28aff 100644 --- a/src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php +++ b/src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php @@ -311,10 +311,11 @@ public function setPrivateNoteAction($customerId, Request $request) * ) * * @param int $customerId + * @param Request $request * * @return RedirectResponse */ - public function transformGuestToCustomerAction($customerId) + public function transformGuestToCustomerAction($customerId, Request $request) { try { $this->getCommandBus()->handle(new TransformGuestToCustomerCommand((int) $customerId)); @@ -324,6 +325,15 @@ public function transformGuestToCustomerAction($customerId) $this->addFlash('error', $this->getErrorMessageForException($e, $this->getErrorMessages($e))); } + if ($request->query->get('id_order')) { + $legacyLink = $this->getAdminLink('AdminOrders', [ + 'id_order' => $request->query->get('id_order'), + 'vieworder' => true, + ]); + + return $this->redirect($legacyLink); + } + return $this->redirectToRoute('admin_customers_view', [ 'customerId' => $customerId, ]);