Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
shouldForwardToRegister example
public
function
init
(
)
{
$this
->admin =
Shopware
(
)
->
Modules
(
)
->
Admin
(
)
;
$this
->customerService =
Shopware
(
)
->
Container
(
)
->
get
(
CustomerServiceInterface::
class
)
;
}
public
function
preDispatch
(
)
{
$this
->
View
(
)
->
setScope
(
Smarty::SCOPE_PARENT
)
;
if
(
$this
->
shouldForwardToRegister
(
)
)
{
$this
->
forward
(
'index', 'register', 'frontend',
$this
->
getForwardParameters
(
)
)
;
return
;
}
$customerData
=
$this
->admin->
sGetUserData
(
)
;
if
(
!\
is_array
(
$customerData
)
)
{
$this
->
forward
(
'index', 'register', 'frontend',
$this
->
getForwardParameters
(
)
)
;
return
;
}