Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setShippingTotal example
private
function
handlePrices
(
OrderEntity
$order
)
: OrderEntity
{
foreach
(
$order
->
getLineItems
(
)
??
[
]
as
$lineItem
)
{
$lineItem
->
setUnitPrice
(
$lineItem
->
getUnitPrice
(
)
/ -1
)
;
$lineItem
->
setTotalPrice
(
$lineItem
->
getTotalPrice
(
)
/ -1
)
;
}
foreach
(
$order
->
getPrice
(
)
->
getCalculatedTaxes
(
)
->
sortByTax
(
)
->
getElements
(
)
as
$tax
)
{
$tax
->
setTax
(
$tax
->
getTax
(
)
/ -1
)
;
}
$order
->
setShippingTotal
(
$order
->
getShippingTotal
(
)
/ -1
)
;
$order
->
setAmountNet
(
$order
->
getAmountNet
(
)
/ -1
)
;
$order
->
setAmountTotal
(
$order
->
getAmountTotal
(
)
/ -1
)
;
return
$order
;
}
private
function
getNumber
(
Context
$context
, OrderEntity
$order
, DocumentGenerateOperation
$operation
)
: string
{
return
$this
->numberRangeValueGenerator->
getValue
(
'document_' . self::TYPE,
$context
,