Module: NimbleshopCod::ExposedHelper

Defined in:
app/helpers/nimbleshop_cod/exposed_helper.rb

Instance Method Summary collapse

Instance Method Details

#nimbleshop_cod_available_payment_options_iconsObject



18
19
20
# File 'app/helpers/nimbleshop_cod/exposed_helper.rb', line 18

def nimbleshop_cod_available_payment_options_icons
  return nil # do not display any payment option icon for cash on delivery
end

#nimbleshop_cod_crud_formObject



27
28
29
30
# File 'app/helpers/nimbleshop_cod/exposed_helper.rb', line 27

def nimbleshop_cod_crud_form
  return unless NimbleshopCod::Cod.first
  render partial: '/nimbleshop_cod/cods/edit'
end

#nimbleshop_cod_icon_for_order_payment(order) ⇒ Object



32
33
34
# File 'app/helpers/nimbleshop_cod/exposed_helper.rb', line 32

def nimbleshop_cod_icon_for_order_payment(order)
  nimbleshop_cod_small_image( height: '13px' )
end

#nimbleshop_cod_next_payment_processing_action(order) ⇒ Object



4
5
6
7
8
# File 'app/helpers/nimbleshop_cod/exposed_helper.rb', line 4

def nimbleshop_cod_next_payment_processing_action(order)
  if order.pending?
    link_to 'Mark payment as received', purchase_payment_admin_order_path(order), method: :put, class: 'btn btn-success'
  end
end

#nimbleshop_cod_payment_form(order) ⇒ Object



22
23
24
25
# File 'app/helpers/nimbleshop_cod/exposed_helper.rb', line 22

def nimbleshop_cod_payment_form(order)
  return unless NimbleshopCod::Cod.first
  render partial: '/nimbleshop_cod/payments/new', locals: { order: order }
end

#nimbleshop_cod_picture_on_admin_payment_methodsObject



14
15
16
# File 'app/helpers/nimbleshop_cod/exposed_helper.rb', line 14

def nimbleshop_cod_picture_on_admin_payment_methods
  image_tag 'engines/nimbleshop_cod/cod_big.png', alt: 'cod logo'
end

#nimbleshop_cod_small_image(options = {}) ⇒ Object



10
11
12
# File 'app/helpers/nimbleshop_cod/exposed_helper.rb', line 10

def nimbleshop_cod_small_image(options = {} )
  image_tag 'engines/nimbleshop_cod/cod_small.png', {alt: 'cod icon'}.merge(options)
end