Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
Order Class Reference
Inheritance diagram for Order:
AbstractModel EntityInterface OrderInterface AbstractExtensibleModel ExtensibleDataInterface AbstractModel CustomAttributesDataInterface DataObject ExtensibleDataInterface

Public Member Functions

 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\Order\Config $orderConfig, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory $orderItemCollectionFactory, \Magento\Catalog\Model\Product\Visibility $productVisibility, \Magento\Sales\Api\InvoiceManagementInterface $invoiceManagement, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Eav\Model\Config $eavConfig, \Magento\Sales\Model\Order\Status\HistoryFactory $orderHistoryFactory, \Magento\Sales\Model\ResourceModel\Order\Address\CollectionFactory $addressCollectionFactory, \Magento\Sales\Model\ResourceModel\Order\Payment\CollectionFactory $paymentCollectionFactory, \Magento\Sales\Model\ResourceModel\Order\Status\History\CollectionFactory $historyCollectionFactory, \Magento\Sales\Model\ResourceModel\Order\Invoice\CollectionFactory $invoiceCollectionFactory, \Magento\Sales\Model\ResourceModel\Order\Shipment\CollectionFactory $shipmentCollectionFactory, \Magento\Sales\Model\ResourceModel\Order\Creditmemo\CollectionFactory $memoCollectionFactory, \Magento\Sales\Model\ResourceModel\Order\Shipment\Track\CollectionFactory $trackCollectionFactory, \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $salesOrderCollectionFactory, PriceCurrencyInterface $priceCurrency, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productListFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[], ResolverInterface $localeResolver=null)
 
 unsetData ($key=null)
 
 getActionFlag ($action)
 
 setActionFlag ($action, $flag)
 
 getCanSendNewEmailFlag ()
 
 setCanSendNewEmailFlag ($flag)
 
 loadByIncrementId ($incrementId)
 
 loadByIncrementIdAndStoreId ($incrementId, $storeId)
 
 loadByAttribute ($attribute, $value)
 
 getStore ()
 
 canCancel ()
 
 canVoidPayment ()
 
 canInvoice ()
 
 canCreditmemo ()
 
 canHold ()
 
 canUnhold ()
 
 canComment ()
 
 canShip ()
 
 canEdit ()
 
 canReorder ()
 
 canReorderIgnoreSalable ()
 
 isPaymentReview ()
 
 canReviewPayment ()
 
 canFetchPaymentReviewUpdate ()
 
 getConfig ()
 
 getPayment ()
 
 setBillingAddress (\Magento\Sales\Api\Data\OrderAddressInterface $address=null)
 
 setShippingAddress (\Magento\Sales\Api\Data\OrderAddressInterface $address=null)
 
 getBillingAddress ()
 
 getShippingAddress ()
 
 setState ($state)
 
 getStatusLabel ()
 
 addStatusToHistory ($status, $comment='', $isCustomerNotified=false)
 
 addStatusHistoryComment ($comment, $status=false)
 
 addCommentToStatusHistory ($comment, $status=false, $isVisibleOnFront=false)
 
 setHistoryEntityName ($entityName)
 
 getEntityType ()
 
 place ()
 
 hold ()
 
 unhold ()
 
 cancel ()
 
 isFraudDetected ()
 
 registerCancellation ($comment='', $graceful=true)
 
 getTrackingNumbers ()
 
 getShippingMethod ($asObject=false)
 
 getAddressesCollection ()
 
 getAddressById ($addressId)
 
 addAddress (\Magento\Sales\Model\Order\Address $address)
 
 getItemsCollection ($filterByTypes=[], $nonChildrenOnly=false)
 
 getParentItemsRandomCollection ($limit=1)
 
 getAllItems ()
 
 getAllVisibleItems ()
 
 getItemById ($itemId)
 
 getItemByQuoteItemId ($quoteItemId)
 
 addItem (\Magento\Sales\Model\Order\Item $item)
 
 getPaymentsCollection ()
 
 getAllPayments ()
 
 getPaymentById ($paymentId)
 
 setPayment (\Magento\Sales\Api\Data\OrderPaymentInterface $payment=null)
 
 getStatusHistoryCollection ()
 
 getAllStatusHistory ()
 
 getVisibleStatusHistory ()
 
 getStatusHistoryById ($statusId)
 
 addStatusHistory (\Magento\Sales\Model\Order\Status\History $history)
 
 getRealOrderId ()
 
 getOrderCurrency ()
 
 formatPrice ($price, $addBrackets=false)
 
 formatPricePrecision ($price, $precision, $addBrackets=false)
 
 formatPriceTxt ($price)
 
 getBaseCurrency ()
 
 formatBasePrice ($price)
 
 formatBasePricePrecision ($price, $precision)
 
 isCurrencyDifferent ()
 
 getTotalDue ()
 
 getBaseTotalDue ()
 
 getData ($key='', $index=null)
 
 getInvoiceCollection ()
 
 setInvoiceCollection (InvoiceCollection $invoices)
 
 getShipmentsCollection ()
 
 getCreditmemosCollection ()
 
 getTracksCollection ()
 
 hasInvoices ()
 
 hasShipments ()
 
 hasCreditmemos ()
 
 getRelatedObjects ()
 
 getCustomerName ()
 
 addRelatedObject (\Magento\Framework\Model\AbstractModel $object)
 
 getCreatedAtFormatted ($format)
 
 getEmailCustomerNote ()
 
 getStoreGroupName ()
 
 reset ()
 
 getIsNotVirtual ()
 
 prepareInvoice ($qtys=[])
 
 isCanceled ()
 
 getIncrementId ()
 
 getItems ()
 
 setItems ($items)
 
 getAddresses ()
 
 getStatusHistories ()
 
 getExtensionAttributes ()
 
 setExtensionAttributes (\Magento\Sales\Api\Data\OrderExtensionInterface $extensionAttributes)
 
 getAdjustmentNegative ()
 
 getAdjustmentPositive ()
 
 getAppliedRuleIds ()
 
 getBaseAdjustmentNegative ()
 
 getBaseAdjustmentPositive ()
 
 getBaseCurrencyCode ()
 
 getBaseDiscountAmount ()
 
 getBaseDiscountCanceled ()
 
 getBaseDiscountInvoiced ()
 
 getBaseDiscountRefunded ()
 
 getBaseGrandTotal ()
 
 getBaseDiscountTaxCompensationAmount ()
 
 getBaseDiscountTaxCompensationInvoiced ()
 
 getBaseDiscountTaxCompensationRefunded ()
 
 getBaseShippingAmount ()
 
 getBaseShippingCanceled ()
 
 getBaseShippingDiscountAmount ()
 
 getBaseShippingDiscountTaxCompensationAmnt ()
 
 getBaseShippingInclTax ()
 
 getBaseShippingInvoiced ()
 
 getBaseShippingRefunded ()
 
 getBaseShippingTaxAmount ()
 
 getBaseShippingTaxRefunded ()
 
 getBaseSubtotal ()
 
 getBaseSubtotalCanceled ()
 
 getBaseSubtotalInclTax ()
 
 getBaseSubtotalInvoiced ()
 
 getBaseSubtotalRefunded ()
 
 getBaseTaxAmount ()
 
 getBaseTaxCanceled ()
 
 getBaseTaxInvoiced ()
 
 getBaseTaxRefunded ()
 
 getBaseTotalCanceled ()
 
 getBaseTotalInvoiced ()
 
 getBaseTotalInvoicedCost ()
 
 getBaseTotalOfflineRefunded ()
 
 getBaseTotalOnlineRefunded ()
 
 getBaseTotalPaid ()
 
 getBaseTotalQtyOrdered ()
 
 getBaseTotalRefunded ()
 
 getBaseToGlobalRate ()
 
 getBaseToOrderRate ()
 
 getBillingAddressId ()
 
 getCanShipPartially ()
 
 getCanShipPartiallyItem ()
 
 getCouponCode ()
 
 getCreatedAt ()
 
 setCreatedAt ($createdAt)
 
 getCustomerDob ()
 
 getCustomerEmail ()
 
 getCustomerFirstname ()
 
 getCustomerGender ()
 
 getCustomerGroupId ()
 
 getCustomerId ()
 
 getCustomerIsGuest ()
 
 getCustomerLastname ()
 
 getCustomerMiddlename ()
 
 getCustomerNote ()
 
 getCustomerNoteNotify ()
 
 getCustomerPrefix ()
 
 getCustomerSuffix ()
 
 getCustomerTaxvat ()
 
 getDiscountAmount ()
 
 getDiscountCanceled ()
 
 getDiscountDescription ()
 
 getDiscountInvoiced ()
 
 getDiscountRefunded ()
 
 getEditIncrement ()
 
 getEmailSent ()
 
 getExtCustomerId ()
 
 getExtOrderId ()
 
 getForcedShipmentWithInvoice ()
 
 getGlobalCurrencyCode ()
 
 getGrandTotal ()
 
 getDiscountTaxCompensationAmount ()
 
 getDiscountTaxCompensationInvoiced ()
 
 getDiscountTaxCompensationRefunded ()
 
 getHoldBeforeState ()
 
 getHoldBeforeStatus ()
 
 getIsVirtual ()
 
 getOrderCurrencyCode ()
 
 getOriginalIncrementId ()
 
 getPaymentAuthorizationAmount ()
 
 getPaymentAuthExpiration ()
 
 getProtectCode ()
 
 getQuoteAddressId ()
 
 getQuoteId ()
 
 getRelationChildId ()
 
 getRelationChildRealId ()
 
 getRelationParentId ()
 
 getRelationParentRealId ()
 
 getRemoteIp ()
 
 getShippingAmount ()
 
 getShippingCanceled ()
 
 getShippingDescription ()
 
 getShippingDiscountAmount ()
 
 getShippingDiscountTaxCompensationAmount ()
 
 getShippingInclTax ()
 
 getShippingInvoiced ()
 
 getShippingRefunded ()
 
 getShippingTaxAmount ()
 
 getShippingTaxRefunded ()
 
 getState ()
 
 getStatus ()
 
 getStoreCurrencyCode ()
 
 getStoreId ()
 
 getStoreName ()
 
 getStoreToBaseRate ()
 
 getStoreToOrderRate ()
 
 getSubtotal ()
 
 getSubtotalCanceled ()
 
 getSubtotalInclTax ()
 
 getSubtotalInvoiced ()
 
 getSubtotalRefunded ()
 
 getTaxAmount ()
 
 getTaxCanceled ()
 
 getTaxInvoiced ()
 
 getTaxRefunded ()
 
 getTotalCanceled ()
 
 getTotalInvoiced ()
 
 getTotalItemCount ()
 
 getTotalOfflineRefunded ()
 
 getTotalOnlineRefunded ()
 
 getTotalPaid ()
 
 getTotalQtyOrdered ()
 
 getTotalRefunded ()
 
 getUpdatedAt ()
 
 getWeight ()
 
 getXForwardedFor ()
 
 setStatusHistories (array $statusHistories=null)
 
 setStatus ($status)
 
 setCouponCode ($code)
 
 setProtectCode ($code)
 
 setShippingDescription ($description)
 
 setIsVirtual ($isVirtual)
 
 setStoreId ($id)
 
 setCustomerId ($id)
 
 setBaseDiscountAmount ($amount)
 
 setBaseDiscountCanceled ($baseDiscountCanceled)
 
 setBaseDiscountInvoiced ($baseDiscountInvoiced)
 
 setBaseDiscountRefunded ($baseDiscountRefunded)
 
 setBaseGrandTotal ($amount)
 
 setBaseShippingAmount ($amount)
 
 setBaseShippingCanceled ($baseShippingCanceled)
 
 setBaseShippingInvoiced ($baseShippingInvoiced)
 
 setBaseShippingRefunded ($baseShippingRefunded)
 
 setBaseShippingTaxAmount ($amount)
 
 setBaseShippingTaxRefunded ($baseShippingTaxRefunded)
 
 setBaseSubtotal ($amount)
 
 setBaseSubtotalCanceled ($baseSubtotalCanceled)
 
 setBaseSubtotalInvoiced ($baseSubtotalInvoiced)
 
 setBaseSubtotalRefunded ($baseSubtotalRefunded)
 
 setBaseTaxAmount ($amount)
 
 setBaseTaxCanceled ($baseTaxCanceled)
 
 setBaseTaxInvoiced ($baseTaxInvoiced)
 
 setBaseTaxRefunded ($baseTaxRefunded)
 
 setBaseToGlobalRate ($rate)
 
 setBaseToOrderRate ($rate)
 
 setBaseTotalCanceled ($baseTotalCanceled)
 
 setBaseTotalInvoiced ($baseTotalInvoiced)
 
 setBaseTotalInvoicedCost ($baseTotalInvoicedCost)
 
 setBaseTotalOfflineRefunded ($baseTotalOfflineRefunded)
 
 setBaseTotalOnlineRefunded ($baseTotalOnlineRefunded)
 
 setBaseTotalPaid ($baseTotalPaid)
 
 setBaseTotalQtyOrdered ($baseTotalQtyOrdered)
 
 setBaseTotalRefunded ($baseTotalRefunded)
 
 setDiscountAmount ($amount)
 
 setDiscountCanceled ($discountCanceled)
 
 setDiscountInvoiced ($discountInvoiced)
 
 setDiscountRefunded ($discountRefunded)
 
 setGrandTotal ($amount)
 
 setShippingAmount ($amount)
 
 setShippingCanceled ($shippingCanceled)
 
 setShippingInvoiced ($shippingInvoiced)
 
 setShippingRefunded ($shippingRefunded)
 
 setShippingTaxAmount ($amount)
 
 setShippingTaxRefunded ($shippingTaxRefunded)
 
 setStoreToBaseRate ($rate)
 
 setStoreToOrderRate ($rate)
 
 setSubtotal ($amount)
 
 setSubtotalCanceled ($subtotalCanceled)
 
 setSubtotalInvoiced ($subtotalInvoiced)
 
 setSubtotalRefunded ($subtotalRefunded)
 
 setTaxAmount ($amount)
 
 setTaxCanceled ($taxCanceled)
 
 setTaxInvoiced ($taxInvoiced)
 
 setTaxRefunded ($taxRefunded)
 
 setTotalCanceled ($totalCanceled)
 
 setTotalInvoiced ($totalInvoiced)
 
 setTotalOfflineRefunded ($totalOfflineRefunded)
 
 setTotalOnlineRefunded ($totalOnlineRefunded)
 
 setTotalPaid ($totalPaid)
 
 setTotalQtyOrdered ($totalQtyOrdered)
 
 setTotalRefunded ($totalRefunded)
 
 setCanShipPartially ($flag)
 
 setCanShipPartiallyItem ($flag)
 
 setCustomerIsGuest ($customerIsGuest)
 
 setCustomerNoteNotify ($customerNoteNotify)
 
 setBillingAddressId ($id)
 
 setCustomerGroupId ($id)
 
 setEditIncrement ($editIncrement)
 
 setEmailSent ($emailSent)
 
 setForcedShipmentWithInvoice ($forcedShipmentWithInvoice)
 
 setPaymentAuthExpiration ($paymentAuthExpiration)
 
 setQuoteAddressId ($id)
 
 setQuoteId ($id)
 
 setAdjustmentNegative ($adjustmentNegative)
 
 setAdjustmentPositive ($adjustmentPositive)
 
 setBaseAdjustmentNegative ($baseAdjustmentNegative)
 
 setBaseAdjustmentPositive ($baseAdjustmentPositive)
 
 setBaseShippingDiscountAmount ($amount)
 
 setBaseSubtotalInclTax ($amount)
 
 setBaseTotalDue ($baseTotalDue)
 
 setPaymentAuthorizationAmount ($amount)
 
 setShippingDiscountAmount ($amount)
 
 setSubtotalInclTax ($amount)
 
 setTotalDue ($totalDue)
 
 setWeight ($weight)
 
 setCustomerDob ($customerDob)
 
 setIncrementId ($id)
 
 setAppliedRuleIds ($appliedRuleIds)
 
 setBaseCurrencyCode ($code)
 
 setCustomerEmail ($customerEmail)
 
 setCustomerFirstname ($customerFirstname)
 
 setCustomerLastname ($customerLastname)
 
 setCustomerMiddlename ($customerMiddlename)
 
 setCustomerPrefix ($customerPrefix)
 
 setCustomerSuffix ($customerSuffix)
 
 setCustomerTaxvat ($customerTaxvat)
 
 setDiscountDescription ($description)
 
 setExtCustomerId ($id)
 
 setExtOrderId ($id)
 
 setGlobalCurrencyCode ($code)
 
 setHoldBeforeState ($holdBeforeState)
 
 setHoldBeforeStatus ($holdBeforeStatus)
 
 setOrderCurrencyCode ($code)
 
 setOriginalIncrementId ($id)
 
 setRelationChildId ($id)
 
 setRelationChildRealId ($realId)
 
 setRelationParentId ($id)
 
 setRelationParentRealId ($realId)
 
 setRemoteIp ($remoteIp)
 
 setStoreCurrencyCode ($code)
 
 setStoreName ($storeName)
 
 setXForwardedFor ($xForwardedFor)
 
 setCustomerNote ($customerNote)
 
 setUpdatedAt ($timestamp)
 
 setTotalItemCount ($totalItemCount)
 
 setCustomerGender ($customerGender)
 
 setDiscountTaxCompensationAmount ($amount)
 
 setBaseDiscountTaxCompensationAmount ($amount)
 
 setShippingDiscountTaxCompensationAmount ($amount)
 
 setBaseShippingDiscountTaxCompensationAmnt ($amnt)
 
 setDiscountTaxCompensationInvoiced ($discountTaxCompensationInvoiced)
 
 setBaseDiscountTaxCompensationInvoiced ($baseDiscountTaxCompensationInvoiced)
 
 setDiscountTaxCompensationRefunded ($discountTaxCompensationRefunded)
 
 setBaseDiscountTaxCompensationRefunded ($baseDiscountTaxCompensationRefunded)
 
 setShippingInclTax ($amount)
 
 setBaseShippingInclTax ($amount)
 
 setShippingMethod ($shippingMethod)
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getEventObject ()
 
- Public Member Functions inherited from AbstractExtensibleModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getCustomAttributes ()
 
 getCustomAttribute ($attributeCode)
 
 setCustomAttributes (array $attributes)
 
 setCustomAttribute ($attributeCode, $attributeValue)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 setId ($value)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from OrderInterface
 getEntityId ()
 
 setEntityId ($entityId)
 
 setBillingAddress (\Magento\Sales\Api\Data\OrderAddressInterface $billingAddress=null)
 
 setPayment (\Magento\Sales\Api\Data\OrderPaymentInterface $payment=null)
 

Data Fields

const ENTITY = 'order'
 
const STATE_NEW = 'new'
 
const STATE_PENDING_PAYMENT = 'pending_payment'
 
const STATE_PROCESSING = 'processing'
 
const STATE_COMPLETE = 'complete'
 
const STATE_CLOSED = 'closed'
 
const STATE_CANCELED = 'canceled'
 
const STATE_HOLDED = 'holded'
 
const STATE_PAYMENT_REVIEW = 'payment_review'
 
const STATUS_FRAUD = 'fraud'
 
const ACTION_FLAG_CANCEL = 'cancel'
 
const ACTION_FLAG_HOLD = 'hold'
 
