OSDN Git Service

refs #1589 注文ウィザードの画面遷移が正常に動作しない不具合を修正
[elecoma/elecoma.git] / app / controllers / cart_controller.rb
index 1a257e4..185438a 100644 (file)
@@ -19,7 +19,11 @@ class CartController < BaseController
   # カートの中を見る。Loginの可否、カート内容の有無で動的に変動。カート操作全般はここから行う。
   def show
     unless @carts.all?(&:valid?)
-      flash.now[:error] = cart_errors(@carts)
+      if flash.now[:error]
+        flash.now[:error] = flash.now[:error] + cart_errors(@carts)
+      else
+        flash.now[:error] = cart_errors(@carts)
+      end
     end
     @cart_point = total_points
     if @carts.last
@@ -255,7 +259,7 @@ class CartController < BaseController
         flash.now[:error] = "配達時間が選択されていません"
       end
       if flash.now[:error]
-        if request.mobile?
+        if request.mobile? && !request.mobile.respond_to?('smartphone?')
           delivery2
         else
           params[:back] = "1"
@@ -317,7 +321,7 @@ class CartController < BaseController
   def select_delivery_time_with_delivery_trader_id_ajax
     delivery_trader_id = params[:delivery_trader_id]
     @options = select_delivery_time_with_delivery_trader_id(delivery_trader_id)
-    render :layout => false unless request.mobile?
+    render :layout => false unless request.mobile? && !request.mobile.respond_to?('smartphone?')
   end
 
 
@@ -511,7 +515,7 @@ class CartController < BaseController
     @carts ||= []
     product_style =
       if params[:product_style_id]
-        ProductStyle.find_by_id(params[:product_style_id])
+        ProductStyle.find_by_id(params[:product_style_id].to_i)
       else
         ProductStyle.find_by_product_id_and_style_category_id1_and_style_category_id2(params[:product_id], params[:style_category_id1], params[:style_category_id2])
       end
@@ -838,7 +842,7 @@ class CartController < BaseController
   end
   
   def current_method_symbol
-    caller.first.scan(/`(.*)'/).to_s.intern
+    caller.first.sub(/^.*`(.*)'$/, '\1').intern
   end
 
   def save_transaction_items_before_payment