New operators for attributes in product snippet tag

Description

Currently, in the attributes parameter in the product snippet tag, we can only use the = operator, which works as

  • equal sign
    OR

  • in
    (in case of checking whether a given value is in the data list as a product attribute of the multiple fixed choice type)

There is a need to add further operators to the above parameter:

  • >

  • <

  • >=

  • <=

  • != (analogously to =, the != operator would also check if the value is not in the list given as multi fixed choice or the value of one of the keys in the json type attribute)

What's more, the = and != operators would work not only for fixed_choice type attributes, but also for json type (in the same way as for fixed_choice type).

For example, for a json attribute named json_attr and the value

{"list": ["A", "B", "C"]} 

checking if the value is in the list list:

{% products count=5 attributes='json_attr.list=B' order_by='updated_at' order=-1 as product_list %}

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board

🧩 Feature Request

ETA
Jun 29, 2023
Date

11 months ago

Author

Grzegorz Kacperski

Subscribe to post

Get notified by email when there are changes.