0

I have a Commerce site selling clothing. Some Product Displays have multiple Commerce Products associated with them, and some have only one Product associated with them.

For example...

Shirt - Large - $10
Shirt - Medium - $8
Pants - One Size Fits All - $20

I need to use Views to display the title and price fields, as well as a link to the Product Display. I am using the Taxonomy term (Content) view with the Relationship "Content: Referenced products". I added the Title field, the "Size" field, and the "Commerce Product: Price" field, and enabled the "Distinct" setting in the Query Settings section. The result is as follows (fields are separated by a dash):

Shirt - Large - $10
Shirt - Medium - $8
Pants - One Size Fits All - $20

But I need the two "Shirt" items to be combined into a single line, like this:

Shirt - Large:$10 - Medium:$8
Pants - One Size Fits All - $20

Is it possible to combine products that have the same exact title (in this case, "Shirt")? There is only one Shirt product display page, on which the customer can choose Large or Medium.

  • You could try doing a Group By "title". I haven't actually done this (using the title) before, but it should be fairly straight-forward. – alex laughnan Mar 20 '15 at 17:01
0

Are you using multiple taxonomy terms field to enable the Large, Medium,etc sizes?

On the Views when you click on that taxonomy field, is there a way to show all fields in one line combined instead of separating them? Then use the Rewriting options so that you display with something like this:

[title] - [Sizes]: [Price]

Not sure if it will work, but worth a try. Experiment with separating out the different tokens and combining them in the Rewriting option.

Oh, what Alex said might work too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.