Index: sites/all/modules/dc_ajax_add_cart/dc_ajax_add_cart.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/dc_ajax_add_cart/dc_ajax_add_cart.module	(date 1572802154000)
+++ sites/all/modules/dc_ajax_add_cart/dc_ajax_add_cart.module	(date 1573907834946)
@@ -301,9 +301,25 @@
 
       if ($commerce_cart['order']) {
         $line_items = $commerce_cart['wrapper']->commerce_line_items;
-        $quantity = commerce_line_items_quantity($line_items, commerce_product_line_item_types());
         $total = commerce_line_items_total($line_items);
 
+        if (module_exists('commerce_bundle')) {
+          $bundle_quantity = array();
+          $quantity = 0;
+          foreach ($line_items->value() as $line_item) {
+            if ($line_item->type == 'commerce_bundle_line_item') {
+              $bundle_quantity[$line_item->commerce_bundle_config_id[LANGUAGE_NONE][0]['value']] = ceil($line_item->quantity / $line_item->commerce_bundle_unit_quantity[LANGUAGE_NONE][0]['value']);
+            }
+            else {
+              $quantity += $line_item->quantity;
+            }
+          }
+          $quantity += array_sum($bundle_quantity);
+        }
+        else {
+          $quantity = commerce_line_items_quantity($line_items, commerce_product_line_item_types());
+        }
+
         if (variable_get(DC_AJAX_ADD_CART_HIDE_EMPTY_CART, 0) && ($quantity == 0)) {
           $hide_empty_cart = TRUE;
         }
@@ -351,7 +367,22 @@
 
       if ($commerce_cart['order']) {
         $line_items = $commerce_cart['wrapper']->commerce_line_items;
-        $quantity = commerce_line_items_quantity($line_items, commerce_product_line_item_types());
+        if (module_exists('commerce_bundle')) {
+          $bundle_quantity = array();
+          $quantity = 0;
+          foreach ($line_items->value() as $line_item) {
+            if ($line_item->type == 'commerce_bundle_line_item') {
+              $bundle_quantity[$line_item->commerce_bundle_config_id[LANGUAGE_NONE][0]['value']] = ceil($line_item->quantity / $line_item->commerce_bundle_unit_quantity[LANGUAGE_NONE][0]['value']);
+            }
+            else {
+              $quantity += $line_item->quantity;
+            }
+          }
+          $quantity += array_sum($bundle_quantity);
+        }
+        else {
+          $quantity = commerce_line_items_quantity($line_items, commerce_product_line_item_types());
+        }
         $total = commerce_line_items_total($line_items);
       }
       else {
