1
Answers
Vote up!
0
Vote down!

Popular products functionality would be great!

Hi,
My products are not 1-1 nodes. They are on itself standing entities.
A product has a sku, color and size. A product has its own url which is made through: http://drupal.org/sandbox/davereid/1643530
: products[PID]

I would very much like to be able to show my users:
- the most popular clicked products
- the most popular ordered products
- the most popular clicked "add to cart" products
- the most popular products based on amounts ordered.

I think this functionality is lacking and very important for a commerce webshop!
I am not a programmer, but would love to test solutions. I tried: http://drupal.org/sandbox/anthonylindsay/1643068 but this one is only based on node displays. I also saw: http://drupal.org/project/commerce_productpopularity but this uses another module, while within statistics it should be possible to see every entity, right?

Thanks a lot in advance for your thoughts about this.

Greetings, Martijn

Asked by: Summit
on July 16, 2012

1 Answer

Vote up!
2
Vote down!

The trick with all of these is to use "Aggregate" in Views and know which entity to use as a base table.

For example "most ordered items" can be created in views on a "Line Item" entity for type "Product" (because you can have shipping line items as well). Use aggregation setting to "SUM" the line item ID, this will give you number of products that have been "Added to cart"

"Most Ordered Items" = http://pastebin.com/HJ45yFQu

You can play with filtering based on the Order status to get different results (only count number of line items that have an order status of "completed" would give you only the products that were literally purchased).

Extra thanks to cvangysel, the maintainer of http://drupal.org/project/commerce_reports , who walked me through making the above view.

Josh Miller
Answer by: Josh Miller
Posted: Sep 5, 2012

Comments

Working great!

Thanks for the solution, i've tried the 2 modules describe here but nothing did what i was looking for! But your answer did it in about 30 seconds ;)

- ayottepl on December 19, 2012