OrderWriteService

Implements \OrderWriteServiceInterface

Class OrderWriteService

category

System

package

Order

Methods

Class Constructor

__construct(\OrderRepositoryInterface $orderRepository, \OrderItemRepositoryInterface $orderItemRepository, \OrderItemAttributeRepositoryFactoryInterface $orderItemAttributeRepositoryFactory, \OrderTotalRepository $orderTotalRepository, \OrderStatusHistoryStorage $orderStatusHistoryWriter, \OrderServiceSettingsInterface $orderServiceSetting, \DeleteHistoryWriteService $deleteHistoryService) 

Arguments

$orderRepository

\OrderRepositoryInterface

$orderItemRepository

\OrderItemRepositoryInterface

$orderItemAttributeRepositoryFactory

\OrderItemAttributeRepositoryFactoryInterface

$orderTotalRepository

\OrderTotalRepository

$orderStatusHistoryWriter

\OrderStatusHistoryStorage

$orderServiceSetting

\OrderServiceSettingsInterface

$deleteHistoryService

\DeleteHistoryWriteService

Add Order Item

addOrderItem(\IdType $orderId, \OrderItemInterface $orderItem) : integer

Adds an item to the order.

Arguments

$orderId

\IdType

Order ID of the order to add the item

$orderItem

\OrderItemInterface

The order item to add

Response

integer

Id of the StoredOrderItem

Add Order Item Attribute

addOrderItemAttribute(\IdType $orderItemId, \OrderItemAttributeInterface $orderItemAttribute) : integer

Adds an order item attribute to the order

Arguments

$orderItemId

\IdType

Order ID of the order item to add the attribute.

$orderItemAttribute

\OrderItemAttributeInterface

The order item attribute to add

Response

integer

Id of stored order item attribute.

Add Order Status History Entry

addOrderStatusHistoryEntry(\IdType $orderId, \StringType $comment, \IdType $customerId) 

Add an order status history entry to an order, without changing the status or notifying the customer.

Arguments

$orderId

\IdType

Order ID of the order to update

$comment

\StringType

Comment of the order status history item

$customerId

\IdType

Customer ID of the admin

Add Order Total

addOrderTotal(\IdType $orderId, \OrderTotalInterface $orderTotal) : integer

Adds a total price to an order.

Arguments

$orderId

\IdType

Order Id of the order to add the total price

$orderTotal

\OrderTotalInterface

Total price to add to the order

Response

integer

Id of stored order total.

Create New Customer Order

createNewCustomerOrder(\IdType $customerId, \CustomerStatusInformation $customerStatusInfo, \StringType $customerNumber, \EmailStringType $customerEmail, \StringType $customerTelephone, \StringType $vatIdNumber, \AddressBlockInterface $customerAddress, \AddressBlockInterface $billingAddress, \AddressBlockInterface $deliveryAddress, \OrderItemCollection $orderItemCollection, \OrderTotalCollection $orderTotalCollection, \OrderShippingType $shippingType, \OrderPaymentType $paymentType, \CurrencyCode $currencyCode, \LanguageCode $languageCode, \DecimalType $totalWeight, \StringType $comment = null, \IntType $orderStatusId = null, \KeyValueCollection $addonValues = null) : integer

Creates a new customer order and returns the order ID as an integer.

Arguments

$customerId

\IdType

Customer ID

$customerStatusInfo

\CustomerStatusInformation

Customer Status Information

$customerNumber

\StringType

Customer Number

$customerEmail

\EmailStringType

Customer Email

$customerTelephone

\StringType

Customer Telephone

$vatIdNumber

\StringType

VAT ID Number

$customerAddress

\AddressBlockInterface

Address of the customer

$billingAddress

\AddressBlockInterface

Billing address of the customer

$deliveryAddress

\AddressBlockInterface

Delivery address of the customer

$orderItemCollection

\OrderItemCollection

Collection of the order items

$orderTotalCollection

\OrderTotalCollection

Total collection of the order

$shippingType

\OrderShippingType

Shipping type of the order

$paymentType

\OrderPaymentType

Payment type of the order

$currencyCode

\CurrencyCode

Currency code of the order

$languageCode

\LanguageCode

Language code of the order

$totalWeight

\DecimalType

Total weight of the order in kilo gram

$comment

\StringType

Optional comment of the order (default = null)

$orderStatusId

\IntType

Optional id of the initial order status (default = null)

$addonValues

\KeyValueCollection

Optional key => value collection of addon values - e.g. cookies (default = null)

Response

integer

Create New Standalone Order

createNewStandaloneOrder(\StringType $customerNumber, \EmailStringType $customerEmail, \StringType $customerTelephone, \StringTYpe $vatIdNumber, \AddressBlockInterface $customerAddress, \AddressBlockInterface $billingAddress, \AddressBlockInterface $deliveryAddress, \OrderItemCollection $orderItemCollection, \OrderTotalCollection $orderTotalCollection, \OrderShippingType $shippingType, \OrderPaymentType $paymentType, \CurrencyCode $currencyCode, \LanguageCode $languageCode, \DecimalType $totalWeight, \StringType $comment = null, \IntType $orderStatusId = null, \KeyValueCollection $addonValues = null) : integer

Creates a new standalone order (e.g. for guests) and returns the order ID as an integer.

Arguments

$customerNumber

\StringType

Customer Number

$customerEmail

\EmailStringType

Customer Email

$customerTelephone

\StringType

Customer Telephone

$vatIdNumber

\StringTYpe

VAT ID number of the customer.

$customerAddress

\AddressBlockInterface

Address of the customer

$billingAddress

\AddressBlockInterface

Billing address of the customer

$deliveryAddress

\AddressBlockInterface

Delivery address of the customer

$orderItemCollection

\OrderItemCollection

Collection of the order items

$orderTotalCollection

\OrderTotalCollection

Total collection of the order

$shippingType

\OrderShippingType

Shipping type of the order

$paymentType

\OrderPaymentType

Payment type of the order

$currencyCode

\CurrencyCode

Currency code of the order

$languageCode

\LanguageCode

Language code of the order

$totalWeight

\DecimalType

Total weight of the order in kg.

$comment

\StringType

Optional comment of the order (default = null)

$orderStatusId

\IntType

Optional id of the initial order status (default = null)

$addonValues

\KeyValueCollection

Optional key => value collection of addon values - e.g. cookies (default = null)

Response

integer

Remove Order by ID

removeOrderById(\IdType $orderId) 

Removes a specific order, depending on the provided order ID.

Arguments

$orderId

\IdType

Order ID of the order to remove

Remove Order Item

removeOrderItem(\StoredOrderItemInterface $orderItem) 

Removes an item from an order.

Arguments

$orderItem

\StoredOrderItemInterface

The order item to remove

Remove Order Item Attribute

removeOrderItemAttribute(\StoredOrderItemAttributeInterface $orderItemAttribute) 

Removes an item attribute of an order

Arguments

$orderItemAttribute

\StoredOrderItemAttributeInterface

The order item attribute to remove

Remove Order Total

removeOrderTotal(\StoredOrderTotalInterface $orderTotal) 

Removes a total price of an order

Arguments

$orderTotal

\StoredOrderTotalInterface

The total price of an order to remove

Update Billing Address

updateBillingAddress(\IdType $orderId, \AddressBlockInterface $newAddress) 

Updates the customers billing address.

Arguments

$orderId

\IdType

Order ID which holds the current address

$newAddress

\AddressBlockInterface

New billing address

Update Comment

updateComment(\IdType $orderId, \StringType $newComment) 

Updates the comment of an order.

Arguments

$orderId

\IdType

Order ID of the order to update

$newComment

\StringType

The new comment

Update Customer Address

updateCustomerAddress(\IdType $orderId, \AddressBlockInterface $newAddress) 

Updates the customers address.

Arguments

$orderId

\IdType

Order ID which holds the current address

$newAddress

\AddressBlockInterface

New address of the customer

Update Delivery Address

updateDeliveryAddress(\IdType $orderId, \AddressBlockInterface $newAddress) 

Updates the customers delivery address.

Arguments

$orderId

\IdType

Order ID which holds the current address

$newAddress

\AddressBlockInterface

New delivery address

Update Order

updateOrder(\OrderInterface $order) : \OrderWriteService

Updates the provided order.

Arguments

$order

\OrderInterface

Order to update

Response

\OrderWriteService

Same instance for chained method calls.

Update Order Item

updateOrderItem(\StoredOrderItemInterface $orderItem) 

Updates an order item.

Arguments

$orderItem

\StoredOrderItemInterface

The order item to update

Update Order Item Attribute

updateOrderItemAttribute(\StoredOrderItemAttributeInterface $orderItemAttribute) 

Updates an item attribute of an order.

Arguments

$orderItemAttribute

\StoredOrderItemAttributeInterface

The order item attribute to update

Update Order Status

updateOrderStatus(\IdType $orderId, \IntType $newOrderStatusId, \StringType $comment, \BoolType $customerNotified, \IdType $customerId = null) 

Updates the order status of an order.

Arguments

$orderId

\IdType

Order ID of the order to update

$newOrderStatusId

\IntType

The new status Id

$comment

\StringType

Comment of the order status history item

$customerNotified

\BoolType

Customer notified flag

$customerId

\IdType

Customer ID of the admin account

Update Order Total

updateOrderTotal(\StoredOrderTotalInterface $orderTotal) 

Updates a total price of an order

Arguments

$orderTotal

\StoredOrderTotalInterface

The total price of an order to update

Update Payment Type

updatePaymentType(\IdType $orderId, \OrderPaymentType $newPaymentType) 

Updates the payment type of an order.

Arguments

$orderId

\IdType

Order ID of the order to update

$newPaymentType

\OrderPaymentType

The new payment type

Update Shipping Type

updateShippingType(\IdType $orderId, \OrderShippingType $newShippingType) 

Updates the shipping type of an order.

Arguments

$orderId

\IdType

Order ID of the order to update

$newShippingType

\OrderShippingType

The new shipping type

Properties

orderRepository

orderRepository : \OrderRepository
var

Type(s)

\OrderRepository

orderItemRepository

orderItemRepository : \OrderItemRepository
var

Type(s)

\OrderItemRepository

orderItemAttributeRepositoryFactory

orderItemAttributeRepositoryFactory : \OrderItemAttributeRepositoryFactory

orderTotalRepository

orderTotalRepository : \OrderTotalRepository
var

Type(s)

\OrderTotalRepository

orderStatusHistoryStorage

orderStatusHistoryStorage : \OrderStatusHistoryStorage

orderServiceSettings

orderServiceSettings : \OrderServiceSettingsInterface

deleteHistoryService

deleteHistoryService : \DeleteHistoryWriteService