Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
sGetDispatchTranslation 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'
]
)
;
$dispatch
=
$this
->db->
fetchRow
(
$sql
,
[
$dispatchID
]
)
;
if
(
$dispatch
=== false
)
{
return
false;
}
return
$this
->
sGetDispatchTranslation
(
$dispatch
)
;
}
/** * Get dispatch methods * * @param int $countryID Country id * @param int $paymentID Payment mean id * @param int $stateId Country state id * * @return array<int, array<string, mixed>> Shipping methods data, indexed by ID */