Sha256: eec353edf255c7182ecaf995ebca875d5097ac7d7e7367512adf62e1fad8230a

Contents?: true

Size: 821 Bytes

Versions: 59

Compression:

Stored size: 821 Bytes

Contents

module PiggybakHelper
  def cart_form(object)
    render "piggybak/cart/form", :object => object
  end
  def cart_link
    cart = Piggybak::Cart.new(request.cookies["cart"]) 
    nitems = cart.items.inject(0) { |nitems, item| nitems + item[:quantity] }
    if nitems > 0 && !["piggybak/orders", "piggybak/cart"].include?(params[:controller])
      link_to "#{pluralize(nitems, 'item')}: #{number_to_currency(cart.total)}", piggybak.cart_url
    end
  end
  def orders_link(text)
    if current_user
      link_to text, piggybak.orders_list_url
    end
  end
  def piggybak_track_order(store_name)
    if params[:controller] == "piggybak/orders" && params[:action] == "receipt" && session.has_key?(:last_order)
      render "piggybak/orders/google_analytics", :order => @order, :store_name => store_name
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
piggybak-0.6.10 app/helpers/piggybak_helper.rb
piggybak-0.6.9 app/helpers/piggybak_helper.rb
piggybak-0.6.8 app/helpers/piggybak_helper.rb
piggybak-0.6.7 app/helpers/piggybak_helper.rb
piggybak-0.6.6 app/helpers/piggybak_helper.rb
piggybak-0.6.5 app/helpers/piggybak_helper.rb
piggybak-0.6.4 app/helpers/piggybak_helper.rb
piggybak-0.6.3 app/helpers/piggybak_helper.rb
piggybak-0.6.2 app/helpers/piggybak_helper.rb
piggybak-0.6.1 app/helpers/piggybak_helper.rb
piggybak-0.6.0 app/helpers/piggybak_helper.rb
piggybak-0.5.5 app/helpers/piggybak_helper.rb
piggybak-0.5.4 app/helpers/piggybak_helper.rb
piggybak-0.5.3 app/helpers/piggybak_helper.rb
piggybak-0.5.2 app/helpers/piggybak_helper.rb
piggybak-0.5.1 app/helpers/piggybak_helper.rb
piggybak-0.5.0 app/helpers/piggybak_helper.rb
piggybak-0.4.39 app/helpers/piggybak_helper.rb
piggybak-0.4.38 app/helpers/piggybak_helper.rb
piggybak-0.4.37 app/helpers/piggybak_helper.rb