We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46315
    • 30 Posts
    I'm looping through a custom table with a column name of "Category" with stored values that look like this: "category1||category2||category3||category4".

    I only want to return products that are assigned category1 and category3. This is how I setup the filter in the migxLoopCollection snippet call:

    [[!migxLoopCollection?
    &packageName=`products`
    &classname=`Products`
    &where=`{"forsale":"1",	"brand:IN":["Reebok","Adidas"], "Category:LIKE":"%category1%", "OR:Category:LIKE":"%category3%"}`
    &tpl=`ProductItemTpl`
    ]]
    


    I'm sure it's just a syntactical error, I've tried a few variations with no success.

    Thanks in advance smiley


    MODX 2.3.3-pl
    MIGX 2.9.0-pl [ed. note: bvirtual last edited this post 11 years, 1 month ago.]
      • 46315
      • 30 Posts
      Can anyone help with this?
        • 44580
        • 189 Posts
        Does the IN syntax work if you remove the LIKEs?

        In any case it seems from your description that you are wanting to filter on "category1" as this is the value you've stored. If that is true you should continue to use IN rather than LIKE. If you want to filter on category1, category10 and category14 (etc) then use LIKE. This isn't clear from your post.