diff --git a/commerce_price_table.rules.inc b/commerce_price_table.rules.inc
index 813dc9d..ccfcea0 100644
--- a/commerce_price_table.rules.inc
+++ b/commerce_price_table.rules.inc
@@ -21,6 +21,11 @@ function commerce_price_table_rules_action_info() {
         'label' => t('Price table'),
         'type' => 'list<commerce_price_table>',
       ),
+      'aggregate_products' => array(
+        'label' => t('Aggregate product quantities of same display'),
+        'type' => 'boolean',
+        'default value' => false
+      ),
     ),
     'group' => t('Commerce price table'),
   );
@@ -28,7 +33,21 @@ function commerce_price_table_rules_action_info() {
   return $actions;
 }
 
-function commerce_price_table_set_price($line_item, $quantity, $price_table) {
+function commerce_price_table_set_price($line_item, $quantity, $price_table, $aggregate_products) {
+  if ($aggregate_products) {
+    // Apply discount when purchasing a mix of products from the same product display.
+    if ($display_path = @$line_item->commerce_display_path['und'][0]['value']) {
+      $query = db_select('commerce_line_item', 'cli');
+      $query->addExpression('SUM(cli.quantity)', 'quantity');
+      $query->innerJoin('field_data_commerce_display_path', 'dp', 'dp.entity_id = cli.line_item_id');
+      $query->condition('cli.order_id', $line_item->order_id, '=');
+      $query->condition('dp.entity_type', 'commerce_line_item', '=');
+      $query->condition('dp.commerce_display_path_value', $display_path, '=');
+      if ($result = $query->execute()->fetchField()) {
+         $quantity = $result;
+      }
+    }
+  }
   // If the line item contains a product, we set the price according to the
   // quantity.
   if (commerce_line_items_quantity(array($line_item), commerce_product_line_item_types())) {
