Skip to content
Browse files

added a file missed in prevoius commit: order.erl

  • Loading branch information...
1 parent 05b186b commit 4d4f21d4eb14c3e92c523b42ac231612bfe4b2ec Mino committed
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/order.erl
View
21 src/order.erl
@@ -0,0 +1,21 @@
+%%%-------------------------------------------------------------------
+%%% File : order.erl
+%%% Author : <Mino@X60S>
+%%% Description :
+%%%
+%%% Created : 12 May 2010 by <Mino@X60S>
+%%%-------------------------------------------------------------------
+-module(order).
+
+-export([add/1]).
+
+-include("records.hrl").
+
+%%====================================================================
+%% API Functions
+%%====================================================================
+add(Cart) ->
+ Products = cart:get_products(Cart),
+ Items = [#orderItem{quantity=X, product=Y}||{X,Y} <- Products],
+ Order = #order{products=Items},
+ db:add_order(Order).

0 comments on commit 4d4f21d

Please sign in to comment.
Something went wrong with that request. Please try again.