Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isProductValid example
$product
->
setCategories
(
$categories
[
$number
]
)
;
}
if
(
$product
->
getManufacturer
(
)
&&
isset
(
$manufacturerCovers
[
$product
->
getManufacturer
(
)
->
getCoverId
(
)
]
)
)
{
$product
->
getManufacturer
(
)
->
setCoverMedia
(
$manufacturerCovers
[
$product
->
getManufacturer
(
)
->
getCoverId
(
)
]
)
;
}
$product
->
addAttribute
(
'marketing',
$this
->marketingService->
getProductAttribute
(
$product
)
)
;
$this
->priceCalculationService->
calculateProduct
(
$product
,
$context
)
;
if
(
!
$this
->
isProductValid
(
$product
,
$context
)
)
{
continue
;
}
$product
->
setListingPrice
(
$product
->
getCheapestUnitPrice
(
)
)
;
$product
->
setDisplayFromPrice
(
\
count
(
$product
->
getPrices
(
)
)
> 1 ||
$product
->
hasDifferentPrices
(
)
)
;
$product
->
setAllowBuyInListing
(
$this
->
allowBuyInListing
(
$product
)
)
;
if
(
$this
->config->
get
(
'calculateCheapestPriceWithMinPurchase'
)
&&
$product
->
getCheapestPrice
(
)
instanceof Price
)
{
$product
->
setListingPrice
(
$product
->
getCheapestPrice
(
)
)
;
}
$result
[
$number
]
=
$product
;
}