WAStoreCartConfirmation


Seaside-Examples-Store

Comment:

A component for confirming the contents of a WAStoreCart.  The caller must provide a cart instance with #cart: .  When called, it will display a summary of the items in the cart, along with two buttons: "Proceed with checkout" and "Modify cart".  Answers true if the user presses the first button, false if the user presses the seecond.  Used by WAStoreTask>>confirmContentsOfCart.

Hierarchy:

ProtoObject
Object
WAPresenter
WAComponent
WAStoreCartConfirmation

Summary:

instance variables:

cart

methods:

instance class
as yet unclassified no messages

Detail:

instance variables:

cart

instance methods:

as yet unclassified
cart: aCart

	cart _ aCart
renderContentOn: html

	html attributes border: 1.
	html table: [
		cart countsAndItems do:
			[:assoc | |count item|
			count _ assoc key.
			item _ assoc value.
			html tableHeadings: #(Item Price Count Total).
			html attributes align: #right.
			html tableRow: [
				html tableData: item title.
				html tableData: item price printStringAsCents.
				html tableData: count asString.
				html tableData: (item price * count) printStringAsCents.
			]].
		html attributes align: #right.
		html tableRowWith: [html bold: cart totalPrice printStringAsCents] span: 4.
	].
	html paragraph.
	html form: [
		html submitButtonWithAction: [self answer: true] text: 'Proceed with checkout'.
		html break.
		html submitButtonWithAction: [self answer: false] text: 'Modify my order'.
	]

class methods:

^top


- made by Dandelion -