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

merlinofchaos’s picture

Status: Active » Fixed

You need to provide a field handler whose query() method does the correct thing, which in this case is probably nothing.

duaelfr’s picture

Thank you very much :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.