Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getIsSystemDefault example
foreach
(
$collection
->
getElements
(
)
as
$discount
)
{
$itemIds
=
$this
->
getAllLineItemIds
(
$cart
)
;
// add a new discount line item for this discount // if we have at least one valid item that will be discounted.
if
(
\
count
(
$itemIds
)
<= 0
)
{
continue
;
}
$factor
= 1.0;
if
(
!
$context
->
getCurrency
(
)
->
getIsSystemDefault
(
)
)
{
$factor
=
$context
->
getCurrency
(
)
->
getFactor
(
)
;
}
$discountItem
=
$this
->itemBuilder->
buildDiscountLineItem
(
$code
,
$promotion
,
$discount
,
$context
->
getCurrency
(
)
->
getId
(
)
,
$factor
)
;