Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getPseudoPrice example
$prices
[
]
=
$firstGraduation
;
}
foreach
(
$discounts
as
$discount
)
{
$rule
=
clone
$reference
;
$percent
=
(
100 -
$discount
->
getPercent
(
)
)
/ 100;
$price
=
$reference
->
getPrice
(
)
*
$percent
;
$pseudo
=
$reference
->
getPseudoPrice
(
)
;
$rule
->
setPrice
(
$price
)
;
$rule
->
setPseudoPrice
(
$pseudo
)
;
$rule
->
setFrom
(
$discount
->
getQuantity
(
)
)
;
$rule
->
setCustomerGroup
(
$customerGroup
)
;
$rule
->
setTo
(
null
)
;
if
(
$previous
)
{
PriceRule
$priceRule
,
ShopContextInterface
$context
)
: Price
{
if
(
$priceRule
->
getUnit
(
)
instanceof Unit
)
{
$priceRule
->
setPrice
(
$priceRule
->
getUnit
(
)
->
getMinPurchase
(
)
*
$priceRule
->
getPrice
(
)
)
;
$priceRule
->
getUnit
(
)
->
setPurchaseUnit
(
$priceRule
->
getUnit
(
)
->
getMinPurchase
(
)
*
$priceRule
->
getUnit
(
)
->
getPurchaseUnit
(
)
)
;
$priceRule
->
setPseudoPrice
(
$priceRule
->
getUnit
(
)
->
getMinPurchase
(
)
*
$priceRule
->
getPseudoPrice
(
)
)
;
$priceRule
->
setRegulationPrice
(
$priceRule
->
getUnit
(
)
->
getMinPurchase
(
)
*
$priceRule
->
getRegulationPrice
(
)
)
;
}
$tax
=
$context
->
getTaxRule
(
$product
->
getTax
(
)
->
getId
(
)
)
;
if
(
!
$tax
instanceof Tax
)
{
throw
new
StructNotFoundException
(
Tax::
class
,
$product
->
getTax
(
)
->
getId
(
)
)
;
}