Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getShippingFree example
$mainData
=
[
]
;
if
(
$mapping
[
'settings'
]
)
{
$mainData
[
'supplierNumber'
]
=
$mainDetail
->
getSupplierNumber
(
)
;
$mainData
[
'weight'
]
=
$mainDetail
->
getWeight
(
)
;
$mainData
[
'stockMin'
]
=
$mainDetail
->
getStockMin
(
)
;
$mainData
[
'ean'
]
=
$mainDetail
->
getEan
(
)
;
$mainData
[
'minPurchase'
]
=
$mainDetail
->
getMinPurchase
(
)
;
$mainData
[
'purchaseSteps'
]
=
$mainDetail
->
getPurchaseSteps
(
)
;
$mainData
[
'maxPurchase'
]
=
$mainDetail
->
getMaxPurchase
(
)
;
$mainData
[
'releaseDate'
]
=
$mainDetail
->
getReleaseDate
(
)
;
$mainData
[
'shippingTime'
]
=
$mainDetail
->
getShippingTime
(
)
;
$mainData
[
'shippingFree'
]
=
$mainDetail
->
getShippingFree
(
)
;
$mainData
[
'width'
]
=
$mainDetail
->
getWidth
(
)
;
$mainData
[
'height'
]
=
$mainDetail
->
getHeight
(
)
;
$mainData
[
'len'
]
=
$mainDetail
->
getLen
(
)
;
$mainData
[
'lastStock'
]
=
$mainDetail
->
getLastStock
(
)
;
}
if
(
$mapping
[
'stock'
]
)
{
$mainData
[
'inStock'
]
=
$mainDetail
->
getInStock
(
)
;
}
if
(
$mapping
[
'attributes'
]
)
{
$builder
=
$this
->
get
(
'models'
)
->
createQueryBuilder
(
)
;
$mainData
[
'attribute'
]
=
$builder
->
select
(
[
'attributes'
]
)
$weight
=
$product
->
getWeight
(
)
;
$lineItem
->
setStates
(
$product
->
getStates
(
)
)
;
if
(
$lineItem
->
hasState
(
State::IS_PHYSICAL
)
)
{
$lineItem
->
setDeliveryInformation
(
new
DeliveryInformation
(
(int)
$product
->
getAvailableStock
(
)
,
$weight
,
$product
->
getShippingFree
(
)
=== true,
$product
->
getRestockTime
(
)
,
$deliveryTime
,
$product
->
getHeight
(
)
,
$product
->
getWidth
(
)
,
$product
->
getLength
(
)
)
)
;
}
// Check if the price has to be updated
if
(
$this
->
shouldPriceBeRecalculated
(
$lineItem
,
$behavior
)
)
{