Hi,
I am working on a custom module in which I want to use Views to let the user access his data.
For this issue I will simplify my case.
I have two tables :
- products [product_id, price]
- subscription [subscription_id, quantity, product_id]
The relation between these two tables is 1-n (1 product in each subscription)
I successfully created Views interface for my subscriptions' fields using the API.
My problem is that I would like to have a views field not related to a database field but calculated from them.
In this sample I would like my "Subscription" group to contain a "Total Price" field which value would be subscription.quantity multiplied by product.price.
I tried many things but without success.
Could you, please, give me a clue ?
Regards.
Comments
Comment #1
merlinofchaos commentedYou need to provide a field handler whose query() method does the correct thing, which in this case is probably nothing.
Comment #2
duaelfrThank you very much :)