class Order extends Base

Class Order

Constants

NOTE_PAYMENT

Note Identifier for Payment

NOTE_UPDATE_ORDER

Note Identifier for Update Order

NOTE_UPDATE_ORDER_ITEM

Note Identifier for Update Order Item

NOTE_EMAIL

Note Identifier for emails

Properties

static string $pimcoreClass Pimcore Object Class.

Methods

static  string
getPimcoreObjectClass()

get Pimcore implementation class.

from Base
static  Base
create()

Create new instance of Pimcore Object.

from Base
static  int
classId()

returns the class ID of the current object class.

from Base
static  Listing
getList( array $config = array())

No description

from Base
static  Data[]
getMandatoryFields()

No description

from Base
static 
validate($data)

No description

from Base
static  mixed|null
__callStatic($method, $arguments)

No description

from Base
array
toArray()

Object to Array.

from Base
string
getCacheKey()

get cache key

from Base
AdminStyle
getElementAdminStyle()

Admin Element Style.

from Base
save()

No description

from Base
Note
createNote($type)

Create a note for this object.

from Base
AbstractObject
getVariantMaster()

Return Topmost Master if Object is Variant

from Base
bool
isAllowedForShop( Shop $shop)

No description

from Base
bool|string
getUrl($language, $params = array(), $route, bool $reset = false, Shop $shop = null)

No description

from Base
static  int|string
getNextOrderNumber()

Creates next OrderNumber.

static  Order|null
findByOrderNumber($orderNumber)

Get Order by OrderNumber

static  string
getValidOrderNumber($number)

Converts any Number to a valid OrderNumber with Suffix and Prefix.

static  Folder
getPathForNewOrder( DateTime $date = null)

get folder for order

Folder
getPathForAddresses()

No description

Folder
getPathForInvoices()

No description

Folder
getPathForShipments()

No description

null
getPathForItems()

No description

bool
importCart( Cart $cart)

Import a Cart to the Order.

updateOrderItem( Item $item, $amount, $priceWithoutTax)

Update Order Item and recalc total and taxes

float
getDiscountPercentage()

calculates discount percentage for cart

createPayment( Payment $provider, $amount, bool $paid = false, $transactionId = null)

Create a new Payment.

getInvoices()

No description

getShipments()

No description

createInvoiceForAllItems()

Creates an Invoice for all Items

array
getInvoiceAbleItems()

get all items that are still invoice-able

array
getInvoicedItems()

get all invoiced items with amounts

createInvoice($items)

Creates a new invoices

float
getInvoicedValue($field)

get any accumulated invoiced value for a field

createShipmentForAllItems()

Creates a Shipment for all Items

array
getShipAbleItems()

get all items that are still ship-able

array
getShippedItems()

get all shipped items with amounts

createShipment($items, Carrier $carrier, $trackingCode = null)

Creates a new Shipment

addPayment( Payment $payment)

Add a new Payment.

float|int
getPayedTotal()

Returns the total payed amount for the Order.

bool
getIsPayed()

Check if the order is fully paid

int
getTotalWeight()

calculates the total weight of the cart.

isShippingAndBillingAddressEqual()

Checks if Shipping and Billing addresses are the same.

bool|Payment
getPaymentProviderObject()

Get Payment Provider Object.

bool|Payment
getOrderPaymentByIdentifier($identifier)

No description

array
getTaxRates()

Returns array with key=>value for tax and value.

string|null
getShippingTrackingUrl()

Create Shipping Tracking Url.

string
getOrderState()

get current order state

string
getOrderStatus()

get current order status

checkOrderState()

check order state.

Note[]
getOrderStateHistory()

get all order-state changes

bool
canHaveInvoice($items)

Check if order can create a new invoice

bool
canHaveShipping($items)

Check if order can have another shipment

Thread|Thread[]|null
getCustomerThreads()

get all threads regarding this order

Date
getOrderDate()

No description

setOrderDate( DateTime $orderDate)

No description

string
getOrderNumber()

No description

setOrderNumber( string $orderNumber)

No description

string
getTrackingCode()

No description

setTrackingCode( string $trackingCode)

No description

string
getLang()

No description

setLang( string $lang)

No description

getCarrier()

No description

setCarrier( Carrier $carrier)

No description

Fieldcollection|null
getPriceRuleFieldCollection()

No description

setPriceRuleFieldCollection( Fieldcollection $priceRules)

No description

getCurrency()

No description

setCurrency( Currency $currency)

No description

double
getDiscount()

No description

setDiscountWithoutTax( double $discountWithoutTax)

No description

double
getDiscountWithoutTax()

No description

setDiscount( double $discount)

No description

double
getSubtotalTax()

No description

setSubtotalTax( double $subtotalTax)

No description

double
getSubtotalWithoutTax()

No description

setSubtotalWithoutTax( double $subtotalWithoutTax)

No description

double
getSubtotal()

No description

setSubtotal( double $subtotal)

No description

double
getShipping()

No description

setShipping( double $shipping)

No description

double
getShippingTaxRate()

No description

setShippingTaxRate( double $shippingTaxRate)

No description

double
getShippingWithoutTax()

No description

setShippingWithoutTax( double $shippingWithoutTax)

No description

double
getShippingTax()

No description

setShippingTax( double $shippingTax)

No description

double
getPaymentFee()

No description

setPaymentFee( double $paymentFee)

No description

mixed
getPaymentFeeTaxRate()

No description

setPaymentFeeTaxRate( double $paymentFeeTaxRate)

No description

double
getPaymentFeeWithoutTax()

No description

setPaymentFeeWithoutTax( double $paymentFeeWithoutTax)

No description

double
getPaymentFeeTax()

No description

setPaymentFeeTax( double $paymentFeeTax)

No description

double
getTotalTax()

No description

setTotalTax( double $totalTax)

No description

double
getTotalWithoutTax()

No description

setTotalWithtoutTax( double $totalWithtouTax)

No description

double
getTotal()

No description

setTotal( double $total)

No description

getShop()

No description

setShop( Shop $shop)

No description

mixed
getTaxes()

No description

setTaxes( mixed $taxes)

No description

mixed
getPaymentProvider()

No description

setPaymentProvider( string $paymentProvider)

No description

string
setPaymentProviderDescription( string $paymentProviderDescription)

No description

string
getPaymentProviderToken()

No description

setPaymentProviderToken( string $paymentProviderToken)

No description

array
getPayments()

No description

setPayments( array $payments)

No description

Item[]
getItems()

No description

setItems( Item[] $items)

No description

getCustomer()

No description

setCustomer( User $customer)

No description

mixed
getShippingAddress()

No description

setShippingAddress( mixed $shippingAddress)

No description

mixed
getBillingAddress()

No description

setBillingAddress( mixed $billingAddress)

No description

mixed
getExtraInformation()

No description

setExtraInformation( mixed $extraInformation)

No description

int
getVisitorId()

No description

setVisitorId( int $visitorId)

No description

Details

in Base at line line 50
static string getPimcoreObjectClass()

get Pimcore implementation class.

Return Value

string

Exceptions

Exception

in Base at line line 68
static Base create()

Create new instance of Pimcore Object.

Return Value

Base

Exceptions

Exception

in Base at line line 84
static int classId()

returns the class ID of the current object class.

Return Value

int

in Base at line line 98
static Listing getList( array $config = array())

Parameters

array $config

Return Value

Listing

Exceptions

Exception

in Base at line line 131
static Data[] getMandatoryFields()

Return Value

Data[]

Exceptions

Exception

in Base at line line 156
static validate($data)

Parameters

$data

Exceptions

ValidationException

in Base at line line 173
static mixed|null __callStatic($method, $arguments)

Parameters

$method
$arguments

Return Value

mixed|null

Exceptions

Exception

in Base at line line 194
array toArray()

Object to Array.

Return Value

array

in Base at line line 204
string getCacheKey()

get cache key

Return Value

string

in Base at line line 224
AdminStyle getElementAdminStyle()

Admin Element Style.

Return Value

AdminStyle

in Base at line line 247
Base save()

Return Value

Base

Exceptions

Exception
Exception
ValidationException

in Base at line line 267
Note createNote($type)

Create a note for this object.

Parameters

$type string

Return Value

Note $note

in Base at line line 289
AbstractObject getVariantMaster()

Return Topmost Master if Object is Variant

Return Value

AbstractObject

in Base at line line 304
bool isAllowedForShop( Shop $shop)

Parameters

Shop $shop

Return Value

bool

in Base at line line 323
bool|string getUrl($language, $params = array(), $route, bool $reset = false, Shop $shop = null)

Parameters

$language
$params
$route
bool $reset
Shop $shop

Return Value

bool|string

at line line 116
static int|string getNextOrderNumber()

Creates next OrderNumber.

Return Value

int|string

at line line 129
static Order|null findByOrderNumber($orderNumber)

Get Order by OrderNumber

Parameters

$orderNumber

Return Value

Order|null

at line line 147
static string getValidOrderNumber($number)

Converts any Number to a valid OrderNumber with Suffix and Prefix.

Parameters

$number

Return Value

string

at line line 170
static Folder getPathForNewOrder( DateTime $date = null)

get folder for order

Parameters

DateTime $date

Return Value

Folder

at line line 186
Folder getPathForAddresses()

Return Value

Folder

at line line 194
Folder getPathForInvoices()

Return Value

Folder

at line line 202
Folder getPathForShipments()

Return Value

Folder

at line line 210
null getPathForItems()

Return Value

null

at line line 222
bool importCart( Cart $cart)

Import a Cart to the Order.

Parameters

Cart $cart

Return Value

bool

at line line 334
updateOrderItem( Item $item, $amount, $priceWithoutTax)

Update Order Item and recalc total and taxes

Parameters

Item $item
$amount
$priceWithoutTax

Exceptions

Exception

at line line 483
float getDiscountPercentage()

calculates discount percentage for cart

Return Value

float

at line line 501
Payment createPayment( Payment $provider, $amount, bool $paid = false, $transactionId = null)

Create a new Payment.

Parameters

Payment $provider
$amount
bool $paid
$transactionId

Return Value

Payment

at line line 537
Invoice[] getInvoices()

Return Value

Invoice[]

at line line 549
Invoice[] getShipments()

Return Value

Invoice[]

at line line 563
Invoice createInvoiceForAllItems()

Creates an Invoice for all Items

Return Value

Invoice

at line line 584
array getInvoiceAbleItems()

get all items that are still invoice-able

Return Value

array

Exceptions

Exception
ObjectUnsupportedException

at line line 620
array getInvoicedItems()

get all invoiced items with amounts

Return Value

array

at line line 653
Invoice createInvoice($items)

Creates a new invoices

Parameters

$items

Return Value

Invoice

Exceptions

Exception

at line line 755
float getInvoicedValue($field)

get any accumulated invoiced value for a field

Parameters

$field

Return Value

float

at line line 772
Shipment createShipmentForAllItems()

Creates a Shipment for all Items

Return Value

Shipment

at line line 793
array getShipAbleItems()

get all items that are still ship-able

Return Value

array

Exceptions

Exception
ObjectUnsupportedException

at line line 829
array getShippedItems()

get all shipped items with amounts

Return Value

array

at line line 865
Shipment createShipment($items, Carrier $carrier, $trackingCode = null)

Creates a new Shipment

Parameters

$items
Carrier $carrier
$trackingCode

Return Value

Shipment

Exceptions

Exception

at line line 967
addPayment( Payment $payment)

Add a new Payment.

Parameters

Payment $payment

at line line 988
float|int getPayedTotal()

Returns the total payed amount for the Order.

Return Value

float|int

Exceptions

ObjectUnsupportedException

at line line 1006
bool getIsPayed()

Check if the order is fully paid

Return Value

bool

at line line 1018
int getTotalWeight()

calculates the total weight of the cart.

Return Value

int

at line line 1036
isShippingAndBillingAddressEqual()

Checks if Shipping and Billing addresses are the same.

at line line 1057
bool|Payment getPaymentProviderObject()

Get Payment Provider Object.

Return Value

bool|Payment

Exceptions

ObjectUnsupportedException

at line line 1069
bool|Payment getOrderPaymentByIdentifier($identifier)

Parameters

$identifier

Return Value

bool|Payment

at line line 1091
array getTaxRates()

Returns array with key=>value for tax and value.

Return Value

array

at line line 1121
string|null getShippingTrackingUrl()

Create Shipping Tracking Url.

Return Value

string|null

at line line 1137
string getOrderState()

get current order state

Return Value

string

at line line 1148
string getOrderStatus()

get current order status

Return Value

string

at line line 1159
checkOrderState()

check order state.

  • if all invoices and shipments has been created: set status to complete.
  • next, if current state is not processing, change it to processing.

at line line 1199
Note[] getOrderStateHistory()

get all order-state changes

Return Value

Note[]

at line line 1219
bool canHaveInvoice($items)

Check if order can create a new invoice

Parameters

$items

Return Value

bool

at line line 1248
bool canHaveShipping($items)

Check if order can have another shipment

Parameters

$items

Return Value

bool

at line line 1276
Thread|Thread[]|null getCustomerThreads()

get all threads regarding this order

Return Value

Thread|Thread[]|null

at line line 1288
Date getOrderDate()

Return Value

Date

Exceptions

ObjectUnsupportedException

at line line 1298
setOrderDate( DateTime $orderDate)

Parameters

DateTime $orderDate

Exceptions

ObjectUnsupportedException

at line line 1308
string getOrderNumber()

Return Value

string

Exceptions

ObjectUnsupportedException

at line line 1318
setOrderNumber( string $orderNumber)

Parameters

string $orderNumber

Exceptions

ObjectUnsupportedException

at line line 1328
string getTrackingCode()

Return Value

string

Exceptions

ObjectUnsupportedException

at line line 1338
setTrackingCode( string $trackingCode)

Parameters

string $trackingCode

Exceptions

ObjectUnsupportedException

at line line 1348
string getLang()

Return Value

string

Exceptions

ObjectUnsupportedException

at line line 1358
setLang( string $lang)

Parameters

string $lang

Exceptions

ObjectUnsupportedException

at line line 1368
Carrier getCarrier()

Return Value

Carrier

Exceptions

ObjectUnsupportedException

at line line 1378
setCarrier( Carrier $carrier)

Parameters

Carrier $carrier

Exceptions

ObjectUnsupportedException

at line line 1388
Fieldcollection|null getPriceRuleFieldCollection()

Return Value

Fieldcollection|null

Exceptions

ObjectUnsupportedException

at line line 1398
setPriceRuleFieldCollection( Fieldcollection $priceRules)

Parameters

Fieldcollection $priceRules

Exceptions

ObjectUnsupportedException

at line line 1408
Currency getCurrency()

Return Value

Currency

Exceptions

ObjectUnsupportedException

at line line 1418
setCurrency( Currency $currency)

Parameters

Currency $currency

Exceptions

ObjectUnsupportedException

at line line 1428
double getDiscount()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1438
setDiscountWithoutTax( double $discountWithoutTax)

Parameters

double $discountWithoutTax

Exceptions

ObjectUnsupportedException

at line line 1448
double getDiscountWithoutTax()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1458
setDiscount( double $discount)

Parameters

double $discount

Exceptions

ObjectUnsupportedException

at line line 1468
double getSubtotalTax()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1478
setSubtotalTax( double $subtotalTax)

Parameters

double $subtotalTax

Exceptions

ObjectUnsupportedException

at line line 1488
double getSubtotalWithoutTax()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1498
setSubtotalWithoutTax( double $subtotalWithoutTax)

Parameters

double $subtotalWithoutTax

Exceptions

ObjectUnsupportedException

at line line 1508
double getSubtotal()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1518
setSubtotal( double $subtotal)

Parameters

double $subtotal

Exceptions

ObjectUnsupportedException

at line line 1528
double getShipping()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1538
setShipping( double $shipping)

Parameters

double $shipping

Exceptions

ObjectUnsupportedException

at line line 1548
double getShippingTaxRate()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1558
setShippingTaxRate( double $shippingTaxRate)

Parameters

double $shippingTaxRate

Exceptions

ObjectUnsupportedException

at line line 1568
double getShippingWithoutTax()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1578
setShippingWithoutTax( double $shippingWithoutTax)

Parameters

double $shippingWithoutTax

Exceptions

ObjectUnsupportedException

at line line 1588
double getShippingTax()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1598
setShippingTax( double $shippingTax)

Parameters

double $shippingTax

Exceptions

ObjectUnsupportedException

at line line 1608
double getPaymentFee()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1618
setPaymentFee( double $paymentFee)

Parameters

double $paymentFee

Exceptions

ObjectUnsupportedException

at line line 1628
mixed getPaymentFeeTaxRate()

Return Value

mixed

Exceptions

ObjectUnsupportedException

at line line 1638
setPaymentFeeTaxRate( double $paymentFeeTaxRate)

Parameters

double $paymentFeeTaxRate

Exceptions

ObjectUnsupportedException

at line line 1648
double getPaymentFeeWithoutTax()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1658
setPaymentFeeWithoutTax( double $paymentFeeWithoutTax)

Parameters

double $paymentFeeWithoutTax

Exceptions

ObjectUnsupportedException

at line line 1668
double getPaymentFeeTax()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1678
setPaymentFeeTax( double $paymentFeeTax)

Parameters

double $paymentFeeTax

Exceptions

ObjectUnsupportedException

at line line 1688
double getTotalTax()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1698
setTotalTax( double $totalTax)

Parameters

double $totalTax

Exceptions

ObjectUnsupportedException

at line line 1708
double getTotalWithoutTax()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1718
setTotalWithtoutTax( double $totalWithtouTax)

Parameters

double $totalWithtouTax

Exceptions

ObjectUnsupportedException

at line line 1728
double getTotal()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 1738
setTotal( double $total)

Parameters

double $total

Exceptions

ObjectUnsupportedException

at line line 1748
Shop getShop()

Return Value

Shop

Exceptions

ObjectUnsupportedException

at line line 1758
setShop( Shop $shop)

Parameters

Shop $shop

Exceptions

ObjectUnsupportedException

at line line 1768
mixed getTaxes()

Return Value

mixed

Exceptions

ObjectUnsupportedException

at line line 1778
setTaxes( mixed $taxes)

Parameters

mixed $taxes

Exceptions

ObjectUnsupportedException

at line line 1788
mixed getPaymentProvider()

Return Value

mixed

Exceptions

ObjectUnsupportedException

at line line 1798
setPaymentProvider( string $paymentProvider)

Parameters

string $paymentProvider

Exceptions

ObjectUnsupportedException

at line line 1808
string getPaymentProviderDescription()

Return Value

string

Exceptions

ObjectUnsupportedException

at line line 1818
setPaymentProviderDescription( string $paymentProviderDescription)

Parameters

string $paymentProviderDescription

Exceptions

ObjectUnsupportedException

at line line 1828
string getPaymentProviderToken()

Return Value

string

Exceptions

ObjectUnsupportedException

at line line 1838
setPaymentProviderToken( string $paymentProviderToken)

Parameters

string $paymentProviderToken

Exceptions

ObjectUnsupportedException

at line line 1848
array getPayments()

Return Value

array

Exceptions

ObjectUnsupportedException

at line line 1858
setPayments( array $payments)

Parameters

array $payments

Exceptions

ObjectUnsupportedException

at line line 1868
Item[] getItems()

Return Value

Item[]

Exceptions

ObjectUnsupportedException

at line line 1878
setItems( Item[] $items)

Parameters

Item[] $items

Exceptions

ObjectUnsupportedException

at line line 1888
User getCustomer()

Return Value

User

Exceptions

ObjectUnsupportedException

at line line 1898
setCustomer( User $customer)

Parameters

User $customer

Exceptions

ObjectUnsupportedException

at line line 1908
mixed getShippingAddress()

Return Value

mixed

Exceptions

ObjectUnsupportedException

at line line 1918
setShippingAddress( mixed $shippingAddress)

Parameters

mixed $shippingAddress

Exceptions

ObjectUnsupportedException

at line line 1928
mixed getBillingAddress()

Return Value

mixed

Exceptions

ObjectUnsupportedException

at line line 1938
setBillingAddress( mixed $billingAddress)

Parameters

mixed $billingAddress

Exceptions

ObjectUnsupportedException

at line line 1948
mixed getExtraInformation()

Return Value

mixed

Exceptions

ObjectUnsupportedException

at line line 1958
setExtraInformation( mixed $extraInformation)

Parameters

mixed $extraInformation

Exceptions

ObjectUnsupportedException

at line line 1968
int getVisitorId()

Return Value

int

Exceptions

ObjectUnsupportedException

at line line 1978
setVisitorId( int $visitorId)

Parameters

int $visitorId

Exceptions

ObjectUnsupportedException