Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
hasNetPrices example
$creditItemsCalculatedPrice
=
$creditItems
->
getPrices
(
)
->
sum
(
)
;
$totalPrice
=
$creditItemsCalculatedPrice
->
getTotalPrice
(
)
;
$taxAmount
=
$creditItemsCalculatedPrice
->
getCalculatedTaxes
(
)
->
getAmount
(
)
;
$taxes
=
$creditItemsCalculatedPrice
->
getCalculatedTaxes
(
)
;
foreach
(
$taxes
as
$tax
)
{
$tax
->
setTax
(
$tax
->
getTax
(
)
!== 0.0 ? -
$tax
->
getTax
(
)
: 0.0
)
;
}
if
(
$order
->
getPrice
(
)
->
hasNetPrices
(
)
)
{
$price
=
new
CartPrice
(
-
$totalPrice
,
-
(
$totalPrice
+
$taxAmount
)
,
-
$order
->
getPositionPrice
(
)
,
$taxes
,
$creditItemsCalculatedPrice
->
getTaxRules
(
)
,
$order
->
getTaxStatus
(
)
)
;
}
else
{
$price
=
new
CartPrice
(
-
(
$totalPrice
-
$taxAmount
)
,
-