return $this->
renderStorefront('@Storefront/storefront/page/account/profile/index.html.twig',
[ 'page' =>
$page,
'passwordFormViolation' =>
$request->
get('passwordFormViolation'
),
'emailFormViolation' =>
$request->
get('emailFormViolation'
),
]);
} #[Route(path: '/account/profile', name: 'frontend.account.profile.save', defaults: ['_loginRequired' => true], methods: ['POST'])]
public function saveProfile(RequestDataBag
$data, SalesChannelContext
$context, CustomerEntity
$customer): Response
{ try { $this->changeCustomerProfileRoute->
change($data,
$context,
$customer);
$this->
addFlash(self::SUCCESS,
$this->
trans('account.profileUpdateSuccess'
));
} catch (ConstraintViolationException
$formViolations) { return $this->
forwardToRoute('frontend.account.profile.page',
['formViolations' =>
$formViolations]);
} catch (\Exception
$exception) { $this->logger->
error($exception->
getMessage(),
['e' =>
$exception]);
$this->
addFlash(self::DANGER,
$this->
trans('error.message-default'
));
} return $this->
redirectToRoute('frontend.account.profile.page'
);
}