phpDocumentor

AfterbuyOrderShippingReader

Class AfterbuyOrderShippingReader

Table of Contents

CONFIG_ORDER_STATUS_SHIPPING_DATE  = 'modules/gambio/afterbuy/order_status_shipping_date'
CONFIG_SCAFFOLD  = 'configuration/MODULE_SHIPPING_%s_ALIAS'
$configurationFinder  : ConfigurationFinder
$connection  : Connection
$orderTotalReader  : AfterbuyOrderTotalReader
__construct()  : mixed
AfterbuyOrderShippingReader constructor.
getDeliveryDate()  : DateTimeImmutable|null
Tries to fetch a delivery date by using the order id of the given data and the 'order_status_shipping_date' afterbuy configuration.
getShippingCost()  : float|null
Returns shipping cost for order.
getShippingMethodFromClass()  : string
Tries to get the shipping method name from the configuration.
fetchOrderStatusHistoryDate()  : string|null
Fetches the **oldest** order status history date if the given $orderId and $orderStatus match to a record in 'orders_status_history'.

Constants

CONFIG_ORDER_STATUS_SHIPPING_DATE

private mixed CONFIG_ORDER_STATUS_SHIPPING_DATE = 'modules/gambio/afterbuy/order_status_shipping_date'

Properties

Methods

getDeliveryDate()

Tries to fetch a delivery date by using the order id of the given data and the 'order_status_shipping_date' afterbuy configuration.

public getDeliveryDate(array<string|int, mixed> $data) : DateTimeImmutable|null

The date value is fetched from a matching record in the orders_status_history table.

Parameters
$data : array<string|int, mixed>
Return values
DateTimeImmutable|null

getShippingCost()

Returns shipping cost for order.

public getShippingCost(array<string|int, mixed> $data) : float|null
Parameters
$data : array<string|int, mixed>
Return values
float|null

getShippingMethodFromClass()

Tries to get the shipping method name from the configuration.

public getShippingMethodFromClass(string $shippingClass) : string

Returns the $shippingClass if nothing was found.

Parameters
$shippingClass : string
Return values
string

fetchOrderStatusHistoryDate()

Fetches the **oldest** order status history date if the given $orderId and $orderStatus match to a record in 'orders_status_history'.

private fetchOrderStatusHistoryDate(int $orderId, string $orderStatus) : string|null

Otherwise, null is returned.

Parameters
$orderId : int
$orderStatus : string
Return values
string|null

Search results