Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'd like to create a view that shows all orders with an order balance above 0, however I cant seem to access the Commerce: Odrder Balance field in the filters section
Is there an easy way to do this, ordoes itinvolve custom code?
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedIt isn't actually possible, because there is no filter based on order balance (since it's calculated, not present in the data in the database, and therefore not queryable).
Comment #2
jeremymcminn CreditAttribution: jeremymcminn commentedOk no worries thanks for that - any ideas on how to create a view of orders with a balance of over 0, or is it just completely impossible? This is quite crucial for a project I am working on, to show orders with an outstanding balance.
ANy help would be appreciated. Thanks!
Comment #3
rszrama CreditAttribution: rszrama commentedYou can probably rough it out with relationships from the order table to the payment transaction table, but I haven't tried to be able to advise on the implementation.
Comment #4
jeremymcminn CreditAttribution: jeremymcminn commentedAhh that would make sense. Ill give that a go.
Thanks!
Comment #5
jasonrichardsmith@gmail.com CreditAttribution: jasonrichardsmith@gmail.com commentedrszrama:
I wrote this module based on the above request, because my organization wanted the filter/sort ability as well. I have not completed all the code cleanup, but it is a perfectly functioning module.
I wanted to be sure the query calc I am performing is taking care of all the commerce contingencies.
https://www.drupal.org/sandbox/jasonrichardsmith/2446085