Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
sGetPaymentTranslation example
$repository
=
$this
->modelManager->
getRepository
(
Shop::
class
)
;
$shopId
=
is_numeric
(
$order
[
'language'
]
)
?
$order
[
'language'
]
:
$order
[
'subshopID'
]
;
// The (sub-)shop might be inactive by now, so that's why we use `getById` instead of `getActiveById`
$shop
=
$repository
->
getById
(
$shopId
)
;
if
(
$shop
=== null
)
{
throw
new
ModelNotFoundException
(
Shop::
class
,
$shopId
)
;
}
Shopware
(
)
->
Container
(
)
->
get
(
ShopRegistrationServiceInterface::
class
)
->
registerShop
(
$shop
)
;
$dispatch
=
Shopware
(
)
->
Modules
(
)
->
Admin
(
)
->
sGetDispatchTranslation
(
$dispatch
)
;
$payment
=
Shopware
(
)
->
Modules
(
)
->
Admin
(
)
->
sGetPaymentTranslation
(
[
'id' =>
$order
[
'paymentID'
]
]
)
;
$order
[
'status_description'
]
=
Shopware
(
)
->
Snippets
(
)
->
getNamespace
(
'backend/static/order_status'
)
->
get
(
$order
[
'status_name'
]
,
$order
[
'status_description'
]
)
;
$order
[
'cleared_description'
]
=
Shopware
(
)
->
Snippets
(
)
->
getNamespace
(
'backend/static/payment_status'
)
->
get
(
$order
[
'cleared_name'
]
,
$order
[
'cleared_description'
]
)
;
if
(
!
empty
(
$payment
[
'description'
]
)
)
{