Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

1680
 
1682
 
1682
 
product.php
_> 309309               if ( $value_exists === false ) {
  310310                 $values_array[$group_id]['data'][] = array('id' => $value_id,
  311311                                                            'text' => $value['value_title'],
<> 312 -                                                           'default' => $value['default']);
   312+                                                           'default' => $value['default'],
   313+                                                           'sort_order' => $value['sort_order']);
313314               } elseif ( $value['default'] === true ) {
  314315                 foreach ( $values_array[$group_id]['data'] as &$existing_data ) {
  315316                   if ( $existing_data['id'] == $value_id ) {
     
 !
323324           }
  324325         }
  325326 
<>  327+        foreach ( $values_array as $group_id => &$value ) {
   328+          usort($value['data'], array('osC_Product', '_usortVariantValues'));
   329+        }
   330+
326331         return $values_array;
  327332       }
  328333 
     
 !
446451 
  447452       return $Qproducts;
  448453     }
<>  454+
   455+    protected static function _usortVariantValues($a, $b) {
   456+      if ( $a['sort_order'] == $b['sort_order'] ) {
   457+        return strnatcasecmp($a['text'], $b['text']);
   458+      }
   459+
   460+      return ( $a['sort_order'] < $b['sort_order'] ) ? -1 : 1;
   461+    }
<_ 449462   }
  450463 ?>