const ACTION_FLAG_UNHOLD = 'unhold'
 
const ACTION_FLAG_EDIT = 'edit'
 
const ACTION_FLAG_CREDITMEMO = 'creditmemo'
 
const ACTION_FLAG_INVOICE = 'invoice'
 
const ACTION_FLAG_REORDER = 'reorder'
 
const ACTION_FLAG_SHIP = 'ship'
 
const ACTION_FLAG_COMMENT = 'comment'
 
const REPORT_DATE_TYPE_CREATED = 'created'
 
const REPORT_DATE_TYPE_UPDATED = 'updated'
 
- Data Fields inherited from CustomAttributesDataInterface
const CUSTOM_ATTRIBUTES = 'custom_attributes'
 
- Data Fields inherited from ExtensibleDataInterface
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes'
 
- Data Fields inherited from OrderInterface
const ENTITY_ID = 'entity_id'
 
const STATE = 'state'
 
const STATUS = 'status'
 
const COUPON_CODE = 'coupon_code'
 
const PROTECT_CODE = 'protect_code'
 
const SHIPPING_DESCRIPTION = 'shipping_description'
 
const IS_VIRTUAL = 'is_virtual'
 
const STORE_ID = 'store_id'
 
const CUSTOMER_ID = 'customer_id'
 
const BASE_DISCOUNT_AMOUNT = 'base_discount_amount'
 
const BASE_DISCOUNT_CANCELED = 'base_discount_canceled'
 
const BASE_DISCOUNT_INVOICED = 'base_discount_invoiced'
 
const BASE_DISCOUNT_REFUNDED = 'base_discount_refunded'
 
const BASE_GRAND_TOTAL = 'base_grand_total'
 
const BASE_SHIPPING_AMOUNT = 'base_shipping_amount'
 
const BASE_SHIPPING_CANCELED = 'base_shipping_canceled'
 
const BASE_SHIPPING_INVOICED = 'base_shipping_invoiced'
 
const BASE_SHIPPING_REFUNDED = 'base_shipping_refunded'
 
const BASE_SHIPPING_TAX_AMOUNT = 'base_shipping_tax_amount'
 
const BASE_SHIPPING_TAX_REFUNDED = 'base_shipping_tax_refunded'
 
const BASE_SUBTOTAL = 'base_subtotal'
 
const BASE_SUBTOTAL_CANCELED = 'base_subtotal_canceled'
 
const BASE_SUBTOTAL_INVOICED = 'base_subtotal_invoiced'
 
const BASE_SUBTOTAL_REFUNDED = 'base_subtotal_refunded'
 
const BASE_TAX_AMOUNT = 'base_tax_amount'
 
const BASE_TAX_CANCELED = 'base_tax_canceled'
 
const BASE_TAX_INVOICED = 'base_tax_invoiced'
 
const BASE_TAX_REFUNDED = 'base_tax_refunded'
 
const BASE_TO_GLOBAL_RATE = 'base_to_global_rate'
 
const BASE_TO_ORDER_RATE = 'base_to_order_rate'
 
const BASE_TOTAL_CANCELED = 'base_total_canceled'
 
const BASE_TOTAL_INVOICED = 'base_total_invoiced'
 
const BASE_TOTAL_INVOICED_COST = 'base_total_invoiced_cost'
 
const BASE_TOTAL_OFFLINE_REFUNDED = 'base_total_offline_refunded'
 
const BASE_TOTAL_ONLINE_REFUNDED = 'base_total_online_refunded'
 
const BASE_TOTAL_PAID = 'base_total_paid'
 
const BASE_TOTAL_QTY_ORDERED = 'base_total_qty_ordered'
 
const BASE_TOTAL_REFUNDED = 'base_total_refunded'
 
const DISCOUNT_AMOUNT = 'discount_amount'
 
const DISCOUNT_CANCELED = 'discount_canceled'
 
const DISCOUNT_INVOICED = 'discount_invoiced'
 
const DISCOUNT_REFUNDED = 'discount_refunded'
 
const GRAND_TOTAL = 'grand_total'
 
const SHIPPING_AMOUNT = 'shipping_amount'
 
const SHIPPING_CANCELED = 'shipping_canceled'
 
const SHIPPING_INVOICED = 'shipping_invoiced'
 
const SHIPPING_REFUNDED = 'shipping_refunded'
 
const SHIPPING_TAX_AMOUNT = 'shipping_tax_amount'
 
const SHIPPING_TAX_REFUNDED = 'shipping_tax_refunded'
 
const STORE_TO_BASE_RATE = 'store_to_base_rate'
 
const STORE_TO_ORDER_RATE = 'store_to_order_rate'
 
const SUBTOTAL = 'subtotal'
 
const SUBTOTAL_CANCELED = 'subtotal_canceled'
 
const SUBTOTAL_INVOICED = 'subtotal_invoiced'
 
const SUBTOTAL_REFUNDED = 'subtotal_refunded'
 
const TAX_AMOUNT = 'tax_amount'
 
const TAX_CANCELED = 'tax_canceled'
 
const TAX_INVOICED = 'tax_invoiced'
 
const TAX_REFUNDED = 'tax_refunded'
 
const TOTAL_CANCELED = 'total_canceled'
 
const TOTAL_INVOICED = 'total_invoiced'
 
const TOTAL_OFFLINE_REFUNDED = 'total_offline_refunded'
 
const TOTAL_ONLINE_REFUNDED = 'total_online_refunded'
 
const TOTAL_PAID = 'total_paid'
 
const TOTAL_QTY_ORDERED = 'total_qty_ordered'
 
const TOTAL_REFUNDED = 'total_refunded'
 
const CAN_SHIP_PARTIALLY = 'can_ship_partially'
 
const CAN_SHIP_PARTIALLY_ITEM = 'can_ship_partially_item'
 
const CUSTOMER_IS_GUEST = 'customer_is_guest'
 
const CUSTOMER_NOTE_NOTIFY = 'customer_note_notify'
 
const BILLING_ADDRESS_ID = 'billing_address_id'
 
const CUSTOMER_GROUP_ID = 'customer_group_id'
 
const EDIT_INCREMENT = 'edit_increment'
 
const EMAIL_SENT = 'email_sent'
 
const FORCED_SHIPMENT_WITH_INVOICE = 'forced_shipment_with_invoice'
 
const PAYMENT_AUTH_EXPIRATION = 'payment_auth_expiration'
 
const QUOTE_ADDRESS_ID = 'quote_address_id'
 
const QUOTE_ID = 'quote_id'
 
const ADJUSTMENT_NEGATIVE = 'adjustment_negative'
 
const ADJUSTMENT_POSITIVE = 'adjustment_positive'
 
const BASE_ADJUSTMENT_NEGATIVE = 'base_adjustment_negative'
 
const BASE_ADJUSTMENT_POSITIVE = 'base_adjustment_positive'
 
const BASE_SHIPPING_DISCOUNT_AMOUNT = 'base_shipping_discount_amount'
 
const BASE_SUBTOTAL_INCL_TAX = 'base_subtotal_incl_tax'
 
const BASE_TOTAL_DUE = 'base_total_due'
 
const PAYMENT_AUTHORIZATION_AMOUNT = 'payment_authorization_amount'
 
const SHIPPING_DISCOUNT_AMOUNT = 'shipping_discount_amount'
 
const SUBTOTAL_INCL_TAX = 'subtotal_incl_tax'
 
const TOTAL_DUE = 'total_due'
 
const WEIGHT = 'weight'
 
const CUSTOMER_DOB = 'customer_dob'
 
const INCREMENT_ID = 'increment_id'
 
const APPLIED_RULE_IDS = 'applied_rule_ids'
 
const BASE_CURRENCY_CODE = 'base_currency_code'
 
const CUSTOMER_EMAIL = 'customer_email'
 
const CUSTOMER_FIRSTNAME = 'customer_firstname'
 
const CUSTOMER_LASTNAME = 'customer_lastname'
 
const CUSTOMER_MIDDLENAME = 'customer_middlename'
 
const CUSTOMER_PREFIX = 'customer_prefix'
 
const CUSTOMER_SUFFIX = 'customer_suffix'
 
const CUSTOMER_TAXVAT = 'customer_taxvat'
 
const DISCOUNT_DESCRIPTION = 'discount_description'
 
const EXT_CUSTOMER_ID = 'ext_customer_id'
 
const EXT_ORDER_ID = 'ext_order_id'
 
const GLOBAL_CURRENCY_CODE = 'global_currency_code'
 
const HOLD_BEFORE_STATE = 'hold_before_state'
 
const HOLD_BEFORE_STATUS = 'hold_before_status'
 
const ORDER_CURRENCY_CODE = 'order_currency_code'
 
const ORIGINAL_INCREMENT_ID = 'original_increment_id'
 
const RELATION_CHILD_ID = 'relation_child_id'
 
const RELATION_CHILD_REAL_ID = 'relation_child_real_id'
 
const RELATION_PARENT_ID = 'relation_parent_id'
 
const RELATION_PARENT_REAL_ID = 'relation_parent_real_id'
 
const REMOTE_IP = 'remote_ip'
 
const STORE_CURRENCY_CODE = 'store_currency_code'
 
const STORE_NAME = 'store_name'
 
const X_FORWARDED_FOR = 'x_forwarded_for'
 
const CUSTOMER_NOTE = 'customer_note'
 
const CREATED_AT = 'created_at'
 
const UPDATED_AT = 'updated_at'
 
const TOTAL_ITEM_COUNT = 'total_item_count'
 
const CUSTOMER_GENDER = 'customer_gender'
 
const DISCOUNT_TAX_COMPENSATION_AMOUNT = 'discount_tax_compensation_amount'
 
const BASE_DISCOUNT_TAX_COMPENSATION_AMOUNT = 'base_discount_tax_compensation_amount'
 
const SHIPPING_DISCOUNT_TAX_COMPENSATION_AMOUNT = 'shipping_discount_tax_compensation_amount'
 
const BASE_SHIPPING_DISCOUNT_TAX_COMPENSATION_AMNT = 'base_shipping_discount_tax_compensation_amnt'
 
const DISCOUNT_TAX_COMPENSATION_INVOICED = 'discount_tax_compensation_invoiced'
 
const BASE_DISCOUNT_TAX_COMPENSATION_INVOICED = 'base_discount_tax_compensation_invoiced'
 
const DISCOUNT_TAX_COMPENSATION_REFUNDED = 'discount_tax_compensation_refunded'
 
const BASE_DISCOUNT_TAX_COMPENSATION_REFUNDED = 'base_discount_tax_compensation_refunded'
 
const SHIPPING_INCL_TAX = 'shipping_incl_tax'
 
const BASE_SHIPPING_INCL_TAX = 'base_shipping_incl_tax'
 
const ITEMS = 'items'
 
const BILLING_ADDRESS = 'billing_address'
 
const PAYMENT = 'payment'
 
const STATUS_HISTORIES = 'status_histories'
 

Protected Member Functions

 _construct ()
 
 _canVoidOrder ()
 
 _canReorder ($ignoreSalable=false)
 
 _placePayment ()
 
 _getItemsRandomCollection ($limit, $nonChildrenOnly=false)
 
- Protected Member Functions inherited from AbstractExtensibleModel
 filterCustomAttributes ($data)
 
 initializeCustomAttributes ()
 
 convertCustomAttributeValues (array &$customAttributes)
 
 getCustomAttributesCodes ()
 
 _setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
 
 _getExtensionAttributes ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Protected Attributes

 $_eventPrefix = 'sales_order'
 
 $_eventObject = 'order'
 
 $_invoices
 
 $_tracks
 
 $_shipments
 
 $_creditmemos
 
 $_relatedObjects = []
 
 $_orderCurrency = null
 
 $_baseCurrency = null
 
 $_actionFlag = []
 
 $_canSendNewEmailFlag = true
 
 $entityType = 'order'
 
 $_storeManager
 
 $_orderConfig
 
 $productRepository
 
 $productListFactory
 
 $_orderItemCollectionFactory
 
 $_productVisibility
 
 $invoiceManagement
 
 $_currencyFactory
 
 $_orderHistoryFactory
 
 $_addressCollectionFactory
 
 $_paymentCollectionFactory
 
 $_historyCollectionFactory
 
 $_invoiceCollectionFactory
 
 $_shipmentCollectionFactory
 
 $_memoCollectionFactory
 
 $_trackCollectionFactory
 
 $salesOrderCollectionFactory
 
 $priceCurrency
 
 $timezone
 
- Protected Attributes inherited from AbstractExtensibleModel
 $extensionAttributesFactory
 
 $extensionAttributes
 
 $customAttributeFactory
 
 $customAttributesCodes = null
 
 $customAttributesChanged = false
 
- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Order model

Supported events: sales_order_load_after sales_order_save_before sales_order_save_after sales_order_delete_before sales_order_delete_after

@api @method int getGiftMessageId() @method \Magento\Sales\Model\Order setGiftMessageId(int $value) @method bool hasBillingAddressId() @method \Magento\Sales\Model\Order unsBillingAddressId() @method bool hasShippingAddressId() @method \Magento\Sales\Model\Order unsShippingAddressId() @method int getShippigAddressId() @method bool hasCustomerNoteNotify() @method bool hasForcedCanCreditmemo() @method bool getIsInProcess() @method \Magento\Customer\Model\Customer getCustomer() @method \Magento\Sales\Model\Order setSendEmail(bool $value) @SuppressWarnings(PHPMD.ExcessivePublicCount) @SuppressWarnings(PHPMD.TooManyFields) @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects)

Since
100.0.2

Definition at line 54 of file Order.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\Model\Context  $context,
\Magento\Framework\Registry  $registry,
\Magento\Framework\Api\ExtensionAttributesFactory  $extensionFactory,
AttributeValueFactory  $customAttributeFactory,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface  $timezone,
\Magento\Store\Model\StoreManagerInterface  $storeManager,
\Magento\Sales\Model\Order\Config  $orderConfig,
\Magento\Catalog\Api\ProductRepositoryInterface  $productRepository,
\Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory  $orderItemCollectionFactory,
\Magento\Catalog\Model\Product\Visibility  $productVisibility,
\Magento\Sales\Api\InvoiceManagementInterface  $invoiceManagement,
\Magento\Directory\Model\CurrencyFactory  $currencyFactory,
\Magento\Eav\Model\Config  $eavConfig,
\Magento\Sales\Model\Order\Status\HistoryFactory  $orderHistoryFactory,
\Magento\Sales\Model\ResourceModel\Order\Address\CollectionFactory  $addressCollectionFactory,
\Magento\Sales\Model\ResourceModel\Order\Payment\CollectionFactory  $paymentCollectionFactory,
\Magento\Sales\Model\ResourceModel\Order\Status\History\CollectionFactory  $historyCollectionFactory,
\Magento\Sales\Model\ResourceModel\Order\Invoice\CollectionFactory  $invoiceCollectionFactory,
\Magento\Sales\Model\ResourceModel\Order\Shipment\CollectionFactory  $shipmentCollectionFactory,
\Magento\Sales\Model\ResourceModel\Order\Creditmemo\CollectionFactory  $memoCollectionFactory,
\Magento\Sales\Model\ResourceModel\Order\Shipment\Track\CollectionFactory  $trackCollectionFactory,
\Magento\Sales\Model\ResourceModel\Order\CollectionFactory  $salesOrderCollectionFactory,
PriceCurrencyInterface  $priceCurrency,
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory  $productListFactory,
\Magento\Framework\Model\ResourceModel\AbstractResource  $resource = null,
\Magento\Framework\Data\Collection\AbstractDb  $resourceCollection = null,
array  $data = [],
ResolverInterface  $localeResolver = null 
)
Parameters
\Magento\Framework\Model\Context$context
\Magento\Framework\Registry$registry
\Magento\Framework\Api\ExtensionAttributesFactory$extensionFactory
AttributeValueFactory$customAttributeFactory
\Magento\Framework\Stdlib\DateTime\TimezoneInterface$timezone
\Magento\Store\Model\StoreManagerInterface$storeManager
Order\Config$orderConfig
\Magento\Catalog\Api\ProductRepositoryInterface$productRepository
\Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory$orderItemCollectionFactory
\Magento\Catalog\Model\Product\Visibility$productVisibility
\Magento\Sales\Api\InvoiceManagementInterface$invoiceManagement
\Magento\Directory\Model\CurrencyFactory$currencyFactory
\Magento\Eav\Model\Config$eavConfig
Order\Status\HistoryFactory$orderHistoryFactory
\Magento\Sales\Model\ResourceModel\Order\Address\CollectionFactory$addressCollectionFactory
\Magento\Sales\Model\ResourceModel\Order\Payment\CollectionFactory$paymentCollectionFactory
\Magento\Sales\Model\ResourceModel\Order\Status\History\CollectionFactory$historyCollectionFactory
\Magento\Sales\Model\ResourceModel\Order\Invoice\CollectionFactory$invoiceCollectionFactory
\Magento\Sales\Model\ResourceModel\Order\Shipment\CollectionFactory$shipmentCollectionFactory
\Magento\Sales\Model\ResourceModel\Order\Creditmemo\CollectionFactory$memoCollectionFactory
\Magento\Sales\Model\ResourceModel\Order\Shipment\Track\CollectionFactory$trackCollectionFactory
ResourceModel\Order\CollectionFactory$salesOrderCollectionFactory
PriceCurrencyInterface$priceCurrency
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory$productListFactory
\Magento\Framework\Model\ResourceModel\AbstractResource$resource
\Magento\Framework\Data\Collection\AbstractDb$resourceCollection
array$data
ResolverInterface$localeResolver@SuppressWarnings(PHPMD.ExcessiveParameterList)

Definition at line 313 of file Order.php.

342  {
343  $this->_storeManager = $storeManager;
344  $this->_orderConfig = $orderConfig;
345  $this->productRepository = $productRepository;
346  $this->productListFactory = $productListFactory;
347  $this->timezone = $timezone;
348  $this->_orderItemCollectionFactory = $orderItemCollectionFactory;
349  $this->_productVisibility = $productVisibility;
350  $this->invoiceManagement = $invoiceManagement;
351  $this->_currencyFactory = $currencyFactory;
352  $this->_eavConfig = $eavConfig;
353  $this->_orderHistoryFactory = $orderHistoryFactory;
354  $this->_addressCollectionFactory = $addressCollectionFactory;
355  $this->_paymentCollectionFactory = $paymentCollectionFactory;
356  $this->_historyCollectionFactory = $historyCollectionFactory;
357  $this->_invoiceCollectionFactory = $invoiceCollectionFactory;
358  $this->_shipmentCollectionFactory = $shipmentCollectionFactory;
359  $this->_memoCollectionFactory = $memoCollectionFactory;
360  $this->_trackCollectionFactory = $trackCollectionFactory;
361  $this->salesOrderCollectionFactory = $salesOrderCollectionFactory;
362  $this->priceCurrency = $priceCurrency;
363  $this->localeResolver = $localeResolver ?: ObjectManager::getInstance()->get(ResolverInterface::class);
364 
365  parent::__construct(
366  $context,
367  $registry,
368  $extensionFactory,
370  $resource,
371  $resourceCollection,
372  $data
373  );
374  }
$storeManager
$resource
Definition: bulk.php:12

Member Function Documentation

◆ _canReorder()

_canReorder (   $ignoreSalable = false)
protected

Retrieve order reorder availability

