Merx

OrderPage

The OrderPageAbstract class extends the Kirby’s Page class.

You have to create your own OrderPage class.

$orderPage->errors()

Returns validation errors.

$orderPageAbstract->errors(): array

Since Merx 1.7

Return Type

array

Example Response

$errors = $orderPage->errors();
echo json_encode($errors);
{
  "name": {
    "label": "Name",
    "message": {
      "required": "Please enter something",
      "minlength": "Please enter a longer value. (min. 3 characters)"
    }
  },
  "streetaddress": {
    "label": "Street",
    "message": {
      "required": "Please enter something",
      "minlength": "Please enter a longer value. (min. 3 characters)"
    }
  }
}

Further Reading

Getting Started / Validate Checkout

Source Code

$orderPage->title()

$orderPageAbstract->title(): \Kirby\Cms\Field

Return Type

Kirby\Cms\Field

Source Code

$orderPage->cart()

Cart of this Order.

$orderPageAbstract->cart(): ProductList

Return Type

Wagnerwagner\Merx\ProductList

Source Code

$orderPage->formattedSum()

$orderPageAbstract->formattedSum(): string

Return Type

string

Source Code

$orderPage->invoiceNumber()

5 character long string based on the sorting number.

$orderPageAbstract->invoiceNumber(): string

Return Type

string

Example

$orderPage->invoiceNumber(); // 00003

Custom Invoice Numbers

Learn how to generate custom invoice numbers with the Custom Invoice Numbers cookbook.

Source Code

$orderPage->payedDate()

Helper method that returns paidDate or payedDate field of the OrderPage.

$orderPageAbstract->payedDate(): Field

Return Type

Kirby\Cms\Field

Since Merx 1.7 the date when the payment of an order is completed is no longer stored in the payedDate field. Instead, it is stored in the paidDate field. This method which returns the payedDate field (for orders before Merx 1.7) or the paidDate field.

Source Code