diff --git a/commerce_apd.module b/commerce_apd.module
index a2113bc..cb68c06 100644
--- a/commerce_apd.module
+++ b/commerce_apd.module
@@ -151,9 +151,25 @@ function commerce_apd_form_commerce_product_ui_product_form_alter(&$form, &$form
     // below the product creation form.
     $weight = $count;
 
+    if (module_exists('field_group')) {
+      $groups = $form2['#groups'];
+      $fieldgroups = $form2['#fieldgroups'];
+      $group_children = $form2['#group_children'];
+      unset($form2['#groups']);
+      unset($form2['#fieldgroups']);
+      unset($form2['#group_children']);
+    }
+
     // Attach the product display form to product creation variable.
     field_attach_form('node', $node, $form, $form_state);
 
+    if (module_exists('field_group')) {
+      $form['#groups'] = array_merge($form['#groups'], $groups);
+      $form['#fieldgroups'] = array_merge($form['#fieldgroups'], $fieldgroups);
+      $form['#group_children'] = array_merge($form['#group_children'], $group_children);
+      $form['#pre_render'] = array_unique($form['#pre_render']);
+    }
+
     // Don't include the product reference field because it will be filled
     // automatically after form submission.
     unset($form[$field_product]);
@@ -221,7 +237,7 @@ function commerce_apd_form_commerce_product_ui_product_form_alter(&$form, &$form
       // Field name list to be validated next.
       $form['validate_next'] = array(
         '#type' => 'value',
-        '#value' => implode(",", $validate_next), 
+        '#value' => implode(",", $validate_next),
       );
 
       // Validation callback.
@@ -282,7 +298,7 @@ function commerce_apd_product_form_reference_validate($form, &$form_state) {
   // Get language.
   $lang = LANGUAGE_NONE;
 
-  // Validate required fields if only the auto display option is checked. 
+  // Validate required fields if only the auto display option is checked.
   if ($form_state['values']['auto_display'] == TRUE) {
     // Get the list of fields which will be validated.
     // Store them in array.