Parameters
bool$ignoreSalable
Returns
bool @SuppressWarnings(PHPMD.CyclomaticComplexity)

Definition at line 793 of file Order.php.

794  {
795  if ($this->canUnhold() || $this->isPaymentReview()) {
796  return false;
797  }
798 
799  if ($this->getActionFlag(self::ACTION_FLAG_REORDER) === false) {
800  return false;
801  }
802 
803  $products = [];
804  $itemsCollection = $this->getItemsCollection();
805  foreach ($itemsCollection as $item) {
806  $products[] = $item->getProductId();
807  }
808 
809  if (!empty($products)) {
810  $productsCollection = $this->productListFactory->create()
811  ->setStoreId($this->getStoreId())
812  ->addIdFilter($products)
813  ->addAttributeToSelect('status')
814  ->load();
815 
816  foreach ($itemsCollection as $item) {
817  $product = $productsCollection->getItemById($item->getProductId());
818  if (!$product) {
819  return false;
820  }
821  if (!$ignoreSalable && !$product->isSalable()) {
822  return false;
823  }
824  }
825  }
826 
827  return true;
828  }
getItemsCollection($filterByTypes=[], $nonChildrenOnly=false)
Definition: Order.php:1297

◆ _canVoidOrder()

_canVoidOrder ( )
protected

Check whether order could be canceled by states and flags

Returns
bool

Definition at line 581 of file Order.php.

582  {
583  return !($this->isCanceled() || $this->canUnhold() || $this->isPaymentReview());
584  }

◆ _construct()

_construct ( )
protected

Initialize resource model

Returns
void

Definition at line 381 of file Order.php.

382  {
383  $this->_init(\Magento\Sales\Model\ResourceModel\Order::class);
384  }

◆ _getItemsRandomCollection()

_getItemsRandomCollection (   $limit,
  $nonChildrenOnly = false 
)
protected

Get random items collection with or without related children

Parameters
int$limit
bool$nonChildrenOnly
Returns
ImportCollection

Definition at line 1334 of file Order.php.

1335  {
1336  $collection = $this->_orderItemCollectionFactory->create()
1337  ->setOrderFilter($this)
1338  ->setRandomOrder()
1339  ->setPageSize($limit);
1340 
1341  if ($nonChildrenOnly) {
1342  $collection->filterByParent();
1343  }
1344  $products = [];
1345  foreach ($collection as $item) {
1346  $products[] = $item->getProductId();
1347  }
1348 
1349  $productsCollection = $this->productListFactory->create()->addIdFilter(
1350  $products
1351  )->setVisibility(
1352  $this->_productVisibility->getVisibleInSiteIds()
1353  )->addPriceData()->load();
1354 
1355  foreach ($collection as $item) {
1356  $product = $productsCollection->getItemById($item->getProductId());
1357  if ($product) {
1358  $item->setProduct($product);
1359  }
1360  }
1361 
1362  return $collection;
1363  }

◆ _placePayment()

_placePayment ( )
protected

Place order payments

Returns
$this

Definition at line 878 of file Order.php.

879  {
880  $this->getPayment()->place();
881  return $this;
882  }

◆ addAddress()

addAddress ( \Magento\Sales\Model\Order\Address  $address)

Add address

Parameters
\Magento\Sales\Model\Order\Address$address
Returns
$this

Definition at line 1280 of file Order.php.

1281  {
1282  $address->setOrder($this)->setParentId($this->getId());
1283  if (!$address->getId()) {
1284  $this->setAddresses(array_merge($this->getAddresses(), [$address]));
1285  $this->setDataChanges(true);
1286  }
1287  return $this;
1288  }
$address
Definition: customer.php:38

◆ addCommentToStatusHistory()

addCommentToStatusHistory (   $comment,
  $status = false,
  $isVisibleOnFront = false 
)

Add a comment to order status history.

Different or default status may be specified.

Parameters
string$comment
bool | string$status
bool$isVisibleOnFront
Returns
OrderStatusHistoryInterface
Since
101.0.5

Definition at line 1038 of file Order.php.

