I want to combine jinja and macros so I can use a list in more than one model.
Example I have this:
{% set payment_methods = ["bank_transfer", "credit_card", "gift_card"] %}
{% for payment_method in payment_methods %}
...
{% endfor %}
But I want to place the list of payment_methods in another file so I can use the list in different models. I was trying to achieve ir this way.
Having this macro:
{% macro payment_methods_macro() %}
select array["bank_transfer", "credit_card", "gift_card"]
{% endmacro %}
and then in my model doing:
{% set payment_methods = payment_methods_macro() %}
{% for payment_method in payment_methods %}
...
{% endfor %}
This does not work. Can anyone help me out here?