# カートの中を見る。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
flash.now[:error] = "配達時間が選択されていません"
end
if flash.now[:error]
- if request.mobile?
+ if request.mobile? && !request.mobile.respond_to?('smartphone?')
delivery2
else
params[:back] = "1"
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
@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
end
def current_method_symbol
- caller.first.scan(/`(.*)'/).to_s.intern
+ caller.first.sub(/^.*`(.*)'$/, '\1').intern
end
def save_transaction_items_before_payment