def boxes(rigid_variants)
      stackable = {}
      nonstackable = []      
      rigid_variants.each do |v|
        sgid = v.product.stackable_group_id        
        if sgid          
          stackable[sgid] = [] if stackable[sgid].nil?
          stackable[sgid] << v
        else
          nonstackable << [v.length, v.width, v.height]
        end
      end
            
      stackable.each do |sgid, arr|                
        sg = arr[0].product.stackable_group        
        l = 0.0
        w = 0.0
        h = 0.0        
        arr.each do |v|
          if l+sg.extra_length >= sg.max_length || w+sg.extra_width >= sg.max_width || h+sg.extra_height >= sg.max_height
            nonstackable << [l, w, h]
            l = 0.0
            w = 0.0
            h = 0.0
          end
          if l == 0.0
            l = v.length
            w = v.width
            h = v.height            
          else
            l = l + sg.extra_length
            w = w + sg.extra_width
            h = h + sg.extra_height            
          end
        end        
        nonstackable << [l, w, h] if l > 0
      end
      
      return nonstackable
    end
def boxes(rigid_variants)
      stackable = {}
      nonstackable = []      
      rigid_variants.each do |v|
        sgid = v.product.stackable_group_id        
        if sgid          
          stackable[sgid] = [] if stackable[sgid].nil?
          stackable[sgid] << v
        else
          nonstackable << [v.length, v.width, v.height]
        end
      end
            
      stackable.each do |sgid, arr|                
        sg = arr[0].product.stackable_group        
        l = 0.0
        w = 0.0
        h = 0.0        
        arr.each do |v|
          if l+sg.extra_length >= sg.max_length || w+sg.extra_width >= sg.max_width || h+sg.extra_height >= sg.max_height
            nonstackable << [l, w, h]
            l = 0.0
            w = 0.0
            h = 0.0
          end
          if l == 0.0
            l = v.length
            w = v.width
            h = v.height            
          else
            l = l + sg.extra_length
            w = w + sg.extra_width
            h = h + sg.extra_height            
          end
        end        
        nonstackable << [l, w, h] if l > 0
      end
      
      return nonstackable
    end
Gets the 3d dimensions of the variants after they're stacked