Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setMinStock example
if
(
$data
[
'__product_changetime'
]
)
{
$product
->
setUpdatedAt
(
new
DateTime
(
$data
[
'__product_changetime'
]
)
)
;
}
$product
->
setAdditional
(
$data
[
'__variant_additionaltext'
]
)
;
$product
->
setEan
(
$data
[
'__variant_ean'
]
)
;
$product
->
setHeight
(
(float)
$data
[
'__variant_height'
]
)
;
$product
->
setLength
(
(float)
$data
[
'__variant_length'
]
)
;
$product
->
setMinStock
(
(int)
$data
[
'__variant_stockmin'
]
)
;
$product
->
setWeight
(
(float)
$data
[
'__variant_weight'
]
)
;
$product
->
setWidth
(
(float)
$data
[
'__variant_width'
]
)
;
$customerGroups
=
explode
(
'|',
$data
[
'__product_blocked_customer_groups'
]
?? ''
)
;
$customerGroups
=
array_filter
(
$customerGroups
)
;
$product
->
setBlockedCustomerGroupIds
(
$customerGroups
)
;
$product
->
setHasAvailableVariant
(
$data
[
'__product_has_available_variants'
]
> 0
)
;
$product
->
setFallbackPriceCount
(
$data
[
'__product_fallback_price_count'
]
)
;
if
(
\
array_key_exists
(
'__product_custom_price_count',
$data
)
)
{
$product
->
setCustomerPriceCount
(
$data
[
'__product_custom_price_count'
]
)
;
}
$product
->
setManufacturer
(
$listProduct
->
getManufacturer
(
)
)
;
$product
->
setCover
(
$listProduct
->
getCover
(
)
)
;
$product
->
setCheapestPrice
(
$listProduct
->
getCheapestPrice
(
)
)
;
$product
->
setName
(
$listProduct
->
getName
(
)
)
;
$product
->
setAdditional
(
$listProduct
->
getAdditional
(
)
)
;
$product
->
setCloseouts
(
$listProduct
->
isCloseouts
(
)
)
;
$product
->
setEan
(
$listProduct
->
getEan
(
)
)
;
$product
->
setHeight
(
$listProduct
->
getHeight
(
)
)
;
$product
->
setKeywords
(
$listProduct
->
getKeywords
(
)
)
;
$product
->
setLength
(
$listProduct
->
getLength
(
)
)
;
$product
->
setLongDescription
(
$listProduct
->
getLongDescription
(
)
)
;
$product
->
setMinStock
(
$listProduct
->
getMinStock
(
)
)
;
$product
->
setReleaseDate
(
$listProduct
->
getReleaseDate
(
)
)
;
$product
->
setShippingTime
(
$listProduct
->
getShippingTime
(
)
)
;
$product
->
setShortDescription
(
$listProduct
->
getShortDescription
(
)
)
;
$product
->
setStock
(
$listProduct
->
getStock
(
)
)
;
$product
->
setWeight
(
$listProduct
->
getWeight
(
)
)
;
$product
->
setWidth
(
$listProduct
->
getWidth
(
)
)
;
$product
->
setPriceGroup
(
$listProduct
->
getPriceGroup
(
)
)
;
$product
->
setCreatedAt
(
$listProduct
->
getCreatedAt
(
)
)
;
$product
->
setUpdatedAt
(
$listProduct
->
getUpdatedAt
(
)
)
;
$product
->
setPriceRules
(
$listProduct
->
getPriceRules
(
)
)
;
$product
->
setCheapestPriceRule
(
$listProduct
->
getCheapestPriceRule
(
)
)
;