Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addWidgets example
$shopService
->
updateConfig
(
$shop
)
;
$currencyService
=
new
CurrencyService
(
$conn
)
;
$currencyService
->
updateCurrency
(
$shop
)
;
$localeService
=
new
LocaleSettingsService
(
$conn
,
$container
)
;
$localeService
->
updateLocaleSettings
(
$shop
->locale
)
;
if
(
!
$input
->
getOption
(
'skip-admin-creation'
)
)
{
$adminService
=
new
AdminService
(
$conn
)
;
$adminService
->
createAdmin
(
$adminUser
)
;
$adminService
->
addWidgets
(
$adminUser
)
;
}
$this
->
activateResponsiveTheme
(
)
;
if
(
$this
->IOHelper->
isInteractive
(
)
)
{
$this
->IOHelper->
cls
(
)
;
$this
->IOHelper->
writeln
(
'<info>=== License Information ===</info>'
)
;
/** @var LicenseUnpackService $licenseService */
$licenseService
=
$container
->
offsetGet
(
'license.service'
)
;
$locale
=
$_SESSION
[
'parameters'
]
[
'c_config_shop_language'
]
?: 'de_DE';
$shopService
=
new
ShopService
(
$db
,
$container
[
'uniqueid.generator'
]
)
;
$currencyService
=
new
CurrencyService
(
$db
)
;
$adminService
=
new
AdminService
(
$db
)
;
$localeSettingsService
=
new
LocaleSettingsService
(
$db
,
$container
)
;
$hasErrors
= false;
try
{
$adminService
->
createAdmin
(
$adminUser
)
;
$adminService
->
addWidgets
(
$adminUser
)
;
$shopService
->
updateShop
(
$shop
)
;
$currencyService
->
updateCurrency
(
$shop
)
;
$shopService
->
updateConfig
(
$shop
)
;
$localeSettingsService
->
updateLocaleSettings
(
$locale
)
;
}
catch
(
\Exception
$e
)
{
$hasErrors
= true;
$app
->
view
(
)
->
setData
(
'error',
$e
->
getMessage
(
)
)
;
}
if
(
!
$hasErrors
)
{
$app
->
redirect
(
$app
->
urlFor
(
'finalize'
)
)
;
}