Class: Order
Source Location: /code/order/Order.php
DataObject
|
--Order
Order, created as soon as a user adds a Product to their cart, the cart is actually an Order with status of 'Cart'. Has many Items and can have Modifications which might represent a Modifier like shipping, tax, coupon codes.
Author(s):
Version:
Copyright:
- Copyright (c) 2011, Frank Mullenger
|
|
|
|
Class Details
Class Variables
Class Methods
static method delete_abandoned [line 864]
static Void delete_abandoned(
)
|
|
Delete abandoned carts according to the Order timeout. This will release the stock in the carts back to the shop. Can be run from a cron job task, also run on Product, Cart and Checkout pages so that cron job is not necessary.
Tags:
static method get_timeout [line 853]
static String get_timeout(
)
|
|
Get the order timeout, for managing stock levels.
Tags:
static method set_timeout [line 844]
static void set_timeout(
String
$interval)
|
|
Set order timeout, how long the cart will remain after abandoned. e.g: A cart is considered abandoned 1 hour after the last page request and will be deleted thereby releasing the stock in the cart back to the system.
Tags:
Parameters:
method addAddressesAtCheckout [line 653]
void addAddressesAtCheckout(
Array
$data)
|
|
Add addresses to this Order at the checkout.
Parameters:
method addItem [line 476]
void addItem(
DataObject
$product, [
$quantity = 1], [DataObjectSet
$productOptions = null])
|
|
Add an item to the order representing the product, if an item for this product exists increase the quantity. Update the Order total afterward.
Parameters:
method addModifiersAtCheckout [line 631]
void addModifiersAtCheckout(
Array
$data)
|
|
Save modifiers for this Order at the checkout process.
Parameters:
method augmentDatabase [line 901]
Testing to add auto increment to table
Tags:
method BillingAddress [line 720]
Retrieve the billing Address for this Order.
method canCreate [line 220]
Boolean canCreate(
[
$member = null])
|
|
Prevent orders from being created in the CMS
Tags:
Parameters:
method canDelete [line 230]
Boolean canDelete(
[
$member = null])
|
|
Prevent orders from being deleted in the CMS
Tags:
Parameters:
method delete [line 795]
Delete this data object. $this->onBeforeDelete() gets called. Note that in Versioned objects, both Stage and Live will be deleted.
Tags:
method findIdenticalItem [line 533]
DataObject findIdenticalItem(
DatObject
$product, DataObjectSet
$productOptions)
|
|
Find an identical item in the order/cart, item is identical if the productID, version and the options for the item are the same. Used to increase quantity of items that already exist in the cart/Order.
Parameters:
method getCMSActions [line 313]
FieldSet getCMSActions(
)
|
|
Set custom CMS actions which call OrderAdmin_RecordController actions of the same name
Tags:
method getCMSFields [line 240]
Set CMS fields for viewing this Order in the CMS Cannot change status of an order in the CMS
Tags:
method getDefaultSearchContext [line 206]
Get a new date range search context for filtering the search results in OrderAdmin
Tags:
method getPaid [line 465]
If the order has been totally paid.
Tags:
method Link [line 333]
Generate the URL for viewing this order on the frontend
Tags:
method onAfterPayment [line 401]
Processed if payment is successfully written, send a receipt to the customer TODO move sending receipts to CheckoutPage::ProcessOrder()
method onBeforeWrite [line 891]
Set the LastActive time when Order first created. (non-PHPdoc)
method Payments [line 344]
DataObjectSet Payments(
)
|
|
Helper to get Payments that are made against this Order
Tags:
method Products [line 593]
DataObjectSet Products(
)
|
|
Retreive products for this order from the order Items.
Tags:
method scaffoldSearchFields [line 187]
FieldSet scaffoldSearchFields(
)
|
|
Filters for order admin area search.
method sendNotification [line 430]
Send an order notification to admin if one has not already been sent.
Tags:
method sendReceipt [line 416]
Send a receipt if one has not already been sent.
Tags:
method ShippingAddress [line 736]
Retrieve the shipping Address for this Order.
method SummaryOfPaymentStatus [line 607]
String SummaryOfPaymentStatus(
)
|
|
Helper to summarize payment status for an order.
Tags:
method SummaryOfTotal [line 323]
Helper to get a nicely formatted total of the order
Tags:
method TotalOutstanding [line 354]
Money TotalOutstanding(
)
|
|
Calculate the total outstanding for this order that remains to be paid, all payments except 'Failure' payments are considered
Tags:
method TotalPaid [line 379]
Calculate the total paid for this order, only 'Success' payments are considered.
Tags:
method updatePaymentStatus [line 446]
void updatePaymentStatus(
)
|
|
Update the order payment status after Payment is made.
Tags:
method updateTotal [line 565]
Go through items and modifiers and update cart total Had to use DataObject::get() to retrieve Items because $this->Items() was not returning any items after first call to $this->addItem().
Tags:
method validate [line 785]
By default Orders are always valid
method validateForCart [line 753]
ValidationResult validateForCart(
)
|
|
Valdiate this Order for use in Validators at checkout. Makes sure Items exist and each Item is valid.
Class Constants
|
|