Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a file missed in prevoius commit: order.erl
- Loading branch information
Mino
committed
May 18, 2010
1 parent
05b186b
commit 4d4f21d
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). |