Describe the bug
When you try to create a simple promotion (condition: orderTotal > 0) for the whole catalog (action discount products with these facets without specifying any facet), the button "CREATE" is disabled....until you add and then remove again a random facet.
So, i.e. it is actually possible to define a promotion -15% OFF for the products' whole catalog (no facet selected) as needed, but you need to select and unselect a random facet.
To Reproduce
Steps to reproduce the behavior:
https://demo.vendure.io/admin/marketing/promotionsExpected behavior
after 5) I expect the "CREATE" button to be enabled, while it isn't.
By the way the button is enabled if:
category: Electronics)If you want to discount the entire order by 15%, why not choose the "Discount order by { discount }%" action instead? That is the intended action for this use-case.
I would actually argue that the "Discount products with these facets" action should _enforce_ at least 1 facet to be selected. Thoughts?
Some considerations:
Is it possible to write custom promotion conditions and custom promotion actions ?
If so, please suggest how to do it.
@janumpallykalyan Yes it is. Currently there are no docs apart from the generated ones at https://www.vendure.io/docs/typescript-api/promotions/
I'm currently working on improvements to this area and will include some dedicated guides to writing them. For now, I suggest you study the default conditions and actions to get an idea how they are done.
@michaelbromley Thanks man. It's working fine.
@michaelbromley Like collectionFilters in CatalogOptions, Can I have orderFilters in OrderOptions ? Can You please gprovide insights on it how to write.. 鉁嶏笍 .
@janumpallykalyan I'm not sure what you mean exactly. Best place to ask something like this in in slack, then we can discuss and clarify what you mean.