Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
filterRulePrices example
$prices
=
$product
->
get
(
'prices'
)
;
$product
->
assign
(
[
'calculatedPrices' =>
new
CalculatedPriceCollection
(
)
]
)
;
if
(
$prices
=== null
)
{
return
;
}
if
(
!
$prices
instanceof ProductPriceCollection
)
{
return
;
}
$prices
=
$this
->
filterRulePrices
(
$prices
,
$context
)
;
if
(
$prices
=== null
)
{
return
;
}
$prices
->
sortByQuantity
(
)
;
$reference
= ReferencePriceDto::
createFromEntity
(
$product
)
;
$calculated
=
new
CalculatedPriceCollection
(
)
;
foreach
(
$prices
as
$price
)
{
$quantity
=
$price
->
getQuantityEnd
(
)
??
$price
->
getQuantityStart
(
)
;