Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isAttributeInRequest example
$params
=
$request
->
getParams
(
)
;
return
\
array_key_exists
(
'sSearch',
$params
)
;
}
private
function
handleProductAttributeFacet
(
Request
$request
,
Criteria
$criteria
,
ProductAttributeFacet
$facet
)
{
if
(
!
$this
->
isAttributeInRequest
(
$facet
,
$request
)
)
{
return
;
}
$data
=
$request
->
getParam
(
$facet
->
getFormFieldName
(
)
)
;
switch
(
$facet
->
getMode
(
)
)
{
case
ProductAttributeFacet::MODE_BOOLEAN_RESULT:
$criteria
->
addCondition
(
new
ProductAttributeCondition
(
$facet
->
getField
(
)
,
ProductAttributeCondition::OPERATOR_NOT_IN,
[
false
]
)