OrderService
This service class contains function related to orders.
All public functions are available in the Twig template renderer.
Namespace
IO\Services
Type | Name | Value | Description |
---|---|---|---|
|
[1,2,3,9,13] |
||
|
[1,5] |
Type | Name | Description |
---|---|---|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods
public __construct($orderRepository, $basketService, $sessionStorageRepository, $frontendPaymentMethodRepository, $addressRepository, $urlService, $checkoutService, $customerService, $contactRepository, $giftCardRepository)
OrderService constructor.
Type |
Name |
Description |
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
public placeOrder():LocalizedOrder
Place an order
Subscribe the customer to the newsletter, if stored in the session
Type |
Name |
Description |
|
||
|
public executePayment($orderId, $paymentId):array
Execute the payment for a given order.
Type |
Name |
Description |
|
The order id to execute payment for |
|
|
The MoP-ID to execute |
public findOrderById($orderId, $wrap = true):LocalizedOrder \| Order
Find an order by id
Type |
Name |
Description |
|
An order id to find order by |
|
|
Optional: Wrap order into an /IO/Models/LocalizedOrder (Default: true) |
public findOrderByAccessKey($orderId, $orderAccessKey):LocalizedOrder
Find an order by id and authorize it via accesskey
Type |
Name |
Description |
|
An order id find order by |
|
|
An order access key to authorize search for order |
public getOrdersForContact($contactId, $page = 1, $items = 50, $filters = [], $wrapped = true): PaginatedResult
Get a list of orders for a contact
Type |
Name |
Description |
|
An contacts id |
|
|
Optional: Page number for pagination (Default: 1) |
|
|
Optional: How many items per page (Default: 50) |
|
|
Optional: Additional filters for search |
|
|
Optional: Wrap orders /IO/Models/LocalizedOrder instances (Default: true) |
public getOrdersCompact($page = 1, $items = 50): PaginatedResult
Get a list of orders for a contact in a compact and reduced format
Type |
Name |
Description |
|
Optional: Page for pagination (Default: 1) |
|
|
Optional: Number of items per page (Default: 50) |
public getLatestOrderForContact($contactId):LocalizedOrder
Get the last order created by the current contact
Type |
Name |
Description |
|
A contacts id to find orders for |
public getOrderPropertyByOrderId($orderId, $typeId): Collection \| array
Find order properties of a specific type for a specific order
Type |
Name |
Description |
|
An order id to find order properties for |
|
|
The type of order properties to find |
public isReturnActive():bool
Check if the shop has activated return orders
public createOrderReturn($orderId, $orderAccessKey = "", $items = [], $returnNote = ""):mixed
Create a return order for a specific order
Type |
Name |
Description |
|
The order id to create a return order for |
|
|
Optional: An order access key is needed for guests |
|
|
Optional: Array of items to return |
|
|
Optional: A optional reason for returning items |
public getReturnOrder($orderId, $orderAccessKey = ""):LocalizedOrder
Find a return order by order id
Type |
Name |
Description |
|
An order id to find return order for |
|
|
Optional: An order access key is needed to authorize guests |
public getReturnableItems($order):array
Get all items of an order that can be returned
Type |
Name |
Description |
|
An order |
public getPaymentMethodListForSwitch($currentPaymentMethodId, $orderId = null):Collection
List all payment methods available for switch in MyAccount
Type |
Name |
Description |
|
Optional: The id of the current payment method |
|
|
Optional: An order id to find valid payment methods to switch to |
public allowPaymentMethodSwitchFrom($paymentMethodId, $orderId = null):bool
Check if it is possible to switch to another payment method from a specific one
Type |
Name |
Description |
|
A payment method id to check switching from |
|
|
Optional: An order id used for additional checks |
public switchPaymentMethodForOrder($orderId, $paymentMethodId):LocalizedOrder
Switch the payment method of an order to a new payment method
Type |
Name |
Description |
|
An order id to switch payment method for |
|
|
A payment method id to switch to |
public complete($order)
Do steps after creating the order
Type |
Name |
Description |
|