Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setCustomerGroupId example
$invalidSalesChannelId
= Uuid::
randomHex
(
)
;
$paymentMethodId
= Uuid::
randomHex
(
)
;
$customerGroupId
= Uuid::
randomHex
(
)
;
$shippingMethodId
= Uuid::
randomHex
(
)
;
$currencyId
= Uuid::
randomHex
(
)
;
$countryStateId
= Uuid::
randomHex
(
)
;
$countryId
= Uuid::
randomHex
(
)
;
$salesChannelEntity
=
new
SalesChannelEntity
(
)
;
$salesChannelEntity
->
setUniqueIdentifier
(
TestDefaults::SALES_CHANNEL
)
;
$salesChannelEntity
->
setCustomerGroupId
(
$customerGroupId
)
;
$salesChannelEntity
->
setPaymentMethodId
(
$paymentMethodId
)
;
$salesChannelEntity
->
setShippingMethodId
(
$shippingMethodId
)
;
$currency
=
new
CurrencyEntity
(
)
;
$rounding
=
new
CashRoundingConfig
(
1, 1, true
)
;
$currency
->
setUniqueIdentifier
(
$currencyId
)
;
$currency
->
setTotalRounding
(
$rounding
)
;
$currency
->
setItemRounding
(
$rounding
)
;
$currency
->
setId
(
$currencyId
)
;
$currency
->
setFactor
(
1
)
;