1039  {
1040  if (false === $status) {
1041  $status = $this->getStatus();
1042  } elseif (true === $status) {
1043  $status = $this->getConfig()->getStateDefaultStatus($this->getState());
1044  } else {
1045  $this->setStatus($status);
1046  }
1047  $history = $this->_orderHistoryFactory->create()->setStatus(
1048  $status
1049  )->setComment(
1050  $comment
1051  )->setEntityName(
1052  $this->entityType
1053  )->setIsVisibleOnFront(
1054  $isVisibleOnFront
1055  );
1056  $this->addStatusHistory($history);
1057  return $history;
1058  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
addStatusHistory(\Magento\Sales\Model\Order\Status\History $history)
Definition: Order.php:1588
$status
Definition: order_status.php:8

◆ addItem()

addItem ( \Magento\Sales\Model\Order\Item  $item)

Add item

Parameters
\Magento\Sales\Model\Order\Item$item
Returns
$this

Definition at line 1436 of file Order.php.

1437  {
1438  $item->setOrder($this);
1439  if (!$item->getId()) {
1440  $this->setItems(array_merge($this->getItems(), [$item]));
1441  }
1442  return $this;
1443  }

◆ addRelatedObject()

addRelatedObject ( \Magento\Framework\Model\AbstractModel  $object)

Add New object to related array

Parameters
\Magento\Framework\Model\AbstractModel$object
Returns
$this

Definition at line 1896 of file Order.php.

1897  {
1898  $this->_relatedObjects[] = $object;
1899  return $this;
1900  }

◆ addStatusHistory()

addStatusHistory ( \Magento\Sales\Model\Order\Status\History  $history)

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.

Parameters
\Magento\Sales\Model\Order\Status\History$history
Returns
$this

Definition at line 1588 of file Order.php.

1589  {
1590  $history->setOrder($this);
1591  $this->setStatus($history->getStatus());
1592  if (!$history->getId()) {
1593  $this->setStatusHistories(array_merge($this->getStatusHistories(), [$history]));
1594  $this->setDataChanges(true);
1595  }
1596  return $this;
1597  }
setStatusHistories(array $statusHistories=null)
Definition: Order.php:3385

◆ addStatusHistoryComment()

addStatusHistoryComment (   $comment,
  $status = false 
)

Add a comment to order.

Different or default status may be specified.

Parameters
string$comment
bool | string$status
Returns
OrderStatusHistoryInterface
Deprecated:
101.0.5
See also
addCommentToStatusHistory

Definition at line 1022 of file Order.php.

1023  {
1024  return $this->addCommentToStatusHistory($comment, $status, false);
1025  }
addCommentToStatusHistory($comment, $status=false, $isVisibleOnFront=false)
Definition: Order.php:1038
$status
Definition: order_status.php:8

◆ addStatusToHistory()

addStatusToHistory (   $status,
  $comment = '',
  $isCustomerNotified = false 
)

Add status change information to history

Parameters
string$status
string$comment
bool$isCustomerNotified
Returns
$this

Definition at line 1005 of file Order.php.

1006  {
1007  $this->addStatusHistoryComment($comment, $status)->setIsCustomerNotified($isCustomerNotified);
1008  return $this;
1009  }
addStatusHistoryComment($comment, $status=false)
Definition: Order.php:1022
$status
Definition: order_status.php:8

◆ canCancel()

canCancel ( )

Retrieve order cancel availability

Returns
bool @SuppressWarnings(PHPMD.CyclomaticComplexity) @SuppressWarnings(PHPMD.NPathComplexity)

Definition at line 530 of file Order.php.

531  {
532  if (!$this->_canVoidOrder()) {
533  return false;
534  }
535  if ($this->canUnhold()) {
536  return false;
537  }
538  if (!$this->canReviewPayment() && $this->canFetchPaymentReviewUpdate()) {
539  return false;
540  }
541 
542  $allInvoiced = true;
543  foreach ($this->getAllItems() as $item) {
544  if ($item->getQtyToInvoice()) {
545  $allInvoiced = false;
546  break;
547  }
548  }
549 
550  if ($allInvoiced) {
551  return false;
552  }
553 
554  $state = $this->getState();
555  if ($this->isCanceled() || $state === self::STATE_COMPLETE || $state === self::STATE_CLOSED) {
556  return false;
557  }
558 
559  if ($this->getActionFlag(self::ACTION_FLAG_CANCEL) === false) {
560  return false;
561  }
562 
563  return true;
564  }

◆ cancel()

cancel ( )

Cancel order

Returns
$this

Definition at line 1137 of file Order.php.

1138  {
1139  if ($this->canCancel()) {
1140  $this->getPayment()->cancel();
1141  $this->registerCancellation();
1142 
1143  $this->_eventManager->dispatch('order_cancel_after', ['order' => $this]);
1144  }
1145 
1146  return $this;
1147  }
registerCancellation($comment='', $graceful=true)
Definition: Order.php:1169

◆ canComment()

canComment ( )

Check if comment can be added to order history

Returns
bool

Definition at line 695 of file Order.php.

696  {
697  if ($this->getActionFlag(self::ACTION_FLAG_COMMENT) === false) {
698  return false;
699  }
700  return true;
701  }

◆ canCreditmemo()

canCreditmemo ( )

Retrieve order credit memo (refund) availability

Returns
bool

We can have problem with float in php (on some server $a=762.73;$b=762.73; $a-$b!=0) for this we have additional diapason for 0 TotalPaid - contains amount, that were not rounded.

Definition at line 619 of file Order.php.

620  {
621  if ($this->hasForcedCanCreditmemo()) {
622  return $this->getForcedCanCreditmemo();
623  }
624 
625  if ($this->canUnhold() || $this->isPaymentReview()) {
626  return false;
627  }
628 
629  if ($this->isCanceled() || $this->getState() === self::STATE_CLOSED) {
630  return false;
631  }
632 
638  $totalRefunded = $this->priceCurrency->round($this->getTotalPaid()) - $this->getTotalRefunded();
639  if (abs($totalRefunded) < .0001) {
640  return false;
641  }
642  // Case when Adjustment Fee (adjustment_negative) has been used for first creditmemo
643  if (abs($totalRefunded - $this->getAdjustmentNegative()) < .0001) {
644  return false;
645  }
646 
647  if ($this->getActionFlag(self::ACTION_FLAG_EDIT) === false) {
648  return false;
649  }
650  return true;
651  }

◆ canEdit()

canEdit ( )

Retrieve order edit availability

Returns
bool

Definition at line 736 of file Order.php.

737  {
738  if ($this->canUnhold()) {
739  return false;
740  }
741 
742  $state = $this->getState();
743  if ($this->isCanceled() ||
744  $this->isPaymentReview() ||
745  $state === self::STATE_COMPLETE ||
746  $state === self::STATE_CLOSED
747  ) {
748  return false;
749  }
750 
751  if ($this->hasInvoices()) {
752  return false;
753  }
754 
755  if (!$this->getPayment()->getMethodInstance()->canEdit()) {
756  return false;
757  }
758 
759  if ($this->getActionFlag(self::ACTION_FLAG_EDIT) === false) {
760  return false;
761  }
762 
763  return true;
764  }

◆ canFetchPaymentReviewUpdate()

canFetchPaymentReviewUpdate ( )

Check whether there can be a transaction update fetched for payment in review state

Returns
bool

Definition at line 858 of file Order.php.

859  {
860  return $this->isPaymentReview() && $this->getPayment()->canFetchTransactionInfo();
861  }

◆ canHold()

canHold ( )

Retrieve order hold availability

Returns
bool

Definition at line 658 of file Order.php.

659  {
660  $notHoldableStates = [
666  ];
667  if (in_array($this->getState(), $notHoldableStates)) {
668  return false;
669  }
670 
671  if ($this->getActionFlag(self::ACTION_FLAG_HOLD) === false) {
672  return false;
673  }
674  return true;
675  }

◆ canInvoice()

canInvoice ( )

Retrieve order invoice availability

Returns
bool @SuppressWarnings(PHPMD.CyclomaticComplexity)

Definition at line 592 of file Order.php.

593  {
594  if ($this->canUnhold() || $this->isPaymentReview()) {
595  return false;
596  }
597  $state = $this->getState();
598  if ($this->isCanceled() || $state === self::STATE_COMPLETE || $state === self::STATE_CLOSED) {
599  return false;
600  }
601 
602  if ($this->getActionFlag(self::ACTION_FLAG_INVOICE) === false) {
603  return false;
604  }
605 
606  foreach ($this->getAllItems() as $item) {
607  if ($item->getQtyToInvoice() > 0 && !$item->getLockedDoInvoice()) {
608  return true;
609  }
610  }
611  return false;
612  }

◆ canReorder()

canReorder ( )

Retrieve order reorder availability

Returns
bool

Definition at line 771 of file Order.php.

772  {
773  return $this->_canReorder(false);
774  }
_canReorder($ignoreSalable=false)
Definition: Order.php:793

◆ canReorderIgnoreSalable()

canReorderIgnoreSalable ( )

Check the ability to reorder ignoring the availability in stock or status of the ordered products

Returns
bool

Definition at line 781 of file Order.php.

782  {
783  return $this->_canReorder(true);
784  }
_canReorder($ignoreSalable=false)
Definition: Order.php:793

◆ canReviewPayment()

canReviewPayment ( )

Check whether payment can be accepted or denied

Returns
bool

Definition at line 848 of file Order.php.

849  {
850  return $this->isPaymentReview() && $this->getPayment()->canReviewPayment();
851  }

◆ canShip()

canShip ( )

Retrieve order shipment availability

Returns
bool @SuppressWarnings(PHPMD.CyclomaticComplexity)

Definition at line 709 of file Order.php.

710  {
711  if ($this->canUnhold() || $this->isPaymentReview()) {
712  return false;
713  }
714 
715  if ($this->getIsVirtual() || $this->isCanceled()) {
716  return false;
717  }
718 
719  if ($this->getActionFlag(self::ACTION_FLAG_SHIP) === false) {
720  return false;
721  }
722 
723  foreach ($this->getAllItems() as $item) {
724  if ($item->getQtyToShip() > 0 && !$item->getIsVirtual() && !$item->getLockedDoShip()) {
725  return true;
726  }
727  }
728  return false;
729  }

◆ canUnhold()

canUnhold ( )

Retrieve order unhold availability

Returns
bool

Definition at line 682 of file Order.php.

683  {
684  if ($this->getActionFlag(self::ACTION_FLAG_UNHOLD) === false || $this->isPaymentReview()) {
685  return false;
686  }
687  return $this->getState() === self::STATE_HOLDED;
688  }

◆ canVoidPayment()

canVoidPayment ( )

Getter whether the payment can be voided

Returns
bool

Definition at line 571 of file Order.php.

572  {
573  return $this->_canVoidOrder() ? $this->getPayment()->canVoid() : false;
574  }

◆ formatBasePrice()

formatBasePrice (   $price)

Format BasePrice

Parameters
float$price
Returns
string

Definition at line 1682 of file Order.php.

1683  {
1684  return $this->formatBasePricePrecision($price, 2);
1685  }
$price
formatBasePricePrecision($price, $precision)
Definition: Order.php:1694

◆ formatBasePricePrecision()

formatBasePricePrecision (   $price,
  $precision 
)

Format BasePrice Precision

Parameters
float$price
int$precision
Returns
string

Definition at line 1694 of file Order.php.

1695  {
1696  return $this->getBaseCurrency()->formatPrecision($price, $precision);
1697  }
$price

◆ formatPrice()

formatPrice (   $price,
  $addBrackets = false 
)

Get formatted price value including order currency rate to order website currency

Parameters
float$price
bool$addBrackets
Returns
string

Definition at line 1634 of file Order.php.

1635  {
1636  return $this->formatPricePrecision($price, 2, $addBrackets);
1637  }
$price
formatPricePrecision($price, $precision, $addBrackets=false)
Definition: Order.php:1647

◆ formatPricePrecision()

formatPricePrecision (   $price,
  $precision,
  $addBrackets = false 
)

Format price precision

Parameters
float$price
int$precision
bool$addBrackets
Returns
string

Definition at line 1647 of file Order.php.

1648  {
1649  return $this->getOrderCurrency()->formatPrecision($price, $precision, [], true, $addBrackets);
1650  }
$price

◆ formatPriceTxt()

formatPriceTxt (   $price)

Retrieve text formatted price value including order rate

Parameters
float$price
Returns
string

Definition at line 1658 of file Order.php.

1659  {
1660  return $this->getOrderCurrency()->formatTxt($price);
1661  }
$price

◆ getActionFlag()

getActionFlag (   $action)

Retrieve can flag for action (edit, unhold, etc..)

Parameters
string$action
Returns
boolean|null

Definition at line 407 of file Order.php.

408  {
409  if (isset($this->_actionFlag[$action])) {
410  return $this->_actionFlag[$action];
411  }
412  return null;
413  }

◆ getAddressById()

getAddressById (   $addressId)

Get address by id

Parameters
mixed$addressId
Returns
false

Definition at line 1264 of file Order.php.

1265  {
1266  foreach ($this->getAddressesCollection() as $address) {
1267  if ($address->getId() == $addressId) {
1268  return $address;
1269  }
1270  }
1271  return false;
1272  }
$address
Definition: customer.php:38

◆ getAddresses()

getAddresses ( )

Get addresses

Returns
\Magento\Sales\Api\Data\OrderAddressInterface[]

Definition at line 2044 of file Order.php.

2045  {
2046  if ($this->getData('addresses') == null) {
2047  $this->setData(
2048  'addresses',
2049  $this->getAddressesCollection()->getItems()
2050  );
2051  }
2052  return $this->getData('addresses');
2053  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getAddressesCollection()

getAddressesCollection ( )

Get addresses collection

Returns
Collection

Definition at line 1247 of file Order.php.

1248  {
1249  $collection = $this->_addressCollectionFactory->create()->setOrderFilter($this);
1250  if ($this->getId()) {
1251  foreach ($collection as $address) {
1252  $address->setOrder($this);
1253  }
1254  }
1255  return $collection;
1256  }
$address
Definition: customer.php:38

◆ getAdjustmentNegative()

getAdjustmentNegative ( )

Return adjustment_negative

Returns
float|null

Implements OrderInterface.

Definition at line 2099 of file Order.php.

2100  {
2102  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getAdjustmentPositive()

getAdjustmentPositive ( )

Return adjustment_positive

Returns
float|null

Implements OrderInterface.

Definition at line 2109 of file Order.php.

2110  {
2112  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getAllItems()

getAllItems ( )

Get all items

Returns
\Magento\Sales\Model\Order\Item[]

Definition at line 1370 of file Order.php.

1371  {
1372  $items = [];
1373  foreach ($this->getItems() as $item) {
1374  if (!$item->isDeleted()) {
1375  $items[] = $item;
1376  }
1377  }
1378  return $items;
1379  }
$items

◆ getAllPayments()

getAllPayments ( )

Get all payments

Returns
array

Definition at line 1468 of file Order.php.

1469  {
1470  $payments = [];
1471  foreach ($this->getPaymentsCollection() as $payment) {
1472  if (!$payment->isDeleted()) {
1473  $payments[] = $payment;
1474  }
1475  }
1476  return $payments;
1477  }
$payment
Definition: order.php:17

◆ getAllStatusHistory()

getAllStatusHistory ( )

Return array of order status history items without deleted.

Returns
array

Definition at line 1535 of file Order.php.

1536  {
1537  $history = [];
1538  foreach ($this->getStatusHistoryCollection() as $status) {
1539  if (!$status->isDeleted()) {
1540  $history[] = $status;
1541  }
1542  }
1543  return $history;
1544  }
$status
Definition: order_status.php:8

◆ getAllVisibleItems()

getAllVisibleItems ( )

Get all visible items

Returns
array

Definition at line 1386 of file Order.php.

1387  {
1388  $items = [];
1389  foreach ($this->getItems() as $item) {
1390  if (!$item->isDeleted() && !$item->getParentItemId()) {
1391  $items[] = $item;
1392  }
1393  }
1394  return $items;
1395  }
$items

◆ getAppliedRuleIds()

getAppliedRuleIds ( )

Return applied_rule_ids

Returns
string|null

Implements OrderInterface.

Definition at line 2119 of file Order.php.

2120  {
2122  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseAdjustmentNegative()

getBaseAdjustmentNegative ( )

Return base_adjustment_negative

Returns
float|null

Implements OrderInterface.

Definition at line 2129 of file Order.php.

2130  {
2132  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseAdjustmentPositive()

getBaseAdjustmentPositive ( )

Return base_adjustment_positive

Returns
float|null

Implements OrderInterface.

Definition at line 2139 of file Order.php.

2140  {
2142  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseCurrency()

getBaseCurrency ( )

Retrieve order website currency for working with base prices

Returns
Currency

Definition at line 1668 of file Order.php.

1669  {
1670  if ($this->_baseCurrency === null) {
1671  $this->_baseCurrency = $this->_currencyFactory->create()->load($this->getBaseCurrencyCode());
1672  }
1673  return $this->_baseCurrency;
1674  }

◆ getBaseCurrencyCode()

getBaseCurrencyCode ( )

Return base_currency_code

Returns
string|null

Implements OrderInterface.

Definition at line 2149 of file Order.php.

2150  {
2152  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseDiscountAmount()

getBaseDiscountAmount ( )

Return base_discount_amount

Returns
float|null

Implements OrderInterface.

Definition at line 2159 of file Order.php.

2160  {
2162  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseDiscountCanceled()

getBaseDiscountCanceled ( )

Return base_discount_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 2169 of file Order.php.

2170  {
2172  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseDiscountInvoiced()

getBaseDiscountInvoiced ( )

Return base_discount_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 2179 of file Order.php.

2180  {
2182  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseDiscountRefunded()

getBaseDiscountRefunded ( )

Return base_discount_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2189 of file Order.php.

2190  {
2192  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseDiscountTaxCompensationAmount()

getBaseDiscountTaxCompensationAmount ( )

Return base_discount_tax_compensation_amount

Returns
float|null

Implements OrderInterface.

Definition at line 2209 of file Order.php.

2210  {
2212  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseDiscountTaxCompensationInvoiced()

getBaseDiscountTaxCompensationInvoiced ( )

Return base_discount_tax_compensation_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 2219 of file Order.php.

2220  {
2222  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseDiscountTaxCompensationRefunded()

getBaseDiscountTaxCompensationRefunded ( )

Return base_discount_tax_compensation_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2229 of file Order.php.

2230  {
2232  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseGrandTotal()

getBaseGrandTotal ( )

Return base_grand_total

Returns
float

Implements OrderInterface.

Definition at line 2199 of file Order.php.

2200  {
2202  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseShippingAmount()

getBaseShippingAmount ( )

Return base_shipping_amount

Returns
float|null

Implements OrderInterface.

Definition at line 2239 of file Order.php.

2240  {
2242  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseShippingCanceled()

getBaseShippingCanceled ( )

Return base_shipping_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 2249 of file Order.php.

2250  {
2252  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseShippingDiscountAmount()

getBaseShippingDiscountAmount ( )

Return base_shipping_discount_amount

Returns
float|null

Implements OrderInterface.

Definition at line 2259 of file Order.php.

2260  {
2262  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseShippingDiscountTaxCompensationAmnt()

getBaseShippingDiscountTaxCompensationAmnt ( )

Return base_shipping_discount_tax_compensation_amnt

Returns
float|null

Implements OrderInterface.

Definition at line 2269 of file Order.php.

2270  {
2272  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseShippingInclTax()

getBaseShippingInclTax ( )

Return base_shipping_incl_tax

Returns
float|null

Implements OrderInterface.

Definition at line 2279 of file Order.php.

2280  {
2282  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseShippingInvoiced()

getBaseShippingInvoiced ( )

Return base_shipping_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 2289 of file Order.php.

2290  {
2292  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseShippingRefunded()

getBaseShippingRefunded ( )

Return base_shipping_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2299 of file Order.php.

2300  {
2302  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseShippingTaxAmount()

getBaseShippingTaxAmount ( )

Return base_shipping_tax_amount

Returns
float|null

Implements OrderInterface.

Definition at line 2309 of file Order.php.

2310  {
2312  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseShippingTaxRefunded()

getBaseShippingTaxRefunded ( )

Return base_shipping_tax_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2319 of file Order.php.

2320  {
2322  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseSubtotal()

getBaseSubtotal ( )

Return base_subtotal

Returns
float|null

Implements OrderInterface.

Definition at line 2329 of file Order.php.

2330  {
2331  return $this->getData(OrderInterface::BASE_SUBTOTAL);
2332  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseSubtotalCanceled()

getBaseSubtotalCanceled ( )

Return base_subtotal_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 2339 of file Order.php.

2340  {
2342  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseSubtotalInclTax()

getBaseSubtotalInclTax ( )

Return base_subtotal_incl_tax

Returns
float|null

Implements OrderInterface.

Definition at line 2349 of file Order.php.

2350  {
2352  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseSubtotalInvoiced()

getBaseSubtotalInvoiced ( )

Return base_subtotal_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 2359 of file Order.php.

2360  {
2362  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseSubtotalRefunded()

getBaseSubtotalRefunded ( )

Return base_subtotal_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2369 of file Order.php.

2370  {
2372  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTaxAmount()

getBaseTaxAmount ( )

Return base_tax_amount

Returns
float|null

Implements OrderInterface.

Definition at line 2379 of file Order.php.

2380  {
2382  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTaxCanceled()

getBaseTaxCanceled ( )

Return base_tax_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 2389 of file Order.php.

2390  {
2392  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTaxInvoiced()

getBaseTaxInvoiced ( )

Return base_tax_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 2399 of file Order.php.

2400  {
2402  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTaxRefunded()

getBaseTaxRefunded ( )

Return base_tax_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2409 of file Order.php.

2410  {
2412  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseToGlobalRate()

getBaseToGlobalRate ( )

Return base_to_global_rate

Returns
float|null

Implements OrderInterface.

Definition at line 2499 of file Order.php.

2500  {
2502  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseToOrderRate()

getBaseToOrderRate ( )

Return base_to_order_rate

Returns
float|null

Implements OrderInterface.

Definition at line 2509 of file Order.php.

2510  {
2512  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTotalCanceled()

getBaseTotalCanceled ( )

Return base_total_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 2419 of file Order.php.

2420  {
2422  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTotalDue()

getBaseTotalDue ( )

Retrieve order total due value

Returns
float|null

Implements OrderInterface.

Definition at line 1726 of file Order.php.

1727  {
1728  $total = $this->getBaseGrandTotal() - $this->getBaseTotalPaid();
1729  $total = $this->priceCurrency->round($total);
1730  return max($total, 0);
1731  }

◆ getBaseTotalInvoiced()

getBaseTotalInvoiced ( )

Return base_total_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 2429 of file Order.php.

2430  {
2432  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTotalInvoicedCost()

getBaseTotalInvoicedCost ( )

Return base_total_invoiced_cost

Returns
float|null

Implements OrderInterface.

Definition at line 2439 of file Order.php.

2440  {
2442  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTotalOfflineRefunded()

getBaseTotalOfflineRefunded ( )

Return base_total_offline_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2449 of file Order.php.

2450  {
2452  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTotalOnlineRefunded()

getBaseTotalOnlineRefunded ( )

Return base_total_online_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2459 of file Order.php.

2460  {
2462  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTotalPaid()

getBaseTotalPaid ( )

Return base_total_paid

Returns
float|null

Implements OrderInterface.

Definition at line 2469 of file Order.php.

2470  {
2472  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTotalQtyOrdered()

getBaseTotalQtyOrdered ( )

Return base_total_qty_ordered

Returns
float|null

Implements OrderInterface.

Definition at line 2479 of file Order.php.

2480  {
2482  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBaseTotalRefunded()

getBaseTotalRefunded ( )

Return base_total_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2489 of file Order.php.

2490  {
2492  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getBillingAddress()

getBillingAddress ( )

Retrieve order billing address

Returns
\Magento\Sales\Api\Data\OrderAddressInterface|null

Implements OrderInterface.

Definition at line 951 of file Order.php.

952  {
953  foreach ($this->getAddresses() as $address) {
954  if ($address->getAddressType() == 'billing' && !$address->isDeleted()) {
955  return $address;
956  }
957  }
958  return null;
959  }
$address
Definition: customer.php:38

◆ getBillingAddressId()

getBillingAddressId ( )

Return billing_address_id

Returns
int|null

Implements OrderInterface.

Definition at line 2519 of file Order.php.

2520  {
2522  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCanSendNewEmailFlag()

getCanSendNewEmailFlag ( )

Return flag for order if it can sends new email to customer.

Returns
bool @SuppressWarnings(PHPMD.BooleanGetMethodName)

Definition at line 434 of file Order.php.

435  {
437  }

◆ getCanShipPartially()

getCanShipPartially ( )

Return can_ship_partially

Returns
int|null

Implements OrderInterface.

Definition at line 2529 of file Order.php.

2530  {
2532  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCanShipPartiallyItem()

getCanShipPartiallyItem ( )

Return can_ship_partially_item

Returns
int|null

Implements OrderInterface.

Definition at line 2539 of file Order.php.

2540  {
2542  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getConfig()

getConfig ( )

Retrieve order configuration model

Returns
\Magento\Sales\Model\Order\Config

Definition at line 868 of file Order.php.

869  {
870  return $this->_orderConfig;
871  }

◆ getCouponCode()

getCouponCode ( )

Return coupon_code

Returns
string|null

Implements OrderInterface.

Definition at line 2549 of file Order.php.

2550  {
2551  return $this->getData(OrderInterface::COUPON_CODE);
2552  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCreatedAt()

getCreatedAt ( )

Return created_at

Returns
string|null

Implements OrderInterface.

Definition at line 2559 of file Order.php.

2560  {
2561  return $this->getData(OrderInterface::CREATED_AT);
2562  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCreatedAtFormatted()

getCreatedAtFormatted (   $format)

Get formatted order created date in store timezone

Parameters
string$formatdate format type (short|medium|long|full)
Returns
string

Definition at line 1908 of file Order.php.

1909  {
1910  return $this->timezone->formatDateTime(
1911  new \DateTime($this->getCreatedAt()),
1912  $format,
1913  $format,
1914  $this->localeResolver->getDefaultLocale(),
1915  $this->timezone->getConfigTimezone('store', $this->getStore())
1916  );
1917  }
$format
Definition: list.phtml:12

◆ getCreditmemosCollection()

getCreditmemosCollection ( )

Retrieve order creditmemos collection

Returns
CreditmemoCollection|false

Definition at line 1804 of file Order.php.

1805  {
1806  if (empty($this->_creditmemos)) {
1807  if ($this->getId()) {
1808  $this->_creditmemos = $this->_memoCollectionFactory->create()->setOrderFilter($this)->load();
1809  } else {
1810  return false;
1811  }
1812  }
1813  return $this->_creditmemos;
1814  }

◆ getCustomerDob()

getCustomerDob ( )

Return customer_dob

Returns
string|null

Implements OrderInterface.

Definition at line 2577 of file Order.php.

2578  {
2579  return $this->getData(OrderInterface::CUSTOMER_DOB);
2580  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerEmail()

getCustomerEmail ( )

Return customer_email

Returns
string

Implements OrderInterface.

Definition at line 2587 of file Order.php.

2588  {
2589  return $this->getData(OrderInterface::CUSTOMER_EMAIL);
2590  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerFirstname()

getCustomerFirstname ( )

Return customer_firstname

Returns
string|null

Implements OrderInterface.

Definition at line 2597 of file Order.php.

2598  {
2600  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerGender()

getCustomerGender ( )

Return customer_gender

Returns
int|null

Implements OrderInterface.

Definition at line 2607 of file Order.php.

2608  {
2610  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerGroupId()

getCustomerGroupId ( )

Return customer_group_id

Returns
int|null

Implements OrderInterface.

Definition at line 2617 of file Order.php.

2618  {
2620  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerId()

getCustomerId ( )

Return customer_id

Returns
int|null

Implements OrderInterface.

Definition at line 2627 of file Order.php.

2628  {
2629  return $this->getData(OrderInterface::CUSTOMER_ID);
2630  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerIsGuest()

getCustomerIsGuest ( )

Return customer_is_guest

Returns
int|null

Implements OrderInterface.

Definition at line 2637 of file Order.php.

2638  {
2640  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerLastname()

getCustomerLastname ( )

Return customer_lastname

Returns
string|null

Implements OrderInterface.

Definition at line 2647 of file Order.php.

2648  {
2650  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerMiddlename()

getCustomerMiddlename ( )

Return customer_middlename

Returns
string|null

Implements OrderInterface.

Definition at line 2657 of file Order.php.

2658  {
2660  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerName()

getCustomerName ( )

Get customer name

Returns
string

Definition at line 1880 of file Order.php.

1881  {
1882  if ($this->getCustomerFirstname()) {
1883  $customerName = $this->getCustomerFirstname() . ' ' . $this->getCustomerLastname();
1884  } else {
1885  $customerName = (string)__('Guest');
1886  }
1887  return $customerName;
1888  }
__()
Definition: __.php:13

◆ getCustomerNote()

getCustomerNote ( )

Return customer_note

Returns
string|null

Implements OrderInterface.

Definition at line 2667 of file Order.php.

2668  {
2669  return $this->getData(OrderInterface::CUSTOMER_NOTE);
2670  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerNoteNotify()

getCustomerNoteNotify ( )

Return customer_note_notify

Returns
int|null

Implements OrderInterface.

Definition at line 2677 of file Order.php.

2678  {
2680  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerPrefix()

getCustomerPrefix ( )

Return customer_prefix

Returns
string|null

Implements OrderInterface.

Definition at line 2687 of file Order.php.

2688  {
2690  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerSuffix()

getCustomerSuffix ( )

Return customer_suffix

Returns
string|null

Implements OrderInterface.

Definition at line 2697 of file Order.php.

2698  {
2700  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getCustomerTaxvat()

getCustomerTaxvat ( )

Return customer_taxvat

Returns
string|null

Implements OrderInterface.

Definition at line 2707 of file Order.php.

2708  {
2710  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getData()

getData (   $key = '',
  $index = null 
)

Get data

Parameters
string$key
null | string | int$index
Returns
mixed

Definition at line 1740 of file Order.php.

1741  {
1742  if ($key == 'total_due') {
1743  return $this->getTotalDue();
1744  }
1745  if ($key == 'base_total_due') {
1746  return $this->getBaseTotalDue();
1747  }
1748  return parent::getData($key, $index);
1749  }
$index
Definition: list.phtml:44

◆ getDiscountAmount()

getDiscountAmount ( )

Return discount_amount

Returns
float|null

Implements OrderInterface.

Definition at line 2717 of file Order.php.

2718  {
2720  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getDiscountCanceled()

getDiscountCanceled ( )

Return discount_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 2727 of file Order.php.

2728  {
2730  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getDiscountDescription()

getDiscountDescription ( )

Return discount_description

Returns
string|null

Implements OrderInterface.

Definition at line 2737 of file Order.php.

2738  {
2740  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getDiscountInvoiced()

getDiscountInvoiced ( )

Return discount_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 2747 of file Order.php.

2748  {
2750  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getDiscountRefunded()

getDiscountRefunded ( )

Return discount_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2757 of file Order.php.

2758  {
2760  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getDiscountTaxCompensationAmount()

getDiscountTaxCompensationAmount ( )

Return discount_tax_compensation_amount

Returns
float|null

Implements OrderInterface.

Definition at line 2837 of file Order.php.

2838  {
2840  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getDiscountTaxCompensationInvoiced()

getDiscountTaxCompensationInvoiced ( )

Return discount_tax_compensation_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 2847 of file Order.php.

2848  {
2850  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getDiscountTaxCompensationRefunded()

getDiscountTaxCompensationRefunded ( )

Return discount_tax_compensation_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 2857 of file Order.php.

2858  {
2860  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getEditIncrement()

getEditIncrement ( )

Return edit_increment

Returns
int|null

Implements OrderInterface.

Definition at line 2767 of file Order.php.

2768  {
2769  return $this->getData(OrderInterface::EDIT_INCREMENT);
2770  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getEmailCustomerNote()

getEmailCustomerNote ( )

Get email customer note

Returns
string

Definition at line 1924 of file Order.php.

1925  {
1926  if ($this->getCustomerNoteNotify()) {
1927  return $this->getCustomerNote();
1928  }
1929  return '';
1930  }

◆ getEmailSent()

getEmailSent ( )

Return email_sent

Returns
int|null

Implements OrderInterface.

Definition at line 2777 of file Order.php.

2778  {
2779  return $this->getData(OrderInterface::EMAIL_SENT);
2780  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getEntityType()

getEntityType ( )

Return order entity type

Returns
string

Definition at line 1077 of file Order.php.

1078  {
1079  return $this->entityType;
1080  }

◆ getExtCustomerId()

getExtCustomerId ( )

Return ext_customer_id

Returns
string|null

Implements OrderInterface.

Definition at line 2787 of file Order.php.

2788  {
2790  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getExtensionAttributes()

getExtensionAttributes ( )

Get ExtensionAttributes

Returns
\Magento\Sales\Api\Data\OrderExtensionInterface|null

Implements OrderInterface.

Definition at line 2076 of file Order.php.

◆ getExtOrderId()

getExtOrderId ( )

Return ext_order_id

Returns
string|null

Implements OrderInterface.

Definition at line 2797 of file Order.php.

2798  {
2799  return $this->getData(OrderInterface::EXT_ORDER_ID);
2800  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getForcedShipmentWithInvoice()

getForcedShipmentWithInvoice ( )

Return forced_shipment_with_invoice

Returns
int|null

Implements OrderInterface.

Definition at line 2807 of file Order.php.

2808  {
2810  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getGlobalCurrencyCode()

getGlobalCurrencyCode ( )

Return global_currency_code

Returns
string|null

Implements OrderInterface.

Definition at line 2817 of file Order.php.

2818  {
2820  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getGrandTotal()

getGrandTotal ( )

Return grand_total

Returns
float

Implements OrderInterface.

Definition at line 2827 of file Order.php.

2828  {
2829  return $this->getData(OrderInterface::GRAND_TOTAL);
2830  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getHoldBeforeState()

getHoldBeforeState ( )

Return hold_before_state

Returns
string|null

Implements OrderInterface.

Definition at line 2867 of file Order.php.

2868  {
2870  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getHoldBeforeStatus()

getHoldBeforeStatus ( )

Return hold_before_status

Returns
string|null

Implements OrderInterface.

Definition at line 2877 of file Order.php.

2878  {
2880  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getIncrementId()

getIncrementId ( )

Return increment id

@codeCoverageIgnore

Returns
string

Implements OrderInterface.

Definition at line 2009 of file Order.php.

2010  {
2011  return $this->getData('increment_id');
2012  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getInvoiceCollection()

getInvoiceCollection ( )

Retrieve order invoices collection

Returns
InvoiceCollection

Definition at line 1756 of file Order.php.

1757  {
1758  if ($this->_invoices === null) {
1759  $this->_invoices = $this->_invoiceCollectionFactory->create()->setOrderFilter($this);
1760 
1761  if ($this->getId()) {
1762  foreach ($this->_invoices as $invoice) {
1763  $invoice->setOrder($this);
1764  }
1765  }
1766  }
1767  return $this->_invoices;
1768  }
$invoice

◆ getIsNotVirtual()

getIsNotVirtual ( )

Get IsNotVirtual

Returns
bool @SuppressWarnings(PHPMD.BooleanGetMethodName)

Definition at line 1976 of file Order.php.

1977  {
1978  return !$this->getIsVirtual();
1979  }

◆ getIsVirtual()

getIsVirtual ( )

Return is_virtual

Returns
int|null

Implements OrderInterface.

Definition at line 2887 of file Order.php.

2888  {
2889  return $this->getData(OrderInterface::IS_VIRTUAL);
2890  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getItemById()

getItemById (   $itemId)

Gets order item by given ID.

Parameters
int$itemId
Returns
\Magento\Framework\DataObject|null

Definition at line 1403 of file Order.php.

1404  {
1405  $items = $this->getItems();
1406 
1407  if (isset($items[$itemId])) {
1408  return $items[$itemId];
1409  }
1410 
1411  return null;
1412  }
$items

◆ getItemByQuoteItemId()

getItemByQuoteItemId (   $quoteItemId)

Get item by quote item id

Parameters
mixed$quoteItemId
Returns
\Magento\Framework\DataObject|null

Definition at line 1420 of file Order.php.

1421  {
1422  foreach ($this->getItems() as $item) {
1423  if ($item->getQuoteItemId() == $quoteItemId) {
1424  return $item;
1425  }
1426  }
1427  return null;
1428  }
$quoteItemId
Definition: cart.php:17

◆ getItems()

getItems ( )

Get Items

Returns
\Magento\Sales\Api\Data\OrderItemInterface[]

Implements OrderInterface.

Definition at line 2019 of file Order.php.

2020  {
2021  if ($this->getData(OrderInterface::ITEMS) == null) {
2022  $this->setData(
2024  $this->getItemsCollection()->getItems()
2025  );
2026  }
2027  return $this->getData(OrderInterface::ITEMS);
2028  }
getItemsCollection($filterByTypes=[], $nonChildrenOnly=false)
Definition: Order.php:1297
getData($key='', $index=null)
Definition: Order.php:1740

◆ getItemsCollection()

getItemsCollection (   $filterByTypes = [],
  $nonChildrenOnly = false 
)

Get items collection

Parameters
array$filterByTypes
bool$nonChildrenOnly
Returns
ImportCollection

Definition at line 1297 of file Order.php.

1298  {
1299  $collection = $this->_orderItemCollectionFactory->create()->setOrderFilter($this);
1300 
1301  if ($filterByTypes) {
1302  $collection->filterByTypes($filterByTypes);
1303  }
1304  if ($nonChildrenOnly) {
1305  $collection->filterByParent();
1306  }
1307 
1308  if ($this->getId()) {
1309  foreach ($collection as $item) {
1310  $item->setOrder($this);
1311  }
1312  }
1313  return $collection;
1314  }

◆ getOrderCurrency()

getOrderCurrency ( )

Get currency model instance. Will be used currency with which order placed

Returns
Currency

Definition at line 1618 of file Order.php.

1619  {
1620  if ($this->_orderCurrency === null) {
1621  $this->_orderCurrency = $this->_currencyFactory->create();
1622  $this->_orderCurrency->load($this->getOrderCurrencyCode());
1623  }
1624  return $this->_orderCurrency;
1625  }

◆ getOrderCurrencyCode()

getOrderCurrencyCode ( )

Return order_currency_code

Returns
string|null

Implements OrderInterface.

Definition at line 2897 of file Order.php.

2898  {
2900  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getOriginalIncrementId()

getOriginalIncrementId ( )

Return original_increment_id

Returns
string|null

Implements OrderInterface.

Definition at line 2907 of file Order.php.

2908  {
2910  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getParentItemsRandomCollection()

getParentItemsRandomCollection (   $limit = 1)

Get random items collection without related children

Parameters
int$limit
Returns
ImportCollection

Definition at line 1322 of file Order.php.

1323  {
1324  return $this->_getItemsRandomCollection($limit, true);
1325  }
_getItemsRandomCollection($limit, $nonChildrenOnly=false)
Definition: Order.php:1334

◆ getPayment()

getPayment ( )

Gets order payment

Returns
\Magento\Sales\Api\Data\OrderPaymentInterface|null

Implements OrderInterface.

Definition at line 887 of file Order.php.

888  {
890  if ($payment === null) {
891  $paymentItems = $this->getPaymentsCollection()->getItems();
892  if (count($paymentItems)) {
893  $payment = reset($paymentItems);
894  $this->setData(
896  $payment
897  );
898  }
899  }
900  if ($payment) {
901  $payment->setOrder($this);
902  }
903  return $payment;
904  }
$payment
Definition: order.php:17
getData($key='', $index=null)
Definition: Order.php:1740

◆ getPaymentAuthExpiration()

getPaymentAuthExpiration ( )

Return payment_auth_expiration

Returns
int|null

Implements OrderInterface.

Definition at line 2927 of file Order.php.

2928  {
2930  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getPaymentAuthorizationAmount()

getPaymentAuthorizationAmount ( )

Return payment_authorization_amount

Returns
float|null

Implements OrderInterface.

Definition at line 2917 of file Order.php.

2918  {
2920  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getPaymentById()

getPaymentById (   $paymentId)

Get payment by id

Parameters
mixed$paymentId
Returns
Payment|false

Definition at line 1485 of file Order.php.

1486  {
1487  foreach ($this->getPaymentsCollection() as $payment) {
1488  if ($payment->getId() == $paymentId) {
1489  return $payment;
1490  }
1491  }
1492  return false;
1493  }
$payment
Definition: order.php:17

◆ getPaymentsCollection()

getPaymentsCollection ( )

Get payments collection

Returns
PaymentCollection

Definition at line 1452 of file Order.php.

1453  {
1454  $collection = $this->_paymentCollectionFactory->create()->setOrderFilter($this);
1455  if ($this->getId()) {
1456  foreach ($collection as $payment) {
1457  $payment->setOrder($this);
1458  }
1459  }
1460  return $collection;
1461  }
$payment
Definition: order.php:17

◆ getProtectCode()

getProtectCode ( )

Return protect_code

Returns
string|null

Implements OrderInterface.

Definition at line 2937 of file Order.php.

2938  {
2939  return $this->getData(OrderInterface::PROTECT_CODE);
2940  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getQuoteAddressId()

getQuoteAddressId ( )

Return quote_address_id

Returns
int|null

Implements OrderInterface.

Definition at line 2947 of file Order.php.

2948  {
2950  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getQuoteId()

getQuoteId ( )

Return quote_id

Returns
int|null

Implements OrderInterface.

Definition at line 2957 of file Order.php.

2958  {
2959  return $this->getData(OrderInterface::QUOTE_ID);
2960  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getRealOrderId()

getRealOrderId ( )

Get real real_order_id

Returns
string

Definition at line 1604 of file Order.php.

1605  {
1606  $id = $this->getData('real_order_id');
1607  if ($id === null) {
1608  $id = $this->getIncrementId();
1609  }
1610  return $id;
1611  }
$id
Definition: fieldset.phtml:14
getData($key='', $index=null)
Definition: Order.php:1740

◆ getRelatedObjects()

getRelatedObjects ( )

Retrieve array of related objects

Used for order saving

Returns
array

Definition at line 1870 of file Order.php.

1871  {
1872  return $this->_relatedObjects;
1873  }

◆ getRelationChildId()

getRelationChildId ( )

Return relation_child_id

Returns
string|null

Implements OrderInterface.

Definition at line 2967 of file Order.php.

2968  {
2970  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getRelationChildRealId()

getRelationChildRealId ( )

Return relation_child_real_id

Returns
string|null

Implements OrderInterface.

Definition at line 2977 of file Order.php.

2978  {
2980  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getRelationParentId()

getRelationParentId ( )

Return relation_parent_id

Returns
string|null

Implements OrderInterface.

Definition at line 2987 of file Order.php.

2988  {
2990  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getRelationParentRealId()

getRelationParentRealId ( )

Return relation_parent_real_id

Returns
string|null

Implements OrderInterface.

Definition at line 2997 of file Order.php.

2998  {
3000  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getRemoteIp()

getRemoteIp ( )

Return remote_ip

Returns
string|null

Implements OrderInterface.

Definition at line 3007 of file Order.php.

3008  {
3009  return $this->getData(OrderInterface::REMOTE_IP);
3010  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShipmentsCollection()

getShipmentsCollection ( )

Retrieve order shipments collection

Returns
ShipmentCollection|false

Definition at line 1787 of file Order.php.

1788  {
1789  if (empty($this->_shipments)) {
1790  if ($this->getId()) {
1791  $this->_shipments = $this->_shipmentCollectionFactory->create()->setOrderFilter($this)->load();
1792  } else {
1793  return false;
1794  }
1795  }
1796  return $this->_shipments;
1797  }

◆ getShippingAddress()

getShippingAddress ( )

Retrieve order shipping address

Returns
\Magento\Sales\Model\Order\Address|null

Definition at line 966 of file Order.php.

967  {
968  foreach ($this->getAddresses() as $address) {
969  if ($address->getAddressType() == 'shipping' && !$address->isDeleted()) {
970  return $address;
971  }
972  }
973  return null;
974  }
$address
Definition: customer.php:38

◆ getShippingAmount()

getShippingAmount ( )

Return shipping_amount

Returns
float|null

Implements OrderInterface.

Definition at line 3017 of file Order.php.

3018  {
3020  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShippingCanceled()

getShippingCanceled ( )

Return shipping_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 3027 of file Order.php.

3028  {
3030  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShippingDescription()

getShippingDescription ( )

Return shipping_description

Returns
string|null

Implements OrderInterface.

Definition at line 3037 of file Order.php.

3038  {
3040  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShippingDiscountAmount()

getShippingDiscountAmount ( )

Return shipping_discount_amount

Returns
float|null

Implements OrderInterface.

Definition at line 3047 of file Order.php.

3048  {
3050  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShippingDiscountTaxCompensationAmount()

getShippingDiscountTaxCompensationAmount ( )

Return shipping_discount_tax_compensation_amount

Returns
float|null

Implements OrderInterface.

Definition at line 3057 of file Order.php.

3058  {
3060  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShippingInclTax()

getShippingInclTax ( )

Return shipping_incl_tax

Returns
float|null

Implements OrderInterface.

Definition at line 3067 of file Order.php.

3068  {
3070  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShippingInvoiced()

getShippingInvoiced ( )

Return shipping_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 3077 of file Order.php.

3078  {
3080  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShippingMethod()

getShippingMethod (   $asObject = false)

Retrieve shipping method

Parameters
bool$asObjectreturn carrier code and shipping method data as object
Returns
string|\Magento\Framework\DataObject

Definition at line 1229 of file Order.php.

1230  {
1231  $shippingMethod = parent::getShippingMethod();
1232  if (!$asObject) {
1233  return $shippingMethod;
1234  } else {
1235  list($carrierCode, $method) = explode('_', $shippingMethod, 2);
1236  return new \Magento\Framework\DataObject(['carrier_code' => $carrierCode, 'method' => $method]);
1237  }
1238  }
$method
Definition: info.phtml:13
$shippingMethod
Definition: popup.phtml:12

◆ getShippingRefunded()

getShippingRefunded ( )

Return shipping_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 3087 of file Order.php.

3088  {
3090  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShippingTaxAmount()

getShippingTaxAmount ( )

Return shipping_tax_amount

Returns
float|null

Implements OrderInterface.

Definition at line 3097 of file Order.php.

3098  {
3100  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getShippingTaxRefunded()

getShippingTaxRefunded ( )

Return shipping_tax_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 3107 of file Order.php.

3108  {
3110  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getState()

getState ( )

Return state

Returns
string|null

Implements OrderInterface.

Definition at line 3117 of file Order.php.

3118  {
3119  return $this->getData(OrderInterface::STATE);
3120  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getStatus()

getStatus ( )

Return status

Returns
string|null

Implements OrderInterface.

Definition at line 3127 of file Order.php.

3128  {
3129  return $this->getData(OrderInterface::STATUS);
3130  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getStatusHistories()

getStatusHistories ( )

Get status History

Returns
\Magento\Sales\Api\Data\OrderStatusHistoryInterface[]|null

Implements OrderInterface.

Definition at line 2060 of file Order.php.

2061  {
2062  if ($this->getData(OrderInterface::STATUS_HISTORIES) == null) {
2063  $this->setData(
2066  );
2067  }
2069  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getStatusHistoryById()

getStatusHistoryById (   $statusId)

GetStatus history by id

Parameters
mixed$statusId
Returns
string|false

Definition at line 1568 of file Order.php.

1569  {
1570  foreach ($this->getStatusHistoryCollection() as $status) {
1571  if ($status->getId() == $statusId) {
1572  return $status;
1573  }
1574  }
1575  return false;
1576  }
$status
Definition: order_status.php:8

◆ getStatusHistoryCollection()

getStatusHistoryCollection ( )

Return collection of order status history items.

Returns
HistoryCollection

Definition at line 1517 of file Order.php.

1518  {
1519  $collection = $this->_historyCollectionFactory->create()->setOrderFilter($this)
1520  ->setOrder('created_at', 'desc')
1521  ->setOrder('entity_id', 'desc');
1522  if ($this->getId()) {
1523  foreach ($collection as $status) {
1524  $status->setOrder($this);
1525  }
1526  }
1527  return $collection;
1528  }
$status
Definition: order_status.php:8

◆ getStatusLabel()

getStatusLabel ( )

Retrieve label of order status

Returns
string

Definition at line 992 of file Order.php.

993  {
994  return $this->getConfig()->getStatusLabel($this->getStatus());
995  }

◆ getStore()

getStore ( )

Retrieve store model instance

Returns
\Magento\Store\Model\Store

Definition at line 514 of file Order.php.

515  {
516  $storeId = $this->getStoreId();
517  if ($storeId) {
518  return $this->_storeManager->getStore($storeId);
519  }
520  return $this->_storeManager->getStore();
521  }

◆ getStoreCurrencyCode()

getStoreCurrencyCode ( )

Return store_currency_code

Returns
string|null

Implements OrderInterface.

Definition at line 3137 of file Order.php.

3138  {
3140  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getStoreGroupName()

getStoreGroupName ( )

Get store group name

Returns
string

Definition at line 1937 of file Order.php.

1938  {
1939  $storeId = $this->getStoreId();
1940  if ($storeId === null) {
1941  return $this->getStoreName(1);
1942  }
1943  return $this->getStore()->getGroup()->getName();
1944  }

◆ getStoreId()

getStoreId ( )

Return store_id

Returns
int|null

Implements OrderInterface.

Definition at line 3147 of file Order.php.

3148  {
3149  return $this->getData(OrderInterface::STORE_ID);
3150  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getStoreName()

getStoreName ( )

Return store_name

Returns
string|null

Implements OrderInterface.

Definition at line 3157 of file Order.php.

3158  {
3159  return $this->getData(OrderInterface::STORE_NAME);
3160  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getStoreToBaseRate()

getStoreToBaseRate ( )

Return store_to_base_rate

Returns
float|null

Implements OrderInterface.

Definition at line 3167 of file Order.php.

3168  {
3170  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getStoreToOrderRate()

getStoreToOrderRate ( )

Return store_to_order_rate

Returns
float|null

Implements OrderInterface.

Definition at line 3177 of file Order.php.

3178  {
3180  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getSubtotal()

getSubtotal ( )

Return subtotal

Returns
float|null

Implements OrderInterface.

Definition at line 3187 of file Order.php.

3188  {
3189  return $this->getData(OrderInterface::SUBTOTAL);
3190  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getSubtotalCanceled()

getSubtotalCanceled ( )

Return subtotal_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 3197 of file Order.php.

3198  {
3200  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getSubtotalInclTax()

getSubtotalInclTax ( )

Return subtotal_incl_tax

Returns
float|null

Implements OrderInterface.

Definition at line 3207 of file Order.php.

3208  {
3210  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getSubtotalInvoiced()

getSubtotalInvoiced ( )

Return subtotal_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 3217 of file Order.php.

3218  {
3220  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getSubtotalRefunded()

getSubtotalRefunded ( )

Return subtotal_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 3227 of file Order.php.

3228  {
3230  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTaxAmount()

getTaxAmount ( )

Return tax_amount

Returns
float|null

Implements OrderInterface.

Definition at line 3237 of file Order.php.

3238  {
3239  return $this->getData(OrderInterface::TAX_AMOUNT);
3240  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTaxCanceled()

getTaxCanceled ( )

Return tax_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 3247 of file Order.php.

3248  {
3249  return $this->getData(OrderInterface::TAX_CANCELED);
3250  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTaxInvoiced()

getTaxInvoiced ( )

Return tax_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 3257 of file Order.php.

3258  {
3259  return $this->getData(OrderInterface::TAX_INVOICED);
3260  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTaxRefunded()

getTaxRefunded ( )

Return tax_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 3267 of file Order.php.

3268  {
3269  return $this->getData(OrderInterface::TAX_REFUNDED);
3270  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTotalCanceled()

getTotalCanceled ( )

Return total_canceled

Returns
float|null

Implements OrderInterface.

Definition at line 3277 of file Order.php.

3278  {
3279  return $this->getData(OrderInterface::TOTAL_CANCELED);
3280  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTotalDue()

getTotalDue ( )

Retrieve order total due value

Returns
float|null

Implements OrderInterface.

Definition at line 1714 of file Order.php.

1715  {
1716  $total = $this->getGrandTotal() - $this->getTotalPaid();
1717  $total = $this->priceCurrency->round($total);
1718  return max($total, 0);
1719  }

◆ getTotalInvoiced()

getTotalInvoiced ( )

Return total_invoiced

Returns
float|null

Implements OrderInterface.

Definition at line 3287 of file Order.php.

3288  {
3289  return $this->getData(OrderInterface::TOTAL_INVOICED);
3290  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTotalItemCount()

getTotalItemCount ( )

Return total_item_count

Returns
int|null

Implements OrderInterface.

Definition at line 3297 of file Order.php.

3298  {
3300  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTotalOfflineRefunded()

getTotalOfflineRefunded ( )

Return total_offline_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 3307 of file Order.php.

3308  {
3310  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTotalOnlineRefunded()

getTotalOnlineRefunded ( )

Return total_online_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 3317 of file Order.php.

3318  {
3320  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTotalPaid()

getTotalPaid ( )

Return total_paid

Returns
float|null

Implements OrderInterface.

Definition at line 3327 of file Order.php.

3328  {
3329  return $this->getData(OrderInterface::TOTAL_PAID);
3330  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTotalQtyOrdered()

getTotalQtyOrdered ( )

Return total_qty_ordered

Returns
float|null

Implements OrderInterface.

Definition at line 3337 of file Order.php.

3338  {
3340  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTotalRefunded()

getTotalRefunded ( )

Return total_refunded

Returns
float|null

Implements OrderInterface.

Definition at line 3347 of file Order.php.

3348  {
3349  return $this->getData(OrderInterface::TOTAL_REFUNDED);
3350  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTrackingNumbers()

getTrackingNumbers ( )

Retrieve tracking numbers

Returns
array

Definition at line 1215 of file Order.php.

1216  {
1217  if ($this->getData('tracking_numbers')) {
1218  return explode(',', $this->getData('tracking_numbers'));
1219  }
1220  return [];
1221  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getTracksCollection()

getTracksCollection ( )

Retrieve order tracking numbers collection

Returns
TrackCollection

Definition at line 1821 of file Order.php.

1822  {
1823  if (empty($this->_tracks)) {
1824  $this->_tracks = $this->_trackCollectionFactory->create()->setOrderFilter($this);
1825 
1826  if ($this->getId()) {
1827  $this->_tracks->load();
1828  }
1829  }
1830  return $this->_tracks;
1831  }

◆ getUpdatedAt()

getUpdatedAt ( )

Return updated_at

Returns
string|null

Implements OrderInterface.

Definition at line 3357 of file Order.php.

3358  {
3359  return $this->getData(OrderInterface::UPDATED_AT);
3360  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getVisibleStatusHistory()

getVisibleStatusHistory ( )

Return collection of visible on frontend order status history items.

Returns
array

Definition at line 1551 of file Order.php.

1552  {
1553  $history = [];
1554  foreach ($this->getStatusHistoryCollection() as $status) {
1555  if (!$status->isDeleted() && $status->getComment() && $status->getIsVisibleOnFront()) {
1556  $history[] = $status;
1557  }
1558  }
1559  return $history;
1560  }
$status
Definition: order_status.php:8

◆ getWeight()

getWeight ( )

Return weight

Returns
float|null

Implements OrderInterface.

Definition at line 3367 of file Order.php.

3368  {
3369  return $this->getData(OrderInterface::WEIGHT);
3370  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ getXForwardedFor()

getXForwardedFor ( )

Return x_forwarded_for

Returns
string|null

Implements OrderInterface.

Definition at line 3377 of file Order.php.

3378  {
3380  }
getData($key='', $index=null)
Definition: Order.php:1740

◆ hasCreditmemos()

hasCreditmemos ( )

Check order creditmemos availability

Returns
bool

Definition at line 1858 of file Order.php.

1859  {
1860  return (bool)$this->getCreditmemosCollection()->count();
1861  }

◆ hasInvoices()

hasInvoices ( )

Check order invoices availability

Returns
bool

Definition at line 1838 of file Order.php.

1839  {
1840  return (bool)$this->getInvoiceCollection()->count();
1841  }

◆ hasShipments()

hasShipments ( )

Check order shipments availability

Returns
bool

Definition at line 1848 of file Order.php.

1849  {
1850  return (bool)$this->getShipmentsCollection()->count();
1851  }

◆ hold()

hold ( )

Hold

Returns
$this
Exceptions

Definition at line 1101 of file Order.php.

1102  {
1103  if (!$this->canHold()) {
1104  throw new \Magento\Framework\Exception\LocalizedException(__('A hold action is not available.'));
1105  }
1106  $this->setHoldBeforeState($this->getState());
1107  $this->setHoldBeforeStatus($this->getStatus());
1108  $this->setState(self::STATE_HOLDED)
1109  ->setStatus($this->getConfig()->getStateDefaultStatus(self::STATE_HOLDED));
1110  return $this;
1111  }
setHoldBeforeStatus($holdBeforeStatus)
Definition: Order.php:4225
__()
Definition: __.php:13
setHoldBeforeState($holdBeforeState)
Definition: Order.php:4217

◆ isCanceled()

isCanceled ( )

Check whether order is canceled

Returns
bool

Definition at line 1997 of file Order.php.

1998  {
1999  return $this->getState() === self::STATE_CANCELED;
2000  }

◆ isCurrencyDifferent()

isCurrencyDifferent ( )

Is currency different

Returns
bool

Definition at line 1704 of file Order.php.

1705  {
1706  return $this->getOrderCurrencyCode() != $this->getBaseCurrencyCode();
1707  }

◆ isFraudDetected()

isFraudDetected ( )

Is order status in DB "Fraud detected"

Returns
bool

Definition at line 1154 of file Order.php.

1155  {
1156  return $this->getOrigData(self::STATE) == self::STATE_PAYMENT_REVIEW
1157  && $this->getOrigData(self::STATUS) == self::STATUS_FRAUD;
1158  }

◆ isPaymentReview()

isPaymentReview ( )

Check whether the payment is in payment review state In this state order cannot be normally processed. Possible actions can be:

  • accept or deny payment
  • fetch transaction information
Returns
bool

Definition at line 838 of file Order.php.

839  {
840  return $this->getState() === self::STATE_PAYMENT_REVIEW;
841  }

◆ loadByAttribute()

loadByAttribute (   $attribute,
  $value 
)

Load order by custom attribute value. Attribute value should be unique

Parameters
string$attribute
string$value
Returns
$this

Definition at line 503 of file Order.php.

504  {
505  $this->load($value, $attribute);
506  return $this;
507  }
$value
Definition: gender.phtml:16

◆ loadByIncrementId()

loadByIncrementId (   $incrementId)

Load order by system increment identifier

Parameters
string$incrementId
Returns
\Magento\Sales\Model\Order

Definition at line 457 of file Order.php.

458  {
459  return $this->loadByAttribute('increment_id', $incrementId);
460  }
loadByAttribute($attribute, $value)
Definition: Order.php:503

◆ loadByIncrementIdAndStoreId()

loadByIncrementIdAndStoreId (   $incrementId,
  $storeId 
)

Load order by system increment and store identifiers

Parameters
string$incrementId
string$storeId
Returns
\Magento\Sales\Model\Order

Definition at line 469 of file Order.php.

470  {
471  $orderCollection = $this->getSalesOrderCollection(
472  [
473  'increment_id' => $incrementId,
474  'store_id' => $storeId
475  ]
476  );
477  return $orderCollection->getFirstItem();
478  }

◆ place()

place ( )

Place order

Returns
$this

Definition at line 1087 of file Order.php.

1088  {
1089  $this->_eventManager->dispatch('sales_order_place_before', ['order' => $this]);
1090  $this->_placePayment();
1091  $this->_eventManager->dispatch('sales_order_place_after', ['order' => $this]);
1092  return $this;
1093  }

◆ prepareInvoice()

prepareInvoice (   $qtys = [])

Create new invoice with maximum qty for invoice for each item

Parameters
array$qtys
Returns
\Magento\Sales\Model\Order\Invoice

Definition at line 1987 of file Order.php.

1988  {
1989  return $this->invoiceManagement->prepareInvoice($this, $qtys);
1990  }

◆ registerCancellation()

registerCancellation (   $comment = '',
  $graceful = true 
)

Prepare order totals to cancellation

Parameters
string$comment
bool$graceful
Returns
$this
Exceptions

Definition at line 1169 of file Order.php.

1170  {
1171  if ($this->canCancel() || $this->isPaymentReview() || $this->isFraudDetected()) {
1172  $state = self::STATE_CANCELED;
1173  foreach ($this->getAllItems() as $item) {
1174  if ($state != self::STATE_PROCESSING && $item->getQtyToRefund()) {
1175  if ($item->isProcessingAvailable()) {
1176  $state = self::STATE_PROCESSING;
1177  } else {
1178  $state = self::STATE_COMPLETE;
1179  }
1180  }
1181  $item->cancel();
1182  }
1183 
1184  $this->setSubtotalCanceled($this->getSubtotal() - $this->getSubtotalInvoiced());
1186 
1187  $this->setTaxCanceled($this->getTaxAmount() - $this->getTaxInvoiced());
1188  $this->setBaseTaxCanceled($this->getBaseTaxAmount() - $this->getBaseTaxInvoiced());
1189 
1190  $this->setShippingCanceled($this->getShippingAmount() - $this->getShippingInvoiced());
1192 
1193  $this->setDiscountCanceled(abs($this->getDiscountAmount()) - $this->getDiscountInvoiced());
1195 
1196  $this->setTotalCanceled($this->getGrandTotal() - $this->getTotalPaid());
1197  $this->setBaseTotalCanceled($this->getBaseGrandTotal() - $this->getBaseTotalPaid());
1198 
1199  $this->setState($state)
1200  ->setStatus($this->getConfig()->getStateDefaultStatus($state));
1201  if (!empty($comment)) {
1202  $this->addStatusHistoryComment($comment, false);
1203  }
1204  } elseif (!$graceful) {
1205  throw new \Magento\Framework\Exception\LocalizedException(__('We cannot cancel this order.'));
1206  }
1207  return $this;
1208  }
setBaseTaxCanceled($baseTaxCanceled)
Definition: Order.php:3577
setTaxCanceled($taxCanceled)
Definition: Order.php:3825
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
setTotalCanceled($totalCanceled)
Definition: Order.php:3849
__()
Definition: __.php:13
setDiscountCanceled($discountCanceled)
Definition: Order.php:3689
setSubtotalCanceled($subtotalCanceled)
Definition: Order.php:3793
addStatusHistoryComment($comment, $status=false)
Definition: Order.php:1022
setBaseTotalCanceled($baseTotalCanceled)
Definition: Order.php:3617
setBaseDiscountCanceled($baseDiscountCanceled)
Definition: Order.php:3457
setBaseShippingCanceled($baseShippingCanceled)
Definition: Order.php:3497
setShippingCanceled($shippingCanceled)
Definition: Order.php:3729
setBaseSubtotalCanceled($baseSubtotalCanceled)
Definition: Order.php:3545

◆ reset()

reset ( )

Reset all data in object so after another load it will be complete new object.

Returns
$this

Definition at line 1951 of file Order.php.

1952  {
1953  $this->unsetData();
1954  $this->_actionFlag = [];
1955  $this->setAddresses(null);
1956  $this->setItems(null);
1957  $this->setPayment(null);
1958  $this->setStatusHistories(null);
1959  $this->_invoices = null;
1960  $this->_tracks = null;
1961  $this->_shipments = null;
1962  $this->_creditmemos = null;
1963  $this->_relatedObjects = [];
1964  $this->_orderCurrency = null;
1965  $this->_baseCurrency = null;
1966 
1967  return $this;
1968  }
setPayment(\Magento\Sales\Api\Data\OrderPaymentInterface $payment=null)
Definition: Order.php:1498
unsetData($key=null)
Definition: Order.php:392
setStatusHistories(array $statusHistories=null)
Definition: Order.php:3385

◆ setActionFlag()

setActionFlag (   $action,
  $flag 
)

Set can flag value for action (edit, unhold, etc...)

Parameters
string$action
boolean$flag
Returns
$this

Definition at line 422 of file Order.php.

423  {
424  $this->_actionFlag[$action] = (bool)$flag;
425  return $this;
426  }

◆ setAdjustmentNegative()

setAdjustmentNegative (   $adjustmentNegative)

Sets the negative adjustment value for the order.

Parameters
float$adjustmentNegative
Returns
$this

Implements OrderInterface.

Definition at line 4001 of file Order.php.

4002  {
4003  return $this->setData(OrderInterface::ADJUSTMENT_NEGATIVE, $adjustmentNegative);
4004  }

◆ setAdjustmentPositive()

setAdjustmentPositive (   $adjustmentPositive)

Sets the positive adjustment value for the order.

Parameters
float$adjustmentPositive
Returns
$this

Implements OrderInterface.

Definition at line 4009 of file Order.php.

4010  {
4011  return $this->setData(OrderInterface::ADJUSTMENT_POSITIVE, $adjustmentPositive);
4012  }

◆ setAppliedRuleIds()

setAppliedRuleIds (   $appliedRuleIds)

Sets the applied rule IDs for the order.

Parameters
string$appliedRuleIds
Returns
$this

Implements OrderInterface.

Definition at line 4113 of file Order.php.

4114  {
4115  return $this->setData(OrderInterface::APPLIED_RULE_IDS, $appliedRuleIds);
4116  }

◆ setBaseAdjustmentNegative()

setBaseAdjustmentNegative (   $baseAdjustmentNegative)

Sets the base negative adjustment value for the order.

Parameters
float$baseAdjustmentNegative
Returns
$this

Implements OrderInterface.

Definition at line 4017 of file Order.php.

4018  {
4019  return $this->setData(OrderInterface::BASE_ADJUSTMENT_NEGATIVE, $baseAdjustmentNegative);
4020  }

◆ setBaseAdjustmentPositive()

setBaseAdjustmentPositive (   $baseAdjustmentPositive)

Sets the base positive adjustment value for the order.

Parameters
float$baseAdjustmentPositive
Returns
$this

Implements OrderInterface.

Definition at line 4025 of file Order.php.

4026  {
4027  return $this->setData(OrderInterface::BASE_ADJUSTMENT_POSITIVE, $baseAdjustmentPositive);
4028  }

◆ setBaseCurrencyCode()

setBaseCurrencyCode (   $code)

Sets the base currency code for the order.

Parameters
string$code
Returns
$this

Implements OrderInterface.

Definition at line 4121 of file Order.php.

◆ setBaseDiscountAmount()

setBaseDiscountAmount (   $amount)

Sets the base discount amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3449 of file Order.php.

◆ setBaseDiscountCanceled()

setBaseDiscountCanceled (   $baseDiscountCanceled)

Sets the base discount canceled for the order.

Parameters
float$baseDiscountCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3457 of file Order.php.

3458  {
3459  return $this->setData(OrderInterface::BASE_DISCOUNT_CANCELED, $baseDiscountCanceled);
3460  }

◆ setBaseDiscountInvoiced()

setBaseDiscountInvoiced (   $baseDiscountInvoiced)

Sets the base discount invoiced amount for the order.

Parameters
float$baseDiscountInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3465 of file Order.php.

3466  {
3467  return $this->setData(OrderInterface::BASE_DISCOUNT_INVOICED, $baseDiscountInvoiced);
3468  }

◆ setBaseDiscountRefunded()

setBaseDiscountRefunded (   $baseDiscountRefunded)

Sets the base discount refunded amount for the order.

Parameters
float$baseDiscountRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3473 of file Order.php.

3474  {
3475  return $this->setData(OrderInterface::BASE_DISCOUNT_REFUNDED, $baseDiscountRefunded);
3476  }

◆ setBaseDiscountTaxCompensationAmount()

setBaseDiscountTaxCompensationAmount (   $amount)

Sets the base discount tax compensation amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4353 of file Order.php.

◆ setBaseDiscountTaxCompensationInvoiced()

setBaseDiscountTaxCompensationInvoiced (   $baseDiscountTaxCompensationInvoiced)

Sets the base discount tax compensation invoiced amount for the order.

Parameters
float$baseDiscountTaxCompensationInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 4385 of file Order.php.

4386  {
4387  return $this->setData(
4389  $baseDiscountTaxCompensationInvoiced
4390  );
4391  }

◆ setBaseDiscountTaxCompensationRefunded()

setBaseDiscountTaxCompensationRefunded (   $baseDiscountTaxCompensationRefunded)

Sets the base discount tax compensation refunded amount for the order.

Parameters
float$baseDiscountTaxCompensationRefunded
Returns
$this

Implements OrderInterface.

Definition at line 4407 of file Order.php.

4408  {
4409  return $this->setData(
4411  $baseDiscountTaxCompensationRefunded
4412  );
4413  }

◆ setBaseGrandTotal()

setBaseGrandTotal (   $amount)

Sets the base grand total for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3481 of file Order.php.

◆ setBaseShippingAmount()

setBaseShippingAmount (   $amount)

Sets the base shipping amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3489 of file Order.php.

◆ setBaseShippingCanceled()

setBaseShippingCanceled (   $baseShippingCanceled)

Sets the base shipping canceled for the order.

Parameters
float$baseShippingCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3497 of file Order.php.

3498  {
3499  return $this->setData(OrderInterface::BASE_SHIPPING_CANCELED, $baseShippingCanceled);
3500  }

◆ setBaseShippingDiscountAmount()

setBaseShippingDiscountAmount (   $amount)

Sets the base shipping discount amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4033 of file Order.php.

◆ setBaseShippingDiscountTaxCompensationAmnt()

setBaseShippingDiscountTaxCompensationAmnt (   $amnt)

Sets the base shipping discount tax compensation amount for the order.

Parameters
float$amnt
Returns
$this

Implements OrderInterface.

Definition at line 4369 of file Order.php.

◆ setBaseShippingInclTax()

setBaseShippingInclTax (   $amount)

Sets the base shipping including tax for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4426 of file Order.php.

◆ setBaseShippingInvoiced()

setBaseShippingInvoiced (   $baseShippingInvoiced)

Sets the base shipping invoiced amount for the order.

Parameters
float$baseShippingInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3505 of file Order.php.

3506  {
3507  return $this->setData(OrderInterface::BASE_SHIPPING_INVOICED, $baseShippingInvoiced);
3508  }

◆ setBaseShippingRefunded()

setBaseShippingRefunded (   $baseShippingRefunded)

Sets the base shipping refunded amount for the order.

Parameters
float$baseShippingRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3513 of file Order.php.

3514  {
3515  return $this->setData(OrderInterface::BASE_SHIPPING_REFUNDED, $baseShippingRefunded);
3516  }

◆ setBaseShippingTaxAmount()

setBaseShippingTaxAmount (   $amount)

Sets the base shipping tax amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3521 of file Order.php.

◆ setBaseShippingTaxRefunded()

setBaseShippingTaxRefunded (   $baseShippingTaxRefunded)

Sets the base shipping tax refunded amount for the order.

Parameters
float$baseShippingTaxRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3529 of file Order.php.

3530  {
3531  return $this->setData(OrderInterface::BASE_SHIPPING_TAX_REFUNDED, $baseShippingTaxRefunded);
3532  }

◆ setBaseSubtotal()

setBaseSubtotal (   $amount)

Sets the base subtotal for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3537 of file Order.php.

◆ setBaseSubtotalCanceled()

setBaseSubtotalCanceled (   $baseSubtotalCanceled)

Sets the base subtotal canceled for the order.

Parameters
float$baseSubtotalCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3545 of file Order.php.

3546  {
3547  return $this->setData(OrderInterface::BASE_SUBTOTAL_CANCELED, $baseSubtotalCanceled);
3548  }

◆ setBaseSubtotalInclTax()

setBaseSubtotalInclTax (   $amount)

Sets the base subtotal including tax for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4041 of file Order.php.

◆ setBaseSubtotalInvoiced()

setBaseSubtotalInvoiced (   $baseSubtotalInvoiced)

Sets the base subtotal invoiced amount for the order.

Parameters
float$baseSubtotalInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3553 of file Order.php.

3554  {
3555  return $this->setData(OrderInterface::BASE_SUBTOTAL_INVOICED, $baseSubtotalInvoiced);
3556  }

◆ setBaseSubtotalRefunded()

setBaseSubtotalRefunded (   $baseSubtotalRefunded)

Sets the base subtotal refunded amount for the order.

Parameters
float$baseSubtotalRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3561 of file Order.php.

3562  {
3563  return $this->setData(OrderInterface::BASE_SUBTOTAL_REFUNDED, $baseSubtotalRefunded);
3564  }

◆ setBaseTaxAmount()

setBaseTaxAmount (   $amount)

Sets the base tax amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3569 of file Order.php.

◆ setBaseTaxCanceled()

setBaseTaxCanceled (   $baseTaxCanceled)

Sets the base tax canceled for the order.

Parameters
float$baseTaxCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3577 of file Order.php.

3578  {
3579  return $this->setData(OrderInterface::BASE_TAX_CANCELED, $baseTaxCanceled);
3580  }

◆ setBaseTaxInvoiced()

setBaseTaxInvoiced (   $baseTaxInvoiced)

Sets the base tax invoiced amount for the order.

Parameters
float$baseTaxInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3585 of file Order.php.

3586  {
3587  return $this->setData(OrderInterface::BASE_TAX_INVOICED, $baseTaxInvoiced);
3588  }

◆ setBaseTaxRefunded()

setBaseTaxRefunded (   $baseTaxRefunded)

Sets the base tax refunded amount for the order.

Parameters
float$baseTaxRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3593 of file Order.php.

3594  {
3595  return $this->setData(OrderInterface::BASE_TAX_REFUNDED, $baseTaxRefunded);
3596  }

◆ setBaseToGlobalRate()

setBaseToGlobalRate (   $rate)

Sets the base-to-global rate for the order.

Parameters
float$rate
Returns
$this

Implements OrderInterface.

Definition at line 3601 of file Order.php.

◆ setBaseToOrderRate()

setBaseToOrderRate (   $rate)

Sets the base-to-order rate for the order.

Parameters
float$rate
Returns
$this

Implements OrderInterface.

Definition at line 3609 of file Order.php.

◆ setBaseTotalCanceled()

setBaseTotalCanceled (   $baseTotalCanceled)

Sets the base total canceled for the order.

Parameters
float$baseTotalCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3617 of file Order.php.

3618  {
3619  return $this->setData(OrderInterface::BASE_TOTAL_CANCELED, $baseTotalCanceled);
3620  }

◆ setBaseTotalDue()

setBaseTotalDue (   $baseTotalDue)

Sets the base total due for the order.

Parameters
float$baseTotalDue
Returns
$this

Implements OrderInterface.

Definition at line 4049 of file Order.php.

◆ setBaseTotalInvoiced()

setBaseTotalInvoiced (   $baseTotalInvoiced)

Sets the base total invoiced amount for the order.

Parameters
float$baseTotalInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3625 of file Order.php.

3626  {
3627  return $this->setData(OrderInterface::BASE_TOTAL_INVOICED, $baseTotalInvoiced);
3628  }

◆ setBaseTotalInvoicedCost()

setBaseTotalInvoicedCost (   $baseTotalInvoicedCost)

Sets the base total invoiced cost for the order.

Parameters
float$baseTotalInvoicedCost
Returns
$this

Implements OrderInterface.

Definition at line 3633 of file Order.php.

3634  {
3635  return $this->setData(OrderInterface::BASE_TOTAL_INVOICED_COST, $baseTotalInvoicedCost);
3636  }

◆ setBaseTotalOfflineRefunded()

setBaseTotalOfflineRefunded (   $baseTotalOfflineRefunded)

Sets the base total offline refunded amount for the order.

Parameters
float$baseTotalOfflineRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3641 of file Order.php.

3642  {
3643  return $this->setData(OrderInterface::BASE_TOTAL_OFFLINE_REFUNDED, $baseTotalOfflineRefunded);
3644  }

◆ setBaseTotalOnlineRefunded()

setBaseTotalOnlineRefunded (   $baseTotalOnlineRefunded)

Sets the base total online refunded amount for the order.

Parameters
float$baseTotalOnlineRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3649 of file Order.php.

3650  {
3651  return $this->setData(OrderInterface::BASE_TOTAL_ONLINE_REFUNDED, $baseTotalOnlineRefunded);
3652  }

◆ setBaseTotalPaid()

setBaseTotalPaid (   $baseTotalPaid)

Sets the base total paid for the order.

Parameters
float$baseTotalPaid
Returns
$this

Implements OrderInterface.

Definition at line 3657 of file Order.php.

◆ setBaseTotalQtyOrdered()

setBaseTotalQtyOrdered (   $baseTotalQtyOrdered)

Sets the base total quantity ordered for the order.

Parameters
float$baseTotalQtyOrdered
Returns
$this

Implements OrderInterface.

Definition at line 3665 of file Order.php.

3666  {
3667  return $this->setData(OrderInterface::BASE_TOTAL_QTY_ORDERED, $baseTotalQtyOrdered);
3668  }

◆ setBaseTotalRefunded()

setBaseTotalRefunded (   $baseTotalRefunded)

Sets the base total refunded amount for the order.

Parameters
float$baseTotalRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3673 of file Order.php.

3674  {
3675  return $this->setData(OrderInterface::BASE_TOTAL_REFUNDED, $baseTotalRefunded);
3676  }

◆ setBillingAddress()

setBillingAddress ( \Magento\Sales\Api\Data\OrderAddressInterface  $address = null)

Sets the billing address, if any, for the order.

Parameters
\Magento\Sales\Api\Data\OrderAddressInterface$address
Returns
$this

Definition at line 912 of file Order.php.

913  {
914  $old = $this->getBillingAddress();
915  if (!empty($old) && !empty($address)) {
916  $address->setId($old->getId());
917  }
918 
919  if (!empty($address)) {
920  $address->setEmail($this->getCustomerEmail());
921  $this->addAddress($address->setAddressType('billing'));
922  }
923  return $this;
924  }
$old
Definition: website.php:27
addAddress(\Magento\Sales\Model\Order\Address $address)
Definition: Order.php:1280
$address
Definition: customer.php:38

◆ setBillingAddressId()

setBillingAddressId (   $id)

Sets the billing address ID for the order.

Parameters
int$id
Returns
$this

Implements OrderInterface.

Definition at line 3937 of file Order.php.

◆ setCanSendNewEmailFlag()

setCanSendNewEmailFlag (   $flag)

Set flag for order if it can sends new email to customer.

Parameters
bool$flag
Returns
$this

Definition at line 445 of file Order.php.

446  {
447  $this->_canSendNewEmailFlag = (bool)$flag;
448  return $this;
449  }

◆ setCanShipPartially()

setCanShipPartially (   $flag)

Sets the can-ship-partially flag value for the order.

Parameters
int$flag
Returns
$this

Implements OrderInterface.

Definition at line 3905 of file Order.php.

◆ setCanShipPartiallyItem()

setCanShipPartiallyItem (   $flag)

Sets the can-ship-partially-item flag value for the order.

Parameters
int$flag
Returns
$this

Implements OrderInterface.

Definition at line 3913 of file Order.php.

◆ setCouponCode()

setCouponCode (   $code)

Sets the coupon code for the order.

Parameters
string$code
Returns
$this

Implements OrderInterface.

Definition at line 3401 of file Order.php.

◆ setCreatedAt()

setCreatedAt (   $createdAt)

Sets the created-at timestamp for the order.

Parameters
string$createdAttimestamp
Returns
$this

Implements OrderInterface.

Definition at line 2567 of file Order.php.

◆ setCustomerDob()

setCustomerDob (   $customerDob)

Sets the customer date-of-birth (DOB) for the order.

Parameters
string$customerDob
Returns
$this

Implements OrderInterface.

Definition at line 4097 of file Order.php.

◆ setCustomerEmail()

setCustomerEmail (   $customerEmail)

Sets the customer email address for the order.

Parameters
string$customerEmail
Returns
$this

Implements OrderInterface.

Definition at line 4129 of file Order.php.

◆ setCustomerFirstname()

setCustomerFirstname (   $customerFirstname)

Sets the customer first name for the order.

Parameters
string$customerFirstname
Returns
$this

Implements OrderInterface.

Definition at line 4137 of file Order.php.

4138  {
4139  return $this->setData(OrderInterface::CUSTOMER_FIRSTNAME, $customerFirstname);
4140  }

◆ setCustomerGender()

setCustomerGender (   $customerGender)

Sets the customer gender for the order.

Parameters
int$customerGender
Returns
$this

Implements OrderInterface.

Definition at line 4337 of file Order.php.

4338  {
4339  return $this->setData(OrderInterface::CUSTOMER_GENDER, $customerGender);
4340  }

◆ setCustomerGroupId()

setCustomerGroupId (   $id)

Sets the customer group ID for the order.

Parameters
int$id
Returns
$this

Implements OrderInterface.

Definition at line 3945 of file Order.php.

◆ setCustomerId()

setCustomerId (   $id)

Sets the customer ID for the order.

Parameters
int$id
Returns
$this

Implements OrderInterface.

Definition at line 3441 of file Order.php.

◆ setCustomerIsGuest()

setCustomerIsGuest (   $customerIsGuest)

Sets the customer-is-guest flag value for the order.

Parameters
int$customerIsGuest
Returns
$this

Implements OrderInterface.

Definition at line 3921 of file Order.php.

3922  {
3923  return $this->setData(OrderInterface::CUSTOMER_IS_GUEST, $customerIsGuest);
3924  }

◆ setCustomerLastname()

setCustomerLastname (   $customerLastname)

Sets the customer last name for the order.

Parameters
string$customerLastname
Returns
$this

Implements OrderInterface.

Definition at line 4145 of file Order.php.

4146  {
4147  return $this->setData(OrderInterface::CUSTOMER_LASTNAME, $customerLastname);
4148  }

◆ setCustomerMiddlename()

setCustomerMiddlename (   $customerMiddlename)

Sets the customer middle name for the order.

Parameters
string$customerMiddlename
Returns
$this

Implements OrderInterface.

Definition at line 4153 of file Order.php.

4154  {
4155  return $this->setData(OrderInterface::CUSTOMER_MIDDLENAME, $customerMiddlename);
4156  }

◆ setCustomerNote()

setCustomerNote (   $customerNote)

Sets the customer note for the order.

Parameters
string$customerNote
Returns
$this

Implements OrderInterface.

Definition at line 4313 of file Order.php.

◆ setCustomerNoteNotify()

setCustomerNoteNotify (   $customerNoteNotify)

Sets the customer-note-notify flag value for the order.

Parameters
int$customerNoteNotify
Returns
$this

Implements OrderInterface.

Definition at line 3929 of file Order.php.

3930  {
3931  return $this->setData(OrderInterface::CUSTOMER_NOTE_NOTIFY, $customerNoteNotify);
3932  }

◆ setCustomerPrefix()

setCustomerPrefix (   $customerPrefix)

Sets the customer prefix for the order.

Parameters
string$customerPrefix
Returns
$this

Implements OrderInterface.

Definition at line 4161 of file Order.php.

4162  {
4163  return $this->setData(OrderInterface::CUSTOMER_PREFIX, $customerPrefix);
4164  }

◆ setCustomerSuffix()

setCustomerSuffix (   $customerSuffix)

Sets the customer suffix for the order.

Parameters
string$customerSuffix
Returns
$this

Implements OrderInterface.

Definition at line 4169 of file Order.php.

4170  {
4171  return $this->setData(OrderInterface::CUSTOMER_SUFFIX, $customerSuffix);
4172  }

◆ setCustomerTaxvat()

setCustomerTaxvat (   $customerTaxvat)

Sets the customer value-added tax (VAT) for the order.

Parameters
string$customerTaxvat
Returns
$this

Implements OrderInterface.

Definition at line 4177 of file Order.php.

4178  {
4179  return $this->setData(OrderInterface::CUSTOMER_TAXVAT, $customerTaxvat);
4180  }

◆ setDiscountAmount()

setDiscountAmount (   $amount)

Sets the discount amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3681 of file Order.php.

◆ setDiscountCanceled()

setDiscountCanceled (   $discountCanceled)

Sets the discount canceled for the order.

Parameters
float$discountCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3689 of file Order.php.

3690  {
3691  return $this->setData(OrderInterface::DISCOUNT_CANCELED, $discountCanceled);
3692  }

◆ setDiscountDescription()

setDiscountDescription (   $description)

Sets the discount description for the order.

Parameters
string$description
Returns
$this

Implements OrderInterface.

Definition at line 4185 of file Order.php.

◆ setDiscountInvoiced()

setDiscountInvoiced (   $discountInvoiced)

Sets the discount invoiced amount for the order.

Parameters
float$discountInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3697 of file Order.php.

3698  {
3699  return $this->setData(OrderInterface::DISCOUNT_INVOICED, $discountInvoiced);
3700  }

◆ setDiscountRefunded()

setDiscountRefunded (   $discountRefunded)

Sets the discount refunded amount for the order.

Parameters
float$discountRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3705 of file Order.php.

3706  {
3707  return $this->setData(OrderInterface::DISCOUNT_REFUNDED, $discountRefunded);
3708  }

◆ setDiscountTaxCompensationAmount()

setDiscountTaxCompensationAmount (   $amount)

Sets the discount tax compensation amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4345 of file Order.php.

◆ setDiscountTaxCompensationInvoiced()

setDiscountTaxCompensationInvoiced (   $discountTaxCompensationInvoiced)

Sets the discount tax compensation invoiced amount for the order.

Parameters
float$discountTaxCompensationInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 4377 of file Order.php.

4378  {
4379  return $this->setData(OrderInterface::DISCOUNT_TAX_COMPENSATION_INVOICED, $discountTaxCompensationInvoiced);
4380  }

◆ setDiscountTaxCompensationRefunded()

setDiscountTaxCompensationRefunded (   $discountTaxCompensationRefunded)

Sets the discount tax compensation refunded amount for the order.

Parameters
float$discountTaxCompensationRefunded
Returns
$this

Implements OrderInterface.

Definition at line 4396 of file Order.php.

4397  {
4398  return $this->setData(
4400  $discountTaxCompensationRefunded
4401  );
4402  }

◆ setEditIncrement()

setEditIncrement (   $editIncrement)

Sets the edit increment value for the order.

Parameters
int$editIncrement
Returns
$this

Implements OrderInterface.

Definition at line 3953 of file Order.php.

◆ setEmailSent()

setEmailSent (   $emailSent)

Sets the email-sent flag value for the order.

Parameters
int$emailSent
Returns
$this

Implements OrderInterface.

Definition at line 3961 of file Order.php.

◆ setExtCustomerId()

setExtCustomerId (   $id)

Sets the external customer ID for the order.

Parameters
string$id
Returns
$this

Implements OrderInterface.

Definition at line 4193 of file Order.php.

◆ setExtensionAttributes()

setExtensionAttributes ( \Magento\Sales\Api\Data\OrderExtensionInterface  $extensionAttributes)

Set an extension attributes object.

Parameters
\Magento\Sales\Api\Data\OrderExtensionInterface$extensionAttributes
Returns
$this

Parameters
\Magento\Sales\Api\Data\OrderExtensionInterface$extensionAttributes
Returns
$this

Implements OrderInterface.

Definition at line 2087 of file Order.php.

2088  {
2090  }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)

◆ setExtOrderId()

setExtOrderId (   $id)

Sets the external order ID for the order.

Parameters
string$id
Returns
$this

Implements OrderInterface.

Definition at line 4201 of file Order.php.

◆ setForcedShipmentWithInvoice()

setForcedShipmentWithInvoice (   $forcedShipmentWithInvoice)

Sets the forced-shipment-with-invoice flag value for the order.

Parameters
int$forcedShipmentWithInvoice
Returns
$this

Implements OrderInterface.

Definition at line 3969 of file Order.php.

3970  {
3971  return $this->setData(OrderInterface::FORCED_SHIPMENT_WITH_INVOICE, $forcedShipmentWithInvoice);
3972  }

◆ setGlobalCurrencyCode()

setGlobalCurrencyCode (   $code)

Sets the global currency code for the order.

Parameters
string$code
Returns
$this

Implements OrderInterface.

Definition at line 4209 of file Order.php.

◆ setGrandTotal()

setGrandTotal (   $amount)

Sets the grand total for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3713 of file Order.php.

◆ setHistoryEntityName()

setHistoryEntityName (   $entityName)

Overrides entity id, which will be saved to comments history status

Parameters
string$entityName
Returns
$this

Definition at line 1066 of file Order.php.

1067  {
1068  $this->entityType = $entityName;
1069  return $this;
1070  }

◆ setHoldBeforeState()

setHoldBeforeState (   $holdBeforeState)

Sets the hold before state for the order.

Parameters
string$holdBeforeState
Returns
$this

Implements OrderInterface.

Definition at line 4217 of file Order.php.

4218  {
4219  return $this->setData(OrderInterface::HOLD_BEFORE_STATE, $holdBeforeState);
4220  }

◆ setHoldBeforeStatus()

setHoldBeforeStatus (   $holdBeforeStatus)

Sets the hold before status for the order.

Parameters
string$holdBeforeStatus
Returns
$this

Implements OrderInterface.

Definition at line 4225 of file Order.php.

4226  {
4227  return $this->setData(OrderInterface::HOLD_BEFORE_STATUS, $holdBeforeStatus);
4228  }

◆ setIncrementId()

setIncrementId (   $id)

Sets the increment ID for the order.

Parameters
string$id
Returns
$this

Implements OrderInterface.

Definition at line 4105 of file Order.php.

◆ setInvoiceCollection()

setInvoiceCollection ( InvoiceCollection  $invoices)
Parameters
InvoiceCollection$invoices
Returns
$this

Definition at line 1776 of file Order.php.

1777  {
1778  $this->_invoices = $invoices;
1779  return $this;
1780  }
$invoices

◆ setIsVirtual()

setIsVirtual (   $isVirtual)

Sets the is-virtual flag value for the order.

Parameters
int$isVirtual
Returns
$this

Implements OrderInterface.

Definition at line 3425 of file Order.php.

◆ setItems()

setItems (   $items)

Sets items for the order.

Parameters
@codeCoverageIgnore

Implements OrderInterface.

Definition at line 2034 of file Order.php.

◆ setOrderCurrencyCode()

setOrderCurrencyCode (   $code)

Sets the order currency code for the order.

Parameters
string$code
Returns
$this

Implements OrderInterface.

Definition at line 4233 of file Order.php.

◆ setOriginalIncrementId()

setOriginalIncrementId (   $id)

Sets the original increment ID for the order.

Parameters
string$id
Returns
$this

Implements OrderInterface.

Definition at line 4241 of file Order.php.

◆ setPayment()

setPayment ( \Magento\Sales\Api\Data\OrderPaymentInterface  $payment = null)

Definition at line 1498 of file Order.php.

1499  {
1501  if ($payment !== null) {
1502  $payment->setOrder($this)->setParentId($this->getId());
1503  if (!$payment->getId()) {
1504  $this->setDataChanges(true);
1505  }
1506  }
1507  return $payment;
1508  }
$payment
Definition: order.php:17

◆ setPaymentAuthExpiration()

setPaymentAuthExpiration (   $paymentAuthExpiration)

Sets the payment authorization expiration date for the order.

Parameters
int$paymentAuthExpiration
Returns
$this

Implements OrderInterface.

Definition at line 3977 of file Order.php.

3978  {
3979  return $this->setData(OrderInterface::PAYMENT_AUTH_EXPIRATION, $paymentAuthExpiration);
3980  }

◆ setPaymentAuthorizationAmount()

setPaymentAuthorizationAmount (   $amount)

Sets the payment authorization amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4057 of file Order.php.

◆ setProtectCode()

setProtectCode (   $code)

Sets the protect code for the order.

Parameters
string$code
Returns
$this

Implements OrderInterface.

Definition at line 3409 of file Order.php.

◆ setQuoteAddressId()

setQuoteAddressId (   $id)

Sets the quote address ID for the order.

Parameters
int$id
Returns
$this

Implements OrderInterface.

Definition at line 3985 of file Order.php.

◆ setQuoteId()

setQuoteId (   $id)

Sets the quote ID for the order.

Parameters
int$id
Returns
$this

Implements OrderInterface.

Definition at line 3993 of file Order.php.

◆ setRelationChildId()

setRelationChildId (   $id)

Sets the relation child ID for the order.

Parameters
string$id
Returns
$this

Implements OrderInterface.

Definition at line 4249 of file Order.php.

◆ setRelationChildRealId()

setRelationChildRealId (   $realId)

Sets the relation child real ID for the order.

Parameters
string$realId
Returns
$this

Implements OrderInterface.

Definition at line 4257 of file Order.php.

◆ setRelationParentId()

setRelationParentId (   $id)

Sets the relation parent ID for the order.

Parameters
string$id
Returns
$this

Implements OrderInterface.

Definition at line 4265 of file Order.php.

◆ setRelationParentRealId()

setRelationParentRealId (   $realId)

Sets the relation parent real ID for the order.

Parameters
string$realId
Returns
$this

Implements OrderInterface.

Definition at line 4273 of file Order.php.

◆ setRemoteIp()

setRemoteIp (   $remoteIp)

Sets the remote IP address for the order.

Parameters
string$remoteIp
Returns
$this

Implements OrderInterface.

Definition at line 4281 of file Order.php.

◆ setShippingAddress()

setShippingAddress ( \Magento\Sales\Api\Data\OrderAddressInterface  $address = null)

Declare order shipping address

Parameters
\Magento\Sales\Api\Data\OrderAddressInterface$address
Returns
$this

Definition at line 932 of file Order.php.

933  {
934  $old = $this->getShippingAddress();
935  if (!empty($old) && !empty($address)) {
936  $address->setId($old->getId());
937  }
938 
939  if (!empty($address)) {
940  $address->setEmail($this->getCustomerEmail());
941  $this->addAddress($address->setAddressType('shipping'));
942  }
943  return $this;
944  }
$old
Definition: website.php:27
addAddress(\Magento\Sales\Model\Order\Address $address)
Definition: Order.php:1280
$address
Definition: customer.php:38

◆ setShippingAmount()

setShippingAmount (   $amount)

Sets the shipping amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3721 of file Order.php.

◆ setShippingCanceled()

setShippingCanceled (   $shippingCanceled)

Sets the shipping canceled amount for the order.

Parameters
float$shippingCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3729 of file Order.php.

3730  {
3731  return $this->setData(OrderInterface::SHIPPING_CANCELED, $shippingCanceled);
3732  }

◆ setShippingDescription()

setShippingDescription (   $description)

Sets the shipping description for the order.

Parameters
string$description
Returns
$this

Implements OrderInterface.

Definition at line 3417 of file Order.php.

◆ setShippingDiscountAmount()

setShippingDiscountAmount (   $amount)

Sets the shipping discount amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4065 of file Order.php.

◆ setShippingDiscountTaxCompensationAmount()

setShippingDiscountTaxCompensationAmount (   $amount)

Sets the shipping discount tax compensation amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4361 of file Order.php.

◆ setShippingInclTax()

setShippingInclTax (   $amount)

Sets the shipping including tax amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4418 of file Order.php.

◆ setShippingInvoiced()

setShippingInvoiced (   $shippingInvoiced)

Sets the shipping invoiced amount for the order.

Parameters
float$shippingInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3737 of file Order.php.

3738  {
3739  return $this->setData(OrderInterface::SHIPPING_INVOICED, $shippingInvoiced);
3740  }

◆ setShippingMethod()

setShippingMethod (   $shippingMethod)

Sets shipping method to order

Parameters
string$shippingMethod
Returns
$this

Definition at line 4438 of file Order.php.

4439  {
4440  return $this->setData('shipping_method', $shippingMethod);
4441  }
$shippingMethod
Definition: popup.phtml:12

◆ setShippingRefunded()

setShippingRefunded (   $shippingRefunded)

Sets the shipping refunded amount for the order.

Parameters
float$shippingRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3745 of file Order.php.

3746  {
3747  return $this->setData(OrderInterface::SHIPPING_REFUNDED, $shippingRefunded);
3748  }

◆ setShippingTaxAmount()

setShippingTaxAmount (   $amount)

Sets the shipping tax amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3753 of file Order.php.

◆ setShippingTaxRefunded()

setShippingTaxRefunded (   $shippingTaxRefunded)

Sets the shipping tax refunded amount for the order.

Parameters
float$shippingTaxRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3761 of file Order.php.

3762  {
3763  return $this->setData(OrderInterface::SHIPPING_TAX_REFUNDED, $shippingTaxRefunded);
3764  }

◆ setState()

setState (   $state)

Sets the state for the order.

Parameters
string$state
Returns
$this

Parameters
string$state
Returns
$this

Implements OrderInterface.

Definition at line 982 of file Order.php.

983  {
984  return $this->setData(self::STATE, $state);
985  }

◆ setStatus()

setStatus (   $status)

Sets the status for the order.

Parameters
string$status
Returns
$this

Implements OrderInterface.

Definition at line 3393 of file Order.php.

◆ setStatusHistories()

setStatusHistories ( array  $statusHistories = null)

Sets status histories for the order.

Parameters

Implements OrderInterface.

Definition at line 3385 of file Order.php.

3386  {
3387  return $this->setData(OrderInterface::STATUS_HISTORIES, $statusHistories);
3388  }

◆ setStoreCurrencyCode()

setStoreCurrencyCode (   $code)

Sets the store currency code for the order.

Parameters
string$code
Returns
$this

Implements OrderInterface.

Definition at line 4289 of file Order.php.

◆ setStoreId()

setStoreId (   $id)

Sets the store ID for the order.

Parameters
int$id
Returns
$this

Implements OrderInterface.

Definition at line 3433 of file Order.php.

◆ setStoreName()

setStoreName (   $storeName)

Sets the store name for the order.

Parameters
string$storeName
Returns
$this

Implements OrderInterface.

Definition at line 4297 of file Order.php.

◆ setStoreToBaseRate()

setStoreToBaseRate (   $rate)

Sets the store-to-base rate for the order.

Parameters
float$rate
Returns
$this

Implements OrderInterface.

Definition at line 3769 of file Order.php.

◆ setStoreToOrderRate()

setStoreToOrderRate (   $rate)

Sets the store-to-order rate for the order.

Parameters
float$rate
Returns
$this

Implements OrderInterface.

Definition at line 3777 of file Order.php.

◆ setSubtotal()

setSubtotal (   $amount)

Sets the subtotal for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3785 of file Order.php.

◆ setSubtotalCanceled()

setSubtotalCanceled (   $subtotalCanceled)

Sets the subtotal canceled amount for the order.

Parameters
float$subtotalCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3793 of file Order.php.

3794  {
3795  return $this->setData(OrderInterface::SUBTOTAL_CANCELED, $subtotalCanceled);
3796  }

◆ setSubtotalInclTax()

setSubtotalInclTax (   $amount)

Sets the subtotal including tax amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 4073 of file Order.php.

◆ setSubtotalInvoiced()

setSubtotalInvoiced (   $subtotalInvoiced)

Sets the subtotal invoiced amount for the order.

Parameters
float$subtotalInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3801 of file Order.php.

3802  {
3803  return $this->setData(OrderInterface::SUBTOTAL_INVOICED, $subtotalInvoiced);
3804  }

◆ setSubtotalRefunded()

setSubtotalRefunded (   $subtotalRefunded)

Sets the subtotal refunded amount for the order.

Parameters
float$subtotalRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3809 of file Order.php.

3810  {
3811  return $this->setData(OrderInterface::SUBTOTAL_REFUNDED, $subtotalRefunded);
3812  }

◆ setTaxAmount()

setTaxAmount (   $amount)

Sets the tax amount for the order.

Parameters
float$amount
Returns
$this

Implements OrderInterface.

Definition at line 3817 of file Order.php.

◆ setTaxCanceled()

setTaxCanceled (   $taxCanceled)

Sets the tax canceled amount for the order.

Parameters
float$taxCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3825 of file Order.php.

◆ setTaxInvoiced()

setTaxInvoiced (   $taxInvoiced)

Sets the tax invoiced amount for the order.

Parameters
float$taxInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3833 of file Order.php.

◆ setTaxRefunded()

setTaxRefunded (   $taxRefunded)

Sets the tax refunded amount for the order.

Parameters
float$taxRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3841 of file Order.php.

◆ setTotalCanceled()

setTotalCanceled (   $totalCanceled)

Sets the total canceled for the order.

Parameters
float$totalCanceled
Returns
$this

Implements OrderInterface.

Definition at line 3849 of file Order.php.

◆ setTotalDue()

setTotalDue (   $totalDue)

Sets the total due for the order.

Parameters
float$totalDue
Returns
$this

Implements OrderInterface.

Definition at line 4081 of file Order.php.

◆ setTotalInvoiced()

setTotalInvoiced (   $totalInvoiced)

Sets the total invoiced amount for the order.

Parameters
float$totalInvoiced
Returns
$this

Implements OrderInterface.

Definition at line 3857 of file Order.php.

◆ setTotalItemCount()

setTotalItemCount (   $totalItemCount)

Sets the total item count for the order.

Parameters
int$totalItemCount
Returns
$this

Implements OrderInterface.

Definition at line 4329 of file Order.php.

4330  {
4331  return $this->setData(OrderInterface::TOTAL_ITEM_COUNT, $totalItemCount);
4332  }

◆ setTotalOfflineRefunded()

setTotalOfflineRefunded (   $totalOfflineRefunded)

Sets the total offline refunded amount for the order.

Parameters
float$totalOfflineRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3865 of file Order.php.

3866  {
3867  return $this->setData(OrderInterface::TOTAL_OFFLINE_REFUNDED, $totalOfflineRefunded);
3868  }

◆ setTotalOnlineRefunded()

setTotalOnlineRefunded (   $totalOnlineRefunded)

Sets the total online refunded amount for the order.

Parameters
float$totalOnlineRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3873 of file Order.php.

3874  {
3875  return $this->setData(OrderInterface::TOTAL_ONLINE_REFUNDED, $totalOnlineRefunded);
3876  }

◆ setTotalPaid()

setTotalPaid (   $totalPaid)

Sets the total paid for the order.

Parameters
float$totalPaid
Returns
$this

Implements OrderInterface.

Definition at line 3881 of file Order.php.

◆ setTotalQtyOrdered()

setTotalQtyOrdered (   $totalQtyOrdered)

Sets the total quantity ordered for the order.

Parameters
float$totalQtyOrdered
Returns
$this

Implements OrderInterface.

Definition at line 3889 of file Order.php.

3890  {
3891  return $this->setData(OrderInterface::TOTAL_QTY_ORDERED, $totalQtyOrdered);
3892  }

◆ setTotalRefunded()

setTotalRefunded (   $totalRefunded)

Sets the total amount refunded amount for the order.

Parameters
float$totalRefunded
Returns
$this

Implements OrderInterface.

Definition at line 3897 of file Order.php.

◆ setUpdatedAt()

setUpdatedAt (   $timestamp)

Sets the updated-at timestamp for the order.

Parameters
string$timestamp
Returns
$this

Implements OrderInterface.

Definition at line 4321 of file Order.php.

◆ setWeight()

setWeight (   $weight)

Sets the weight for the order.

Parameters
float$weight
Returns
$this

Implements OrderInterface.

Definition at line 4089 of file Order.php.

◆ setXForwardedFor()

setXForwardedFor (   $xForwardedFor)

Sets the X-Forwarded-For HTTP header field for the order.

Parameters
string$xForwardedFor
Returns
$this

Implements OrderInterface.

Definition at line 4305 of file Order.php.

◆ unhold()

unhold ( )

Attempt to unhold the order

Returns
$this
Exceptions

Definition at line 1119 of file Order.php.

1120  {
1121  if (!$this->canUnhold()) {
1122  throw new \Magento\Framework\Exception\LocalizedException(__('You cannot remove the hold.'));
1123  }
1124 
1125  $this->setState($this->getHoldBeforeState())
1126  ->setStatus($this->getHoldBeforeStatus());
1127  $this->setHoldBeforeState(null);
1128  $this->setHoldBeforeStatus(null);
1129  return $this;
1130  }
setHoldBeforeStatus($holdBeforeStatus)
Definition: Order.php:4225
__()
Definition: __.php:13
setHoldBeforeState($holdBeforeState)
Definition: Order.php:4217

◆ unsetData()

unsetData (   $key = null)

Clear order object data

Parameters
string$keydata key
Returns
$this

Definition at line 392 of file Order.php.

393  {
394  parent::unsetData($key);
395  if ($key === null) {
396  $this->setItems(null);
397  }
398  return $this;
399  }

Field Documentation

◆ $_actionFlag

$_actionFlag = []
protected

Definition at line 160 of file Order.php.

◆ $_addressCollectionFactory

$_addressCollectionFactory
protected

Definition at line 230 of file Order.php.

◆ $_baseCurrency

$_baseCurrency = null
protected

Definition at line 153 of file Order.php.

◆ $_canSendNewEmailFlag

$_canSendNewEmailFlag = true
protected

Definition at line 167 of file Order.php.

◆ $_creditmemos

$_creditmemos
protected

Definition at line 138 of file Order.php.

◆ $_currencyFactory

$_currencyFactory
protected

Definition at line 215 of file Order.php.

◆ $_eventObject

$_eventObject = 'order'
protected

Definition at line 118 of file Order.php.

◆ $_eventPrefix

$_eventPrefix = 'sales_order'
protected

Definition at line 113 of file Order.php.

◆ $_historyCollectionFactory

$_historyCollectionFactory
protected

Definition at line 240 of file Order.php.

◆ $_invoiceCollectionFactory

$_invoiceCollectionFactory
protected

Definition at line 245 of file Order.php.

◆ $_invoices

$_invoices
protected

Definition at line 123 of file Order.php.

◆ $_memoCollectionFactory

$_memoCollectionFactory
protected

Definition at line 255 of file Order.php.

◆ $_orderConfig

$_orderConfig
protected

Definition at line 184 of file Order.php.

◆ $_orderCurrency

$_orderCurrency = null
protected

Definition at line 148 of file Order.php.

◆ $_orderHistoryFactory

$_orderHistoryFactory
protected

Definition at line 225 of file Order.php.

◆ $_orderItemCollectionFactory

$_orderItemCollectionFactory
protected

Definition at line 200 of file Order.php.

◆ $_paymentCollectionFactory

$_paymentCollectionFactory
protected

Definition at line 235 of file Order.php.

◆ $_productVisibility

$_productVisibility
protected

Definition at line 205 of file Order.php.

◆ $_relatedObjects

$_relatedObjects = []
protected

Definition at line 143 of file Order.php.

◆ $_shipmentCollectionFactory

$_shipmentCollectionFactory
protected

Definition at line 250 of file Order.php.

◆ $_shipments

$_shipments
protected

Definition at line 133 of file Order.php.

◆ $_storeManager

$_storeManager
protected

Definition at line 179 of file Order.php.

◆ $_trackCollectionFactory

$_trackCollectionFactory
protected

Definition at line 260 of file Order.php.

◆ $_tracks

$_tracks
protected

Definition at line 128 of file Order.php.

◆ $entityType

$entityType = 'order'
protected

Definition at line 174 of file Order.php.

◆ $invoiceManagement

$invoiceManagement
protected

Definition at line 210 of file Order.php.

◆ $priceCurrency

$priceCurrency
protected

Definition at line 270 of file Order.php.

◆ $productListFactory

$productListFactory
protected

Definition at line 195 of file Order.php.

◆ $productRepository

$productRepository
protected

Definition at line 190 of file Order.php.

◆ $salesOrderCollectionFactory

$salesOrderCollectionFactory
protected

Definition at line 265 of file Order.php.

◆ $timezone

$timezone
protected

Definition at line 275 of file Order.php.

◆ ACTION_FLAG_CANCEL

const ACTION_FLAG_CANCEL = 'cancel'

Order flags

Definition at line 85 of file Order.php.

◆ ACTION_FLAG_COMMENT

const ACTION_FLAG_COMMENT = 'comment'

Definition at line 101 of file Order.php.

◆ ACTION_FLAG_CREDITMEMO

const ACTION_FLAG_CREDITMEMO = 'creditmemo'

Definition at line 93 of file Order.php.

◆ ACTION_FLAG_EDIT

const ACTION_FLAG_EDIT = 'edit'

Definition at line 91 of file Order.php.

◆ ACTION_FLAG_HOLD

const ACTION_FLAG_HOLD = 'hold'

Definition at line 87 of file Order.php.

◆ ACTION_FLAG_INVOICE

const ACTION_FLAG_INVOICE = 'invoice'

Definition at line 95 of file Order.php.

◆ ACTION_FLAG_REORDER

const ACTION_FLAG_REORDER = 'reorder'

Definition at line 97 of file Order.php.

◆ ACTION_FLAG_SHIP

const ACTION_FLAG_SHIP = 'ship'

Definition at line 99 of file Order.php.

◆ ACTION_FLAG_UNHOLD

const ACTION_FLAG_UNHOLD = 'unhold'

Definition at line 89 of file Order.php.

◆ ENTITY

const ENTITY = 'order'

Definition at line 56 of file Order.php.

◆ REPORT_DATE_TYPE_CREATED

const REPORT_DATE_TYPE_CREATED = 'created'

Report date types

Definition at line 106 of file Order.php.

◆ REPORT_DATE_TYPE_UPDATED

const REPORT_DATE_TYPE_UPDATED = 'updated'

Definition at line 108 of file Order.php.

◆ STATE_CANCELED

const STATE_CANCELED = 'canceled'

Definition at line 71 of file Order.php.

◆ STATE_CLOSED

const STATE_CLOSED = 'closed'

Definition at line 69 of file Order.php.

◆ STATE_COMPLETE

const STATE_COMPLETE = 'complete'

Definition at line 67 of file Order.php.

◆ STATE_HOLDED

const STATE_HOLDED = 'holded'

Definition at line 73 of file Order.php.

◆ STATE_NEW

const STATE_NEW = 'new'

Order states

Definition at line 61 of file Order.php.

◆ STATE_PAYMENT_REVIEW

const STATE_PAYMENT_REVIEW = 'payment_review'

Definition at line 75 of file Order.php.

◆ STATE_PENDING_PAYMENT

const STATE_PENDING_PAYMENT = 'pending_payment'

Definition at line 63 of file Order.php.

◆ STATE_PROCESSING

const STATE_PROCESSING = 'processing'

Definition at line 65 of file Order.php.

◆ STATUS_FRAUD

const STATUS_FRAUD = 'fraud'

Order statuses

Definition at line 80 of file Order.php.


The documentation for this class was generated from the following file: