Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setComingSoon example
$attribute
->
setIsNew
(
false
)
;
if
(
$product
->
getCreatedAt
(
)
instanceof DateTimeInterface
)
{
$diff
=
$today
->
diff
(
$product
->
getCreatedAt
(
)
)
;
$marker
=
(int)
$this
->config->
get
(
'markAsNew'
)
;
$attribute
->
setIsNew
(
$diff
->days <=
$marker
||
$product
->
getCreatedAt
(
)
>
$today
)
;
}
$attribute
->
setComingSoon
(
$product
->
getReleaseDate
(
)
&&
$product
->
getReleaseDate
(
)
>
$today
)
;
$attribute
->
setIsTopSeller
(
$product
->
getSales
(
)
>=
$this
->config->
get
(
'markAsTopSeller'
)
)
;
return
$attribute
;
}
}