From f08f3a0ffee8dcca58fe50e705b23b550421f388 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 15 Feb 2008 22:02:21 +0000 Subject: [PATCH] seperated the cart doc out on it's own --- designdocs/cart.pod | 167 +++++++++++++++++++++++++++++ designdocs/commerce.pod | 231 ---------------------------------------- 2 files changed, 167 insertions(+), 231 deletions(-) create mode 100644 designdocs/cart.pod diff --git a/designdocs/cart.pod b/designdocs/cart.pod new file mode 100644 index 000000000..97f630a98 --- /dev/null +++ b/designdocs/cart.pod @@ -0,0 +1,167 @@ +=head1 Shopping Cart + +The shopping cart has to be flexible enough to hold any type of +purchasable good (anything derived from WebGUI::Asset::Sku), user +friendly, and also have speedy reporting options so that macros can be +written to display the cart data. + +=head2 Data Dictionary + +The following fields are needed to construct this object's table called +EE<128>E<156>cartEE<128>E<157>. + + Field Schema Description + cartId guid The unique id for this cart. + sessionId guid The sessionId attached to this cart. Can't use userId because the user may not be logged in yet. + shippingAddressId guid The id of the address to ship to. + couponId guid A coupon that is applied to this cart. + +=head2 Method Dictionary + +The following methods will be available from the WebGUI::Shop::Cart +class. + +=head3 addItem + +Adds an item to the cart. Returns the number of items now in the cart. + +param: asset EE<128>E<147> the asset object to be added already +configured as needed + +param: quantity EE<128>E<147> the number of this item that the +user wants + +=head3 create + +Creates a new cart object if there's not one already attached to the +current session object. Otherwise just instanciates the existing one. +Returns a reference to the object. + +param: session EE<128>E<147> a reference to the current session + +=head3 delete + +Deletes this cart and all cartItems contained in it. + +=head3 empty + +Removes all items from this cart. + +=head3 get + +Returns a duplicated hash reference of this object's data. + +param: any field EE<128>E<147> returns the value of a field +rather than the hash reference + +=head3 getId + +Returns the cart id. + +=head3 getItems + +Returns an array reference of WebGUI::Asset::Sku objects that are in +the cart. Calls WebGUI::Shop::CartItem-EgetAllInCart + +=head3 new + +Instanciates a cart based upon a cartId. + +param: sessionId EE<128>E<147> a reference to the current +session + +param: cartId EE<128>E<147> the unique id for this cart + +=head3 set + +Sets properties in the cart. + +param: hashref + +=head3 www_removeItem + +Checks privileges and displays appropriate message. Removes an item by +itemId. Returns www_viewCart + +=head1 Shopping Cart Item + +This object represents an individual item in the cart. + +=head2 Data Dictionary + +The following fields are needed to construct this object's table called +EE<128>E<156>cartItemsEE<128>E<157>. + + Field Schema Description + cartId guid The unique id for this cart. + assetId guid The assetId for this item. + options medium Text A json serialized hashref of any configuration data associated with this item so that it can be edited or whatnot. + shippingAddressId guid Assign a special shipping address to this item beyond the one attached at the cart level. + quantity integer The number of these items being purchased. + +=head2 Method Dictionary + +The following methods will be available from the WebGUI::Shop::CartItem +class. + +=head3 create + +Creates a new cart item object. Returns a reference to the object. + +param: session EE<128>E<147> a reference to the current session + +param: cartId EE<128>E<147> the unique id of the cart + +param: asset EE<128>E<147> A reference to the asset you wish to +create. + +param: quantity EE<128>E<147> the quantity of sku to purchase + +=head3 get + +Returns a duplicated hash reference of this object's data. + +param: any field EE<128>E<147> returns the value of a field +rather than the hash reference + +=head3 getAllInCart + +Returns an array reference of WebGUI::Shop::Cart::Item objects. + +param: session EE<128>E<147> the session object + +param: cartId EE<128>E<147> the unique id of the cart you'd like +to retrieve the objects of + +=head3 getSku + +Returns an instanciated WebGUI::Asset::Sku object for this cart item. + +=head3 new + +Instanciates a cart item based upon a cartId and assetId. + +param: session EE<128>E<147> the session object + +param: cartId EE<128>E<147> the unique id for this cart + +param: assetId EE<128>E<147> the unique id of an skue contained +in the cart + +=head3 remove + +Removes an item from the cart. + +param: assetId EE<128>E<147> the unique id of the asset to be +removed + +=head3 update + +Updates an item in the cart. + +param: assetId EE<128>E<147> the unique id of the sku to be +updated + +param: hashRef EE<128>E<147> a hash reference of the things that +might be updated, including quanity, shippingAddressId, and options. + diff --git a/designdocs/commerce.pod b/designdocs/commerce.pod index 0ee9a8621..b744a21d2 100644 --- a/designdocs/commerce.pod +++ b/designdocs/commerce.pod @@ -161,237 +161,6 @@ great example of a configurator. =back -=head1 Shopping Cart - -The shopping cart has to be flexible enough to hold any type of -purchasable good (anything derived from WebGUI::Asset::Sku), user -friendly, and also have speedy reporting options so that macros can be -written to display the cart data. - -=head2 Data Dictionary - -The following fields are needed to construct this object's table called -EE<128>E<156>cartEE<128>E<157>. - -Field - -Schema - -Description - -cartId - -guid - -The unique id for this cart. - -sessionId - -guid - -The sessionId attached to this cart. Can't use userId because the user -may not be logged in yet. - -shippingAddressId - -guid - -The id of the address to ship to. - -couponId - -guid - -A coupon that is applied to this cart. - -=head2 Method Dictionary - -The following methods will be available from the WebGUI::Shop::Cart -class. - -Method - -Description - -addItem - -Adds an item to the cart. Returns the number of items now in the cart. - -param: asset EE<128>E<147> the asset object to be added already -configured as needed - -param: quantity EE<128>E<147> the number of this item that the -user wants - -create - -Creates a new cart object if there's not one already attached to the -current session object. Otherwise just instanciates the existing one. -Returns a reference to the object. - -param: session EE<128>E<147> a reference to the current session - -delete - -Deletes this cart and all cartItems contained in it. - -empty - -Removes all items from this cart. - -get - -Returns a duplicated hash reference of this object's data. - -param: any field EE<128>E<147> returns the value of a field -rather than the hash reference - -getId - -Returns the cart id. - -getItems - -Returns an array reference of WebGUI::Asset::Sku objects that are in -the cart. Calls WebGUI::Shop::CartItem-EgetAllInCart - -new - -Instanciates a cart based upon a cartId. - -param: sessionId EE<128>E<147> a reference to the current -session - -param: cartId EE<128>E<147> the unique id for this cart - -set - -Sets properties in the cart. - -param: hashref - -www_removeItem - -Checks privileges and displays appropriate message. Removes an item by -itemId. Returns www_viewCart - -=head1 Shopping Cart Item - -This object represents an individual item in the cart. - -=head2 Data Dictionary - -The following fields are needed to construct this object's table called -EE<128>E<156>cartItemsEE<128>E<157>. - -Field - -Schema - -Description - -cartId - -guid - -The unique id for this cart. - -assetId - -guid - -The assetId for this item. - -options - -mediumText - -A json serialized hashref of any configuration data associated with -this item so that it can be edited or whatnot. - -shippingAddressId - -guid - -Assign a special shipping address to this item beyond the one attached -at the cart level. - -quantity - -integer - -The number of these items being purchased. - -=head2 Method Dictionary - -The following methods will be available from the WebGUI::Shop::CartItem -class. - -Method - -Description - -create - -Creates a new cart item object. Returns a reference to the object. - -param: session EE<128>E<147> a reference to the current session - -param: cartId EE<128>E<147> the unique id of the cart - -param: asset EE<128>E<147> A reference to the asset you wish to -create. - -param: quantity EE<128>E<147> the quantity of sku to purchase - -get - -Returns a duplicated hash reference of this object's data. - -param: any field EE<128>E<147> returns the value of a field -rather than the hash reference - -getAllInCart - -Returns an array reference of WebGUI::Shop::Cart::Item objects. - -param: session EE<128>E<147> the session object - -param: cartId EE<128>E<147> the unique id of the cart you'd like -to retrieve the objects of - -getSku - -Returns an instanciated WebGUI::Asset::Sku object for this cart item. - -new - -Instanciates a cart item based upon a cartId and assetId. - -param: session EE<128>E<147> the session object - -param: cartId EE<128>E<147> the unique id for this cart - -param: assetId EE<128>E<147> the unique id of an skue contained -in the cart - -remove - -Removes an item from the cart. - -param: assetId EE<128>E<147> the unique id of the asset to be -removed - -update - -Updates an item in the cart. - -param: assetId EE<128>E<147> the unique id of the sku to be -updated - -param: hashRef EE<128>E<147> a hash reference of the things that -might be updated, including quanity, shippingAddressId, and options. - =head1 Coupon Coupons (sometimes called promotional codes) are a way to apply