$pl->filterByAttribute() Troubleshooting

Permalink
Still using 5.6.3.2 - having a problem with the following code:

$pl->filterByAttribute('property_type', 'Commercial');


As you can see I've got a page attribute setup with handle "property_type" - it's a select attribute, with the option for users to add to the list.

I'm trying to just pull in the ones where "Commercial" is selected, and when this line above is added, no results are returned. I've tested the function with text field and a boolean field and it seems to be working fine there. Where am I going wrong?

WebSolutions
 
WebSolutions replied on at Permalink Best Answer Reply
WebSolutions
And the verdict is:

$pl->filterByAttribute('property_type', '%Commercial%', 'like');

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.