Module: OrderHelper
- Defined in:
- app/helpers/order_helper.rb
Instance Method Summary collapse
- #display_cheque_message ⇒ Object
- #payment_methods_list ⇒ Object
- #payment_radio_button_tag(payment, image = '') ⇒ Object
- #step_order(index = 0) ⇒ Object
Instance Method Details
#display_cheque_message ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/helpers/order_helper.rb', line 32 def if Setting.current.payment_method_available?(:cheque) Setting.current.(@order) else t(:not_active, :scope => [:payment]).capitalize end end |
#payment_methods_list ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/helpers/order_helper.rb', line 3 def payment_methods_list content = '' setting = Setting.current setting.payment_method_availables.each do |payment_method| payment_infos = setting.payment_method_settings(payment_method) content += (payment_method, payment_infos[:image]) if payment_method.to_sym == :cyberplus and setting.payment_method_settings_with_env(payment_method)[:payment_config] != 'SINGLE' if current_user.cart.total >= setting.payment_method_settings_with_env(payment_method)[:multi_minimum_cart].to_f content += ("#{payment_method}_multi", payment_infos[:image_multi]) else = setting.payment_method_settings_with_env(payment_method)[:multi_message] flash[:warning] = if .present? end end end content end |
#payment_radio_button_tag(payment, image = '') ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/helpers/order_helper.rb', line 24 def (payment, image = '') payment_tag = content_tag(:div, :class => 'paiement' ) do (:payment_type, payment, params[:payment_type] == payment.to_s) + content_tag(:label, t(payment, :scope => [:payment], :count => 1).capitalize ) end payment_tag += image_tag(image) if image.present? end |
#step_order(index = 0) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/helpers/order_helper.rb', line 40 def step_order(index=0) ## urls need change urls = [{:controller => 'cart'}, {:controller => 'order', :action => 'informations'}, {:controller => 'order', :action => 'informations'}, {:controller => 'order', :action => 'informations'}] labels = ['Mon panier', 'Livraison', 'Paiement', 'Validation'] links = [] labels.each_with_index do |label,i| link = link_to(label, urls[i]) _class = 'checkout_link' _class += " checkout_link_#{i}" _class += ' current_checkout_link' if i == index span = content_tag(:span, link) div = content_tag(:div, span, :class => _class) links << div end content_tag(:div, links, :class => 'checkout_links') end |