Sunnysideup\Ecommerce\Pages\CartPageController
Synopsis
class CartPageController
extends PageController
{
- // members
- protected ArrayList $actionLinks;
- protected bool $workedOutMessagesAndActions = false;
- protected Order $currentOrder;
- protected bool $overrideCanView = false;
- protected bool $showCreateAccountForm = false;
- private static string $session_code = 'EcommerceCartPageMessage';
- private static array $allowed_actions = ;
- private string $message = '';
- // methods
- public static void set_message()
- public void showorder()
- public array share()
- public array loadorder()
- public array saveorder()
- public array deleteorder()
- public array startneworder()
- public null|ArrayList ActionLinks()
- public string Message()
- public DataObject Order()
- public bool CanEditOrder()
- public bool CurrentOrderIsInCart()
- public bool ShowCreateAccountForm()
- public ShopAccountForm CreateAccountForm()
- protected void init()
- protected void setRetrievalOrderID()
- protected void clearRetrievalOrderID()
- protected void workOutMessagesAndActions()
- protected void isCartPage()
- protected bool isCheckoutPage()
- protected bool isOrderConfirmationPage()
- protected bool onlyShowSubmittedOrders()
- protected bool onlyShowUnsubmittedOrders()
Hierarchy
Extends
- PageController
Tasks
Line | Task |
---|---|
+ | : check if we need this....! |
129+ | : do we still need loadorder controller method???? |
Members
private
- $allowed_actions
- $message
—
string
Message shown (e.g. no current order, could not find order, order updated, etc...). - $session_code — string
protected
- $actionLinks
—
SilverStripe\ORM\ArrayList
This ArraList holds DataObjects with a Link and Title each.... - $currentOrder
—
Sunnysideup\Ecommerce\Model\Order
order currently being shown on this page. - $overrideCanView
—
Sunnysideup\Ecommerce\Pages\bool
show the order even if canView returns false. - $showCreateAccountForm — Sunnysideup\Ecommerce\Pages\bool
- $workedOutMessagesAndActions
—
Sunnysideup\Ecommerce\Pages\bool
to ensure messages and actions links are only worked out once...
Methods
protected
- clearRetrievalOrderID() — we clear the retrieval Order ID.
- init()
- isCartPage()
- isCheckoutPage() — Is this a CheckoutPage or is it another type (CartPage / OrderConfirmationPage)?
- isOrderConfirmationPage() — Is this a OrderConfirmationPage or is it another type (CartPage / CheckoutPage)?
- onlyShowSubmittedOrders() — Can this page only show Submitted Orders (e.g. OrderConfirmationPage) ?
- onlyShowUnsubmittedOrders() — Can this page only show Unsubmitted Orders (e.g. CartPage) ?
- setRetrievalOrderID() — We set sesssion ID for retrieval of order in non cart setting.
- workOutMessagesAndActions() — work out the options for the user.
public
- ActionLinks() — This returns a ArraList, each dataobject has two vars: Title and Link.
- CanEditOrder()
- CreateAccountForm() — Returns the CreateAccountForm.
- CurrentOrderIsInCart() — Tells you if the order you are viewing at the moment is also in the cart.
- Message()
- Order()
- ShowCreateAccountForm() — Do we need to show the Create Account Form?
- deleteorder() — Delete the currently viewed order.
- loadorder() — Loads either the "current order""into the shopping cart.
- saveorder() — save the order to a member. If no member exists then create the member first using the ShopAccountForm.
- set_message()
- showorder()
- startneworder() — Start a new order.