Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

1674
 
1677
 
1677
 
product.php
_> 119119               $Qvariants->execute();
  120120 
  121121               while ( $Qvariants->next() ) {
<> 122 -                $this->_data['variants'][$Qsubproducts->valueInt('products_id')]['values'][$Qvariants->valueInt('group_id')] = array('value_id' => $Qvariants->valueInt('value_id'),
  123 -                                                                                                                                     'group_title' => $Qvariants->value('group_title'),
  124 -                                                                                                                                     'value_title' => $Qvariants->value('value_title'),
  125 -                                                                                                                                     'sort_order' => $Qvariants->value('value_sort_order'),
  126 -                                                                                                                                     'module' => $Qvariants->value('module'));
   122+                $this->_data['variants'][$Qsubproducts->valueInt('products_id')]['values'][$Qvariants->valueInt('group_id')][$Qvariants->valueInt('value_id')] = array('value_id' => $Qvariants->valueInt('value_id'),
   123+                                                                                                                                                                       'group_title' => $Qvariants->value('group_title'),
   124+                                                                                                                                                                       'value_title' => $Qvariants->value('value_title'),
   125+                                                                                                                                                                       'sort_order' => $Qvariants->value('value_sort_order'),
   126+                                                                                                                                                                       'module' => $Qvariants->value('module'));
127127               }
  128128             }
  129129           }
     
 !
286286 
  287287         foreach ( $this->_data['variants'] as $product_id => $variants ) {
  288288           foreach ( $variants['values'] as $group_id => $values ) {
<> 289 -            if ( !isset($values_array[$group_id]) ) {
  290 -              $values_array[$group_id]['group_id'] = $group_id;
  291 -              $values_array[$group_id]['title'] = $values['group_title'];
  292 -              $values_array[$group_id]['module'] = $values['module'];
  293 -            }
   289+            foreach ( $values as $value_id => $value ) {
   290+              if ( !isset($values_array[$group_id]) ) {
   291+                $values_array[$group_id]['group_id'] = $group_id;
   292+                $values_array[$group_id]['title'] = $value['group_title'];
   293+                $values_array[$group_id]['module'] = $value['module'];
   294+              }
294295 
<> 295 -            $value_exists = false;
   296+              $value_exists = false;
296297 
<> 297 -            if ( isset($values_array[$group_id]['data']) ) {
  298 -              foreach ( $values_array[$group_id]['data'] as $value ) {
  299 -                if ( $value['id'] == $values['value_id'] ) {
  300 -                  $value_exists = true;
   298+              if ( isset($values_array[$group_id]['data']) ) {
   299+                foreach ( $values_array[$group_id]['data'] as $data ) {
   300+                  if ( $data['id'] == $value_id ) {
   301+                    $value_exists = true;
301302 
<> 302 -                  break;
   303+                    break;
   304+                  }
303305                 }
  304306               }
<> 305 -            }
306307 
<> 307 -            if ( $value_exists === false ) {
  308 -              $values_array[$group_id]['data'][] = array('id' => $values['value_id'],
  309 -                                                         'text' => $values['value_title']);
   308+              if ( $value_exists === false ) {
   309+                $values_array[$group_id]['data'][] = array('id' => $value_id,
   310+                                                           'text' => $value['value_title']);
   311+              }
310312             }
  311313           }
  312314         }
     
 !
331333           $_array = array();
  332334 
  333335           foreach ( $variants['values'] as $group_id => $value ) {
<> 334 -            $_array[$group_id] = $value['value_id'];
   336+            $n = sizeof($value);
   337+
   338+            foreach ( $value as $value_id => $value_data ) {
   339+              if ( $n > 1 ) {
   340+                $_array[$group_id][$value_id] = $variant[$group_id][$value_id];
   341+              } else {
   342+                $_array[$group_id] = $value_id;
   343+              }
   344+            }
<_ 335345           }
  336346 
  337347           if ( sizeof(array_diff_assoc($_array, $variant)) === 0 ) {