title: Magento2 product conditions
body: <p>Magento2 has that nice UI to provide conditions to filter products, cart attributes etc. I could not find any documentation how such functionality should be extended for custom module.</p>
  
  <p>Based on <code>module-catalog-rule</code> and <code>module-sales-rule</code> modules I was able to implement conditions UI and saving corresponding values(<code>conditions_serialized</code>) but I am not able to apply those conditions to get filtered products.</p>
  
  <p>So the <strong>question</strong>: How can I implement conditions in a custom module? How can I use(apply) conditions?</p>
  
  <p><a href="https://i.stack.imgur.com/3rMbj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3rMbj.png" alt="conditions"></a></p>