PrestaShop Developer Conference
PrestaShop Developer Conference
Paris, France - November 30, 2023
Let's talk code, commerce and open source.

Hook actionValidateOrderAfter

Information

After validating an order:

This hook is called after validating an order by core

Hook locations:

  • front office

Hook type: action

Located in:

Parameters details

    <?php
    [
        'cart' => (Cart|null) $contextCart,
        'order' => (Order|null) $order,
        'orders' => (array) $orderList,
        'customer' => (Customer) $contextCustomer,
        'currency' => (Currency) $contextCurrency,
        'orderStatus' => (OrderState) $orderState,
    ]

Call of the Hook in the origin file

Hook::exec(
            'actionValidateOrderAfter',
            [
                'cart' => $this->context->cart,
                'order' => $order ?? null,
                'orders' => $order_list,
                'customer' => $this->context->customer,
                'currency' => $this->context->currency,
                'orderStatus' => new OrderState(isset($order) ? $order->current_state : null),
            ]
        )