Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getStorefrontSalesChannelId example
$contextToken
= Uuid::
randomHex
(
)
;
$this
->contextPersister->
save
(
$contextToken
,
[
SalesChannelContextService::CURRENCY_ID =>
$productExport
->
getCurrencyId
(
)
,
]
,
$productExport
->
getSalesChannelId
(
)
)
;
$context
=
$this
->salesChannelContextService->
get
(
new
SalesChannelContextServiceParameters
(
$productExport
->
getStorefrontSalesChannelId
(
)
,
$contextToken
,
$productExport
->
getSalesChannelDomain
(
)
->
getLanguageId
(
)
,
$productExport
->
getCurrencyId
(
)
)
)
;
$this
->translator->
injectSettings
(
$productExport
->
getStorefrontSalesChannelId
(
)
,
$productExport
->
getSalesChannelDomain
(
)
->
getLanguageId
(
)
,
$this
->languageLocaleProvider->
getLocaleForLanguageId
(
$productExport
->
getSalesChannelDomain
(
)
->
getLanguageId
(
)
)
,
$context
->
getContext
(
)
)
;
$contextToken
= Uuid::
randomHex
(
)
;
$this
->contextPersister->
save
(
$contextToken
,
[
SalesChannelContextService::CURRENCY_ID =>
$productExport
->
getCurrencyId
(
)
,
]
,
$productExport
->
getSalesChannelId
(
)
)
;
$context
=
$this
->salesChannelContextService->
get
(
new
SalesChannelContextServiceParameters
(
$productExport
->
getStorefrontSalesChannelId
(
)
,
$contextToken
,
$productExport
->
getSalesChannelDomain
(
)
->
getLanguageId
(
)
,
$productExport
->
getSalesChannelDomain
(
)
->
getCurrencyId
(
)
??
$productExport
->
getCurrencyId
(
)
)
)
;
$this
->translator->
injectSettings
(
$productExport
->
getStorefrontSalesChannelId
(
)
,
$productExport
->
getSalesChannelDomain
(
)
->
getLanguageId
(
)
,
$this
->languageLocaleProvider->
getLocaleForLanguageId
(
$productExport
->
getSalesChannelDomain
(
)
->
getLanguageId
(
)
)
,
$context
->
getContext
(
)
)
;