Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setVoteAverage example
if
(
isset
(
$graduatedPrices
[
$number
]
)
)
{
$product
->
setPriceRules
(
$graduatedPrices
[
$number
]
)
;
}
if
(
isset
(
$cheapestPrices
[
$number
]
)
)
{
$product
->
setCheapestPriceRule
(
$cheapestPrices
[
$number
]
)
;
}
if
(
isset
(
$voteAverages
[
$number
]
)
)
{
$product
->
setVoteAverage
(
$voteAverages
[
$number
]
)
;
}
if
(
isset
(
$categories
[
$number
]
)
)
{
$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
)
)
;
$product
->
setPriceRules
(
$listProduct
->
getPriceRules
(
)
)
;
$product
->
setCheapestPriceRule
(
$listProduct
->
getCheapestPriceRule
(
)
)
;
$product
->
setManufacturerNumber
(
$listProduct
->
getManufacturerNumber
(
)
)
;
$product
->
setMetaTitle
(
$listProduct
->
getMetaTitle
(
)
)
;
$product
->
setTemplate
(
$listProduct
->
getTemplate
(
)
)
;
$product
->
setHasConfigurator
(
$listProduct
->
hasConfigurator
(
)
)
;
$product
->
setSales
(
$listProduct
->
getSales
(
)
)
;
$product
->
setHasEsd
(
$listProduct
->
hasEsd
(
)
)
;
$product
->
setEsd
(
$listProduct
->
getEsd
(
)
)
;
$product
->
setIsPriceGroupActive
(
$listProduct
->
isPriceGroupActive
(
)
)
;
$product
->
setBlockedCustomerGroupIds
(
$listProduct
->
getBlockedCustomerGroupIds
(
)
)
;
$product
->
setVoteAverage
(
$listProduct
->
getVoteAverage
(
)
)
;
$product
->
setHasAvailableVariant
(
$listProduct
->
hasAvailableVariant
(
)
)
;
$product
->
setCheapestUnitPrice
(
$listProduct
->
getCheapestUnitPrice
(
)
)
;
$product
->
setFallbackPriceCount
(
$listProduct
->
getFallbackPriceCount
(
)
)
;
$product
->
setCustomerPriceCount
(
$listProduct
->
getCustomerPriceCount
(
)
)
;
foreach
(
$listProduct
->
getAttributes
(
)
as
$name
=>
$attribute
)
{
$product
->
addAttribute
(
$name
,
$attribute
)
;
}
foreach
(
$listProduct
->
getStates
(
)
as
$state
)
{
$product
->
addState
(
$state
)
;
}
$product
->
setHasStock
(
$product
->
getStock
(
)
>=
$product
->
getUnit
(
)
->
getMinPurchase
(
)
)
;
if
(
$variantFacet
&&
$variantConfiguration
)
{
$this
->
addVariantSearchDetails
(
$product
,
$configurations
,
$variantFacet
,
$variantConfiguration
,
$combinations
,
$listingPrices
,
$availability
)
;
}
elseif
(
!
$product
->
isMainVariant
(
)
)
{
continue
;
}
elseif
(
!
$listProduct
->
isAvailable
(
)
)
{
$product
->
setHasAvailableVariant
(
false
)
;
}
if
(
isset
(
$average
[
$number
]
)
)
{
$product
->
setVoteAverage
(
$average
[
$number
]
)
;
}
if
(
isset
(
$calculated
[
$number
]
)
)
{
$product
->
setCalculatedPrices
(
$calculated
[
$number
]
)
;
}
if
(
isset
(
$categories
[
$id
]
)
)
{
$product
->
setCategoryIds
(
$categories
[
$id
]
)
;
}
if
(
isset
(
$properties
[
$id
]
)
)
{
$product
->
setProperties
(
$properties
[
$id
]
)
;
}