AfterbuyOrderTotalReader
in package
Class AfterbuyOrderTotalReader
Table of Contents
- $connection : Connection
- $orderTotalCache : array<string|int, mixed>
- __construct() : mixed
- AfterbuyOrderTotalReader constructor.
- fetchOrderTotalsByOrderId() : array<string|int, mixed>
- Fetches order total data by the given order id.
Properties
$connection
private
Connection
$connection
$orderTotalCache
private
array<string|int, mixed>
$orderTotalCache
= []
Methods
__construct()
AfterbuyOrderTotalReader constructor.
public
__construct(Connection $connection) : mixed
Parameters
- $connection : Connection
Return values
mixed —fetchOrderTotalsByOrderId()
Fetches order total data by the given order id.
public
fetchOrderTotalsByOrderId(int $orderId) : array<string|int, mixed>
In memory caches the result, so subsequent calls with the same $orderId will return the cached data.
If everything succeeds, the returned array contains at least "ot_subtotal" and "ot_total" (if the whole order was free). Most of the time, "ot_shipping" and "ot_tax" are also available. There may be some additional elements, e.g. "ot_cod_fee" if the orders payment was "cash on delivery".
Parameters
- $orderId : int