Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getNewArticleData example
$shops
=
$this
->
getShopRepository
(
)
->
createQueryBuilder
(
'shops'
)
->
andWhere
(
'shops.active = 1'
)
->
getQuery
(
)
->
getArrayResult
(
)
;
$taxes
=
$this
->
getRepository
(
)
->
getTaxesQuery
(
)
->
getArrayResult
(
)
;
$templates
=
$this
->
getTemplates
(
)
;
$units
=
$this
->
getRepository
(
)
->
getUnitsQuery
(
)
->
getArrayResult
(
)
;
$customerGroups
=
$this
->
getCustomerRepository
(
)
->
getCustomerGroupsQuery
(
)
->
getArrayResult
(
)
;
$properties
=
$this
->
getRepository
(
)
->
getPropertiesQuery
(
)
->
getArrayResult
(
)
;
$configuratorGroups
=
$this
->
getRepository
(
)
->
getConfiguratorGroupsQuery
(
)
->
getArrayResult
(
)
;
if
(
!
empty
(
$id
)
)
{
$product
=
$this
->
getArticle
(
$id
)
;
}
else
{
$product
=
$this
->
getNewArticleData
(
)
;
}
$this
->
View
(
)
->
assign
(
[
'success' => true,
'data' =>
[
'shops' =>
$shops
,
'customerGroups' =>
$customerGroups
,
'taxes' =>
$taxes
,
'suppliers' =>
$suppliers
,
'templates' =>
$templates
,
'units' =>
$units
,