Class Mage_Sales_Model_Order
Order model
Supported events: sales_order_load_after sales_order_save_before sales_order_save_after sales_order_delete_before sales_order_delete_after
- Varien_Object
- Mage_Core_Model_Abstract
- Mage_Sales_Model_Abstract
- Mage_Sales_Model_Order
Category: Mage
Copyright: Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
License: Open Software License (OSL 3.0)
Author: Magento Core Team <core@magentocommerce.com>
Located at code/core/Mage/Sales/Model/Order.php
protected
|
|
protected
Varien_Object
|
|
public
|
|
public
boolean|null
|
|
public
|
#
setActionFlag( string $action, boolean $flag )
Set can flag value for action (edit, unhold, etc...) |
public
boolean
|
|
public
|
|
public
|
|
public
|
#
loadByAttribute( string $attribute, string $value )
Load order by custom attribute value. Attribute value should be unique |
public
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
#
canReorderIgnoreSalable( )
Check the ability to reorder ignoring the availability in stock or status of the ordered products |
protected
boolean
|
|
public
boolean
|
#
isPaymentReview( )
Check whether the payment is in payment review state In this state order cannot be normally processed. Possible actions can be:
|
public
boolean
|
|
public
boolean
|
#
canFetchPaymentReviewUpdate( )
Check whether there can be a transaction update fetched for payment in review state |
public
|
|
protected
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
setState( string $state, string|boolean $status = false, string $comment = '', boolean $isCustomerNotified = null )
Order state setter. If status is specified, will add order status history with specified comment the setData() cannot be overriden because of compatibility issues with resource model |
protected
|
#
_setState( string $state, string|boolean $status = false, string $comment = '', boolean $isCustomerNotified = null, mixed $shouldProtectState = false )
Order state protected setter. By default allows to set any state. Can also update status to default or specified value Сomplete and closed states are encapsulated intentionally, see the _checkState() |
public
boolean
|
|
public
string
|
|
public
|
|
public
|
#
setHistoryEntityName( string $entityName )
Overrides entity id, which will be saved to comments history status |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
registerCancellation( string $comment = '', boolean $graceful = true )
Prepare order totals to cancellation |
public
array
|
|
public
boolean|float|
|
|
public
string|Varien_Object
|
|
public
|
|
public
|
#
sendOrderUpdateEmail( boolean $notifyCustomer = true, string $comment = '' )
Send email with order update information |
protected
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
getParentItemsRandomCollection( integer $limit = 1 )
Get random items collection without related children |
protected
|
#
_getItemsRandomCollection( integer $limit, boolean $nonChildrenOnly = false )
Get random items collection with or without related children |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
boolean
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
array
|
|
public
array
|
|
public
|
|
public
|
#
addStatusHistory(
Set the order status history object and the order object to each other Adds the object to the status history collection, which is automatically saved when the order is saved. See the entity_id attribute backend model. Or the history record can be saved standalone after this. |
public
string
|
|
public
|
|
public
string
|
#
formatPrice( float $price, boolean $addBrackets = false )
Get formated price value including order currency rate to order website currency |
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
float
|
|
public
float
|
|
public
|
|
public
unknown
|
|
public
unknown
|
|
public
unknown
|
|
public
unknown
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
array
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
protected
|
|
protected
|
|
protected
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
prepareInvoice( mixed $qtys = array() )
Create new invoice with maximum qty for invoice for each item |
public
|
#
prepareShipment( mixed $qtys = array() )
Create new shipment with maximum qty for shipping for each item |
public
boolean
|
|
protected
|
getCreatedAtDate(),
getCreatedAtStoreDate()
|
string |
ENTITY
|
'order' |
|
string |
XML_PATH_EMAIL_TEMPLATE
|
'sales_email/order/template' |
#
XML configuration paths |
string |
XML_PATH_EMAIL_GUEST_TEMPLATE
|
'sales_email/order/guest_template' |
|
string |
XML_PATH_EMAIL_IDENTITY
|
'sales_email/order/identity' |
|
string |
XML_PATH_EMAIL_COPY_TO
|
'sales_email/order/copy_to' |
|
string |
XML_PATH_EMAIL_COPY_METHOD
|
'sales_email/order/copy_method' |
|
string |
XML_PATH_EMAIL_ENABLED
|
'sales_email/order/enabled' |
|
string |
XML_PATH_UPDATE_EMAIL_TEMPLATE
|
'sales_email/order_comment/template' |
|
string |
XML_PATH_UPDATE_EMAIL_GUEST_TEMPLATE
|
'sales_email/order_comment/guest_template' |
|
string |
XML_PATH_UPDATE_EMAIL_IDENTITY
|
'sales_email/order_comment/identity' |
|
string |
XML_PATH_UPDATE_EMAIL_COPY_TO
|
'sales_email/order_comment/copy_to' |
|
string |
XML_PATH_UPDATE_EMAIL_COPY_METHOD
|
'sales_email/order_comment/copy_method' |
|
string |
XML_PATH_UPDATE_EMAIL_ENABLED
|
'sales_email/order_comment/enabled' |
|
string |
STATE_NEW
|
'new' |
#
Order states |
string |
STATE_PENDING_PAYMENT
|
'pending_payment' |
|
string |
STATE_PROCESSING
|
'processing' |
|
string |
STATE_COMPLETE
|
'complete' |
|
string |
STATE_CLOSED
|
'closed' |
|
string |
STATE_CANCELED
|
'canceled' |
|
string |
STATE_HOLDED
|
'holded' |
|
string |
STATE_PAYMENT_REVIEW
|
'payment_review' |
|
string |
STATUS_FRAUD
|
'fraud' |
#
Order statuses |
string |
ACTION_FLAG_CANCEL
|
'cancel' |
#
Order flags |
string |
ACTION_FLAG_HOLD
|
'hold' |
|
string |
ACTION_FLAG_UNHOLD
|
'unhold' |
|
string |
ACTION_FLAG_EDIT
|
'edit' |
|
string |
ACTION_FLAG_CREDITMEMO
|
'creditmemo' |
|
string |
ACTION_FLAG_INVOICE
|
'invoice' |
|
string |
ACTION_FLAG_REORDER
|
'reorder' |
|
string |
ACTION_FLAG_SHIP
|
'ship' |
|
string |
ACTION_FLAG_COMMENT
|
'comment' |
|
string |
REPORT_DATE_TYPE_CREATED
|
'created' |
#
Report date types |
string |
REPORT_DATE_TYPE_UPDATED
|
'updated' |
|
string |
HISTORY_ENTITY_NAME
|
'order' |
protected
string
|
$_eventPrefix | 'sales_order' |
#
Prefix of model events names |
protected
string
|
$_eventObject | 'order' |
#
Parameter name in event |
protected
mixed
|
$_addresses | null |
|
protected
mixed
|
$_items | null |
|
protected
mixed
|
$_payments | null |
|
protected
mixed
|
$_statusHistory | null |
|
protected
mixed
|
$_invoices |
|
|
protected
mixed
|
$_tracks |
|
|
protected
mixed
|
$_shipments |
|
|
protected
mixed
|
$_creditmemos |
|
|
protected
array
|
$_relatedObjects | array() |
|
protected
mixed
|
$_orderCurrency | null |
|
protected
mixed
|
$_baseCurrency | null |
|
protected
array
|
$_actionFlag | array() |
#
Array of action flags for canUnhold, canEdit, etc. |
protected
boolean
|
$_canSendNewEmailFlag | true |
#
Flag: if after order placing we can send new email to the customer. |
protected
string
|
$_historyEntityName |
|
$_cacheTag,
$_dataSaveAllowed,
$_isObjectNew,
$_resource,
$_resourceCollectionName,
$_resourceName
|