Duplicate items when using attributes
Hi Guys,
New here, just dabbed into drupal commerce. My products have multiple attributes, so I followed the FAQ and created multiple copies of the same product with different attribute and linked them to a content product node.
By doing so, every single product of the attribute is showing once on my category page. How do I remove the duplicates?
Thanks,
Wendy
Comments
Never mind,This has
Never mind,
This has everything to do with Views only. I solved it by altering the views sql pre execute
function nodupe_views_pre_execute(&$view) {
switch($view->name){
case 'catalog':
case 'latest_products':
$view->build_info['query']->groupBy('node_title');
break;
}
Same problem
Can you please explain it. I mean give us if you can some more information about this.
Thanks
Please explain more
Hi
I would really appreciate if you could explain more.
Is it a custom module? Please explain the variables you use and so on if you have the time.
I really think commerce needs a custom views plugin for this as its something that happens to everyone and there seams to be no clear way to handle it.
You have to add filter to
You have to add filter to your view: field_product_reference:delta = 0
And after that "Views exposed
And after that "Views exposed filters" like a size/color does not work
I don't know why this works
I don't know why this works but it does.
The filter is content:products:delta, and then you add a '0' when prompted for a number. The view is now only showing 1 product / attribute from each product - I need to look into this more to figure out how to choose which attribute to show. EG it would be nice to display 'from £40'
Cheers, Joe
It works! Thanks a lot!
It works! Thanks a lot!
What about an extra filter
What about an extra filter (perhaps an AND filter to respect the other filter also) that uses the Price field > 40?