Is it somehow possible to add payment status and payment method to ordes list view? I tried to use relationship inside orders list view but the commerce payment transaction is not available. Thank you for help.
4 Answers
It's not impossible, but the amount of Views foo required to do it is beyond most mortals.
The tricky part is that an order can have many transactions, and also several which is completed. That is the data model would allow you to pay half by credit card and half by paypal. Also different payment methods might have different status for complete/incomplete payments. That logic is hard to build into a SQL query, which is the limitations of Views.
That said you could add a custom relationship from the order to the payment transactions and probably make something that can work. Doing this will require that you can create a module, know a bit about Views and have a lot of patience, unless you have done this type of thing before.
-
Oh, ok thank you for explanation. So it is impossible for me to do:) As a workaround what I did is to put a order balance field into a order list - so if the balance is 0 the order was set to be paid.– loparrCommented Jan 6, 2012 at 16:22
-
I add a "payment transaction" relationship and add "Commerce Payment Transaction" Field. That works great!! ;)– laponguaCommented Feb 7, 2013 at 18:41
You can add field "payment method" or "payment status" to your Order entity. Than you can set value of this field when you are saving order in you payment method.
Of course this field will be available in views.
You can use http://drupal.org/project/views_field_view module. More details about it from project page:
This module allows you to embed a view as a field in a view. A new field handler is made available, so this can also be used in area (header/footer/empty) handlers as well as rows.
This view handler can accept arguments from fields of the parent view using tokens and pass them into the child view for each row. Raw or rendered token values can be used, as well as static values.
Check this comment for details.