Module: Refinery::Stores::StoresHelper

Defined in:
app/helpers/refinery/stores/stores_helper.rb

Instance Method Summary collapse

Instance Method Details

#is_user_signed_in?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
# File 'app/helpers/refinery/stores/stores_helper.rb', line 18

def is_user_signed_in?()

  return refinery_current_user

rescue NameError
  return  nil
end

#pretty_customer_nameObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/refinery/stores/stores_helper.rb', line 5

def pretty_customer_name( )
  user = current_refinery_user  # might raise exception
  return  "please…".html_safe if user.nil?

  name = ( user.billing_address.nil?  ?  
          user.username  : 
          user.billing_address.first_name )
  return "Hi #{name}!"

 rescue NameError
   return  "please…".html_safe
end