Sha256: f928d0321fafe2b03299b00f5742379a4ddbcee104fb49b0728bd52fed5d6dcd

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

module Locomotive  
  module Ecommerce
    module EcommerceUrlHelper
      ##################
      # configured urls
      ##################
      def cart_path(*args)
        Engine.config_or_default('cart_url')
      end

      def checkout_path
        Engine.config_or_default('checkout_url')
      end

      def confirm_order_path
        Engine.config_or_default('confirm_order_url')
      end

      def purchases_path
        Engine.config_or_default('purchases_url')
      end

      def post_checkout_path
        Engine.config_or_default('post_checkout_url')
      end

      ###########################
      # non-configured urls
      # (provided by the engine)
      # #########################
      def cart_update_path(stem, cart)
        "#{stem}cart/#{cart.id}"
      end
      
      def add_to_cart_path(stem, product)
        "#{stem}add_to_cart/#{product.id}"
      end

      def remove_from_cart_path(stem, product_id)
        "#{stem}remove_from_cart/#{product_id}"
      end
      
      def checkout_update_path(stem, purchase)
        "#{stem}checkout/#{purchase.id}"
      end
      
      def checkout_index_path(stem)
        "#{stem}checkout"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
locomotive_ecommerce_plugin-1.0.6 app/helpers/locomotive/ecommerce/ecommerce_url_helper.rb
locomotive_ecommerce_plugin-1.0.5 app/helpers/locomotive/ecommerce/ecommerce_url_helper.rb
locomotive_ecommerce_plugin-1.0.4 app/helpers/locomotive/ecommerce/ecommerce_url_helper.rb
locomotive_ecommerce_plugin-1.0.1 app/helpers/locomotive/ecommerce/ecommerce_url_helper.rb
locomotive_ecommerce_plugin-1.0.0 app/helpers/locomotive/ecommerce/ecommerce_url_helper.rb