def admin_edit_variants   
      return if !user_is_allowed('products', 'edit')    
      @product = Product.find(params[:id])
      
      if @product.variants.nil? || @product.variants.count == 0
        v = Variant.new
        v.option1 = @product.default1 if @product.option1
        v.option2 = @product.default2 if @product.option2
        v.option3 = @product.default3 if @product.option3
        v.status  = 'Active'
        @product.variants = [v]
        @product.save
      end
      @variant = params[:variant_id] ? Variant.find(params[:variant_id]) : @product.variants[0]
      session['variant_cols'] = self.default_variant_cols if session['variant_cols'].nil?
      @cols = session['variant_cols']
      
      @highlight_variant_id = params[:highlight] ? params[:highlight].to_i : nil        
      
      if @product.options.nil? || @product.options.count == 0
        render 'caboose_store/products/admin_edit_variants_single', :layout => 'caboose/admin'  
      else
        render 'caboose_store/products/admin_edit_variants', :layout => 'caboose/admin'
      end          
    end
def admin_edit_variants   
      return if !user_is_allowed('products', 'edit')    
      @product = Product.find(params[:id])
      
      if @product.variants.nil? || @product.variants.count == 0
        v = Variant.new
        v.option1 = @product.default1 if @product.option1
        v.option2 = @product.default2 if @product.option2
        v.option3 = @product.default3 if @product.option3
        v.status  = 'Active'
        @product.variants = [v]
        @product.save
      end
      @variant = params[:variant_id] ? Variant.find(params[:variant_id]) : @product.variants[0]
      session['variant_cols'] = self.default_variant_cols if session['variant_cols'].nil?
      @cols = session['variant_cols']
      
      @highlight_variant_id = params[:highlight] ? params[:highlight].to_i : nil        
      
      if @product.options.nil? || @product.options.count == 0
        render 'caboose_store/products/admin_edit_variants_single', :layout => 'caboose/admin'  
      else
        render 'caboose_store/products/admin_edit_variants', :layout => 'caboose/admin'
      end          
    end
GET /admin/products/:id/variants
 GET /admin/products/:id/variants/:variant_id