Order
class Order implements OrderInterface, PrimaryKeyInterface, PromotionSubjectInterface, AdjustableInterface, Serializable
Class Order
Properties
| protected int | $id | ||
| protected string | $number | Order number | |
| protected DateTime | $completedAt | Completion date | |
| protected string | $paymentType | Name of payment type(in english language) | |
| protected array | $paymentAdditionalInfo | Data send from bank after payment | |
| protected string|null | $paymentTransactionId | Transaction id received from bank after payment | |
| protected string|null | $paymentMerchantTransactionId | Unique id for order(for bank payment) Combination of order id and time() | |
| protected string|null | $cardPaymentState | Card payment status | |
| protected ArrayCollection | $items | Collection of order items | |
| protected float | $itemsTotal | Total cost of all items in order, represented in default currency | |
| protected float | $baseItemsTotal | Total cost of all items in order without adjustments, represented in default currency | |
| protected ArrayCollection | $adjustments | Collection of all adjustments for order | |
| protected float | $deliveryServicePrice | Cost of delivery service, represented in default currency | |
| protected string | $deliveryServiceCode | Code of delivery service | |
| protected User | $user | User that created order. NULL if no user is logged | |
| protected float | $adjustmentsTotal | Sum of all adjustments, represented in percentage | |
| protected int | $code | Unique value for order used in synchronization with erp | |
| protected string | $locale | Language locale when order was created | |
| protected string | $currency | Currency name for which order was created | |
| protected float | $currencyRatio | Ratio for currency relative to default currency | |
| protected Pricelist | $currentPricelist | Pricelist that user had when order was created | |
| protected float | $taxValue | Tax value, represented in percentage | |
| protected float | $vatValue | Tax value, already calculated in price | |
| protected float | $totalWithTax | Total cost of all items in order including tax, represented in default currency | |
| protected float | $totalWithDeliveryService | Total cost of all items in order including tax and delivery service cost, represented in default currency | |
| protected float | $total | Total cost of all items in order including adjustments, represented in default currency Items total + adjustments total. | |
| protected bool | $confirmed | Indicates if order has been confirmed by mail. | |
| protected string | $confirmationToken | Random string used to confirm order | |
| protected DateTime | $createdAt | Datetime when order was created | |
| protected DateTime | $updatedAt | Datetime when order was last updated | |
| protected string | $state | State of order | |
| protected Address | $address | Billing address for order | |
| protected Address | $shippingAddress | Shipping Address for order. If NULL same as billing | |
| protected ArrayCollection | $promotions | Collection of promotions | |
| protected float | $discount | Order discount, represented in default currency | |
| protected Tax | $tax | Tax for order | |
| array | $previousStates | Collection of all previous states | |
| protected string | $checkoutComment | Order comment | |
| protected string | $anonymous | Name of user that created order(if user is not logged in) | |
| protected string | $sessionId | Unique identifier for order | |
| protected string | $anonymousMail | Email of user that created order(if user is not logged in) | |
| protected string | $couponCode | Coupon code | |
| protected bool | $synchronizedWithErp | Indicates if order is synchronized with erp | |
| protected string | $erpSynchronizationComment | Erp Synchronization Comment | |
| protected bool | $hasAddress | Indicates if user has entered/selected address |
Methods
Order constructor.
Get id
No description
No description
No description
Has the order been completed by user and can be handled.
Mark the order as completed.
Return completion date.
No description
No description
{@inheritdoc}
Get order items.
Set items.
Clears all items in cart.
Returns number of order items.
Has item in order?
Get items total.
{@inheritdoc}
Calculate items total based on the items unit prices and quantities.
Return all adjustments attached to adjustable subject.
Get adjustments total.
No description
Remove adjustment.
Clears all adjustments.
Calculate adjustments total.
Get order total.
Set total.
Calculate total.
No description
No description
No description
Set order state.
Get order state.
Alias of {@link countItems()}.
Returns total quantity of items in cart.
Checks whether the cart is empty or not.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
(PHP 5 >= 5.1.0)
String representation of object
(PHP 5 >= 5.1.0)
Constructs the object
Get Promotions.
Count promotion subjects.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
at line 603
__construct()
Order constructor.
at line 614
integer
getId()
Get id
at line 624
Order
setId(mixed $id)
at line 634
float
getBaseItemsTotal()
at line 644
Order
setBaseItemsTotal(float $baseItemsTotal)
at line 654
string
getCode()
at line 664
Order
setCode(string $code)
at line 674
bool
isCompleted()
Has the order been completed by user and can be handled.
at line 682
complete()
Mark the order as completed.
at line 692
DateTime
getCompletedAt()
Return completion date.
at line 700
setCompletedAt(DateTime $completedAt = null)
Set completion time.
at line 710
float
getVatValue()
at line 720
Order
setVatValue(float $vatValue)
at line 730
getSequenceType()
{@inheritdoc}
at line 738
Collection|OrderItemInterface[]
getItems()
Get order items.
at line 746
setItems(Collection $items)
Set items.
at line 756
clearItems()
Clears all items in cart.
at line 766
integer
countItems()
Returns number of order items.
at line 774
addItem(OrderItemInterface $item, float $price, float $qty)
Adds item to order.
at line 790
removeItem(OrderItemInterface $item)
Remove item from order.
at line 803
Boolean
hasItem(OrderItemInterface $item, $selectedProductAttributes = array(), $excludedOrderItemIds = null)
Has item in order?
at line 849
integer
getItemsTotal()
Get items total.
at line 857
setItemsTotal($itemsTotal)
{@inheritdoc}
at line 867
calculateItemsTotal()
Calculate items total based on the items unit prices and quantities.
at line 890
Collection|AdjustmentInterface[]
getAdjustments(null|string $type = null)
Return all adjustments attached to adjustable subject.
at line 906
addAdjustment(AdjustmentInterface $adjustment)
Add adjustment.
at line 919
removeAdjustment(AdjustmentInterface $adjustment)
Remove adjustment.
at line 932
hasAdjustment(AdjustmentInterface $adjustment)
{@inheritdoc}
at line 940
integer
getAdjustmentsTotal(null|string $type = null)
Get adjustments total.
at line 959
Order
setAdjustmentsTotal(float $adjustmentsTotal)
at line 969
removeAdjustments(string $type)
Remove adjustment.
at line 985
clearAdjustments()
Clears all adjustments.
at line 995
calculateAdjustmentsTotal()
Calculate adjustments total.
at line 1009
integer
getTotal()
Get order total.
at line 1017
setTotal(integer $total)
Set total.
at line 1027
calculateTotal()
Calculate total.
Items total + Adjustments total.
at line 1046
Order
calculateTotalWithTax()
at line 1079
mixed
getCreatedAt()
at line 1087
mixed
setCreatedAt(DateTime $createdAt)
at line 1097
mixed
getUpdatedAt()
at line 1105
mixed
setUpdatedAt(DateTime $updatedAt)
at line 1115
setState(string $state)
Set order state.
at line 1125
string
getState()
Get order state.
at line 1133
getTotalItems()
Alias of {@link countItems()}.
at line 1141
integer
getTotalQuantity()
Returns total quantity of items in cart.
at line 1155
Boolean
isEmpty()
Checks whether the cart is empty or not.
at line 1163
User
getUser()
Get user.
at line 1171
setUser(User $user)
Set user.
at line 1184
mixed
removeItemQty(OrderItemInterface $item)
at line 1211
ShippingProvider
getShipping()
at line 1219
setShipping(ShippingProvider|null $shipping)
at line 1232
mixed
getPaymentType()
at line 1240
setPaymentType(string $paymentType)
at line 1250
array
getPaymentAdditionalInfo()
at line 1260
Order
setPaymentAdditionalInfo(array $paymentAdditionalInfo)
at line 1270
mixed
getPaymentTransactionId()
at line 1280
Order
setPaymentTransactionId(string|null $paymentTransactionId)
at line 1290
mixed
getPaymentMerchantTransactionId()
at line 1300
Order
setPaymentMerchantTransactionId(string|null $paymentMerchantTransactionId)
at line 1314
mixed
getUserForJqGrid()
at line 1331
string
getShippingForJqGrid()
at line 1347
string
getCompanyForJqGrid()
at line 1366
string
getCountryForJqGrid()
at line 1382
int
getIdForJqGrid()
at line 1394
string
getPaymentForJqGrid()
at line 1404
float
getItemsAdjustmentTotalCost(string $type)
at line 1418
mixed
getAddress()
at line 1426
string
getAddressToString()
at line 1440
setAddress(mixed $address)
at line 1451
Address|null
getShippingAddress()
at line 1476
string
serialize()
(PHP 5 >= 5.1.0)
String representation of object
at line 1526
void
unserialize(string $serialized)
(PHP 5 >= 5.1.0)
Constructs the object
at line 1571
Boolean
hasPromotion(PromotionInterface $promotion)
Has Promotion.
at line 1583
PromotionSubjectInterface
addPromotion(PromotionInterface $promotion)
Add Promotion.
at line 1601
PromotionSubjectInterface
removePromotion(PromotionInterface $promotion)
Remove Promotion.
at line 1613
Collection|PromotionInterface[]
getPromotions()
Get Promotions.
at line 1623
integer
getPromotionSubjectCount()
Count promotion subjects.