Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setQuantityStart example
$priceEntity
=
new
ShippingMethodPriceEntity
(
)
;
$priceEntity
->
setUniqueIdentifier
(
Uuid::
randomHex
(
)
)
;
$priceEntity
->
setCurrencyPrice
(
new
PriceCollection
(
[
new
Price
(
Defaults::CURRENCY,
$price
,
$price
,
false
)
,
]
)
)
;
$priceEntity
->
setCalculation
(
DeliveryCalculator::CALCULATION_BY_LINE_ITEM_COUNT
)
;
$priceEntity
->
setQuantityStart
(
$quantityStart
)
;
$priceEntity
->
setQuantityEnd
(
$quantityStart
+ 5
)
;
$prices
->
add
(
$priceEntity
)
;
$quantityStart
+= 5;
}
$shippingMethod
->
setPrices
(
$prices
)
;
$context
=
$this
->
createMock
(
SalesChannelContext::
class
)
;
$baseContext
= Context::
createDefaultContext
(
)
;
$context
->
expects
(
static
::
atLeastOnce
(
)
)
->
method
(
'getContext'
)
->
willReturn
(
$baseContext
)
;