What am i trying to achieve
I am trying to create a price comparison site. In order to do this, i've created two content types, called product and price.

  • Product contains several fields with info on a product.
  • Price contains a price and a node reference to point to a product.

I am trying to create a view products. Each product should also show the lowest price for that product.

So, schematically, given the following nodes:

Product A: Shoe, size 50
Product B: Jacket, green
Product C: Shirt, black
Product D: Shirt, blue

Price 1: 19.95, Product A
Price 2: 18.03, Product A
Price 3: 5.95, Product C
Price 4: 17.95, Product A
Price 5: 6.04, Product B

The view should show something like this:

Shoe, Size 50, 17.95
Jacket, green, 6.04
Shirt, black, 5.95
Shirt, Blue, no prices available

What i did
I started by creating a view of products. After that, under relationships, i added the reverse node reference from price. After that, i added a the price field from the price content type in the fields list.

Expected result
The price field will show one or all of the prices from all referencing price nodes under each product. Somehow, i expected this to be configurable like a normal multiple value field.

Actual result
The price field does actually show a price, but instead of showing just one or all of the prices under the products, it duplicates the product for each referring price. So instead of showing "Product A" once with either one or three prices underneath, it will show "Product A" three times. Once with price 1 underneath, once with price 2 and once with price 4.

What I tried to resolve it
I off course tried tinkering around with the field settings of the price field. While there are some interresting options available under "Views distinct settings", they don't appear to have the desired effect on the view. Turning on "Use the rendered output of this field" together with "aggregate repeats" came close, but not quite: it showed all prices under the product, but all prices instead of only the ones referring to that product, and there were still duplicate products.

Thank you
For your help!

Comments

babipanghang’s picture

Solved my problem. The views aggregator plus module perfectly took care of it.

babipanghang’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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