\Order
Order objects track all the details of an order and if they were completed or not.
Makes use of permissions provider to lock out users who have not got the
relevent COMMERCE permissions for:
VIEW
EDIT
DELETE
Any user can create an order (this allows us to support "guest" users).
- Author: morven
Synopsis
class Order
extends DataObject
implements
PermissionProvider
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $casting = ;
- private static array $defaults = ;
- private static array $summary_fields = ;
- private static array $extensions = ;
- private static string $default_sort = "Created DESC";
- // methods
- public void getCMSFields()
- public void getBillingAddress()
- public void getDeliveryAddress()
- public void hasDiscount()
- public Decimal getSubTotal()
- public Decimal getTaxTotal()
- public Decimal getPostage()
- public Decimal getTotal()
- public string getItemSummary()
- public void getTranslatedStatus()
- protected void generate_order_number()
- public void onBeforeWrite()
- public void onBeforeDelete()
- public void onAfterWrite()
- public void onAfterDelete()
- public void providePermissions()
- public Boolean canView()
- public Boolean canCreate()
- public Boolean canEdit()
- public Boolean canDelete()
Hierarchy
Extends
- DataObject
Implements
- PermissionProvider
Members
private
- $casting
- $db
- $default_sort
- $defaults
- $extensions
- $has_many
- $has_one
- $summary_fields
Methods
protected
public
- canCreate() — Anyone can create orders, even guest users
- canDelete() — No one should be able to delete an order once it has been created
- canEdit() — Only users with EDIT admin rights can view an order
- canView() — Only order creators or users with VIEW admin rights can view
- getBillingAddress()
- getCMSFields()
- getDeliveryAddress()
- getItemSummary() — Return a list string summarising each item in this order
- getPostage() — Get the postage cost for this order
- getSubTotal() — Total values of items in this order (without any tax)
- getTaxTotal() — Total values of items in this order
- getTotal() — Total of order including postage
- getTranslatedStatus()
- hasDiscount()
- onAfterDelete() — API Callback after this object is removed from to the DB
- onAfterWrite() — API Callback after this object is written to the DB
- onBeforeDelete() — API Callback before this object is removed from to the DB
- onBeforeWrite() — API Callback before this object is written to the DB
- providePermissions()