Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
formatPrice example
'product' =>
$product
,
]
)
;
}
/** * @return array */
public
function
convertProductPriceStruct
(
Price
$price
)
{
$data
=
$this
->
convertPriceStruct
(
$price
)
;
$data
[
'pseudopricePercent'
]
= null;
$data
[
'price'
]
=
$this
->
formatPrice
(
$price
->
getCalculatedPrice
(
)
)
;
$data
[
'pseudoprice'
]
=
$this
->
formatPrice
(
$price
->
getCalculatedPseudoPrice
(
)
)
;
$data
[
'referenceprice'
]
=
$this
->
formatPrice
(
$price
->
getCalculatedReferencePrice
(
)
)
;
$data
[
'has_pseudoprice'
]
=
$price
->
getCalculatedPseudoPrice
(
)
>
$price
->
getCalculatedPrice
(
)
;
$data
[
'price_numeric'
]
=
$price
->
getCalculatedPrice
(
)
;
$data
[
'pseudoprice_numeric'
]
=
$price
->
getCalculatedPseudoPrice
(
)
;
$data
[
'price_attributes'
]
=
$price
->
getAttributes
(
)
;
$data
[
'pricegroup'
]
=
$price
->
getCustomerGroup
(
)
->
getKey
(
)
;
$data
[
'regulationPrice'
]
=
$price
->
getCalculatedRegulationPrice
(
)
;
if
(
$price
->
getCalculatedPseudoPrice
(
)
)
{
$discount
= 0;