Skip to content

Value array might need to be inside of an array #9

Description

@TipPro

/* You can also just supply a custom array of list filters you wish to apply */
$request->setFilters([
[
'name' => 'search',
'value' => [
'field' => 'code',
'operator' => 'EQ',
'value' => 'Foo'
]
],
[
'name' => 'search_AND',
'value' => [
'field' => 'price',
'operator' => 'GT',
'value' => 9.99
]
]
]);

I needed to filter orders based on a custom field so I used this example. I could not get it to work until I put the value array inside of an array. My assumption may be wrong, but my code below only worked when I added the array.

$request->setFilters([
            [
                'name' => 'search',
                'value' => [
                    [
                        'field' => 'CustomField_Values:customfields:' . OrderCustomFields::PENDING_CANCEL_CODE,
                        'operator' => 'EQ',
                        'value' => true
                    ]
                ]
            ]
]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions