Module: Locomotive::Ecommerce::EcommerceHelper

Includes:
EcommerceCartHelper, EcommerceUrlHelper, InventoryInterface
Included in:
ApplicationController, Cart
Defined in:
app/helpers/locomotive/ecommerce/ecommerce_helper.rb

Instance Method Summary collapse

Methods included from InventoryInterface

included

Methods included from EcommerceUrlHelper

#add_to_cart_path, #cart_path, #cart_update_path, #checkout_index_path, #checkout_path, #checkout_update_path, #confirm_order_path, #post_checkout_path, #purchases_path, #remove_from_cart_path

Methods included from EcommerceCartHelper

#current_user_cart

Instance Method Details

#as_currency(val) ⇒ Object

View Helper



20
21
22
# File 'app/helpers/locomotive/ecommerce/ecommerce_helper.rb', line 20

def as_currency(val)
  "$#{'%.2f' % val}"
end

#current_user(controller) ⇒ Object

User



11
12
13
14
15
16
17
# File 'app/helpers/locomotive/ecommerce/ecommerce_helper.rb', line 11

def current_user(controller)
  if controller.session[:user_id]
    site = Thread.current[:site]
    user_from_plugin = site.plugin_object_for_id('identity_plugin').js3_context['identity_plugin_users']
    @current_user ||= user_from_plugin.find(controller.session[:user_id])
  end
end