Notice: You are browsing the documentation for PrestaShop 8, which is currently in development.

You might want to read the documentation for the current version, PrestaShop 1.7.

Order domain

Order Commands

AddCartRuleToOrderCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\AddCartRuleToOrderCommand Adds cart rule to given order.

Command details
Constructor parameters
  • $int $orderId
  • $string $cartRuleName
  • $string $cartRuleType
  • $string $value
  • $?int $orderInvoiceId = NULL
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\AddCartRuleToOrderHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\AddCartRuleToOrderHandlerInterface
Return type void

AddOrderFromBackOfficeCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\AddOrderFromBackOfficeCommand Adds new order from given cart.

Command details
Constructor parameters
  • $int $cartId
  • $int $employeeId
  • $string $orderMessage
  • $string $paymentModuleName
  • $int $orderStateId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\AddOrderFromBackOfficeHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\AddOrderFromBackOfficeHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Order\ValueObject\OrderId

AddPaymentCommand

PrestaShop\PrestaShop\Core\Domain\Order\Payment\Command\AddPaymentCommand Adds payment for given order.

Command details
Constructor parameters
  • $int $orderId
  • $string $paymentDate
  • $string $paymentMethod
  • $string $paymentAmount
  • $int $paymentCurrencyId
  • $?int $orderInvoiceId = NULL
  • $?string $transactionId = NULL
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\AddPaymentHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\Payment\CommandHandler\AddPaymentHandlerInterface
Return type void

AddProductToOrderCommand

PrestaShop\PrestaShop\Core\Domain\Order\Product\Command\AddProductToOrderCommand Adds product to an existing order.

Command details
Constructor parameters
  • $int $orderId
  • $int $productId
  • $int $combinationId
  • $string $productPriceTaxIncluded
  • $string $productPriceTaxExcluded
  • $int $productQuantity
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\AddProductToOrderHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\Product\CommandHandler\AddProductToOrderHandlerInterface
Return type void

BulkChangeOrderStatusCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\BulkChangeOrderStatusCommand Changes status for given orders.

Command details
Constructor parameters
  • $array $orderIds
  • $int $newOrderStatusId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\BulkChangeOrderStatusHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\BulkChangeOrderStatusHandlerInterface
Return type void

CancelOrderProductCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\CancelOrderProductCommand __

Command details
Constructor parameters
  • $array $cancelledProducts
  • $int $orderId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\CancelOrderProductHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\CancelOrderProductHandlerInterface
Return type void

ChangeOrderCurrencyCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\ChangeOrderCurrencyCommand Changes currency for given order.

Command details
Constructor parameters
  • $int $orderId
  • $int $newCurrencyId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\ChangeOrderCurrencyHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\ChangeOrderCurrencyHandlerInterface
Return type void

ChangeOrderDeliveryAddressCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\ChangeOrderDeliveryAddressCommand Changes delivery address for given order.

Command details
Constructor parameters
  • $int $orderId
  • $int $newDeliveryAddressId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\ChangeOrderDeliveryAddressHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\ChangeOrderDeliveryAddressHandlerInterface
Return type void

ChangeOrderInvoiceAddressCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\ChangeOrderInvoiceAddressCommand Changes invoice address for given order.

Command details
Constructor parameters
  • $int $orderId
  • $int $newInvoiceAddressId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\ChangeOrderInvoiceAddressHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\ChangeOrderInvoiceAddressHandlerInterface
Return type void

DeleteCartRuleFromOrderCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\DeleteCartRuleFromOrderCommand Removes cart rule from given order.

Command details
Constructor parameters
  • $int $orderId
  • $int $orderCartRuleId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\DeleteCartRuleFromOrderHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\DeleteCartRuleFromOrderHandlerInterface
Return type void

DeleteProductFromOrderCommand

PrestaShop\PrestaShop\Core\Domain\Order\Product\Command\DeleteProductFromOrderCommand Deletes product from given order.

Command details
Constructor parameters
  • $int $orderId
  • $int $orderDetailId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\DeleteProductFromOrderHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\Product\CommandHandler\DeleteProductFromOrderHandlerInterface
Return type void

DuplicateOrderCartCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\DuplicateOrderCartCommand Duplicates cart for given order

Command details
Constructor parameters
  • $int $orderId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\DuplicateOrderCartHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\DuplicateOrderCartHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Cart\ValueObject\CartId

GenerateInvoiceCommand

PrestaShop\PrestaShop\Core\Domain\Order\Invoice\Command\GenerateInvoiceCommand Generates invoice for given order.

Command details
Constructor parameters
  • $int $orderId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\GenerateInvoiceHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\Invoice\CommandHandler\GenerateOrderInvoiceHandlerInterface
Return type void

IssuePartialRefundCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\IssuePartialRefundCommand Issues partial refund for given order.

Command details
Constructor parameters
  • $int $orderId
  • $array $orderDetailRefunds
  • $string $shippingCostRefundAmount
  • $bool $restockRefundedProducts
  • $bool $generateCreditSlip
  • $bool $generateVoucher
  • $int $voucherRefundType
  • $?string $voucherRefundAmount = NULL
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\IssuePartialRefundHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\IssuePartialRefundHandlerInterface
Return type void

IssueReturnProductCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\IssueReturnProductCommand Issues return product for given order.

Command details
Constructor parameters
  • $int $orderId
  • $array $orderDetailRefunds
  • $bool $restockRefundedProducts
  • $bool $refundShippingCost
  • $bool $generateCreditSlip
  • $bool $generateVoucher
  • $int $voucherRefundType
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\IssueReturnProductHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\IssueReturnProductHandlerInterface
Return type void

IssueStandardRefundCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\IssueStandardRefundCommand Issues standard refund for given order.

Command details
Constructor parameters
  • $int $orderId
  • $array $orderDetailRefunds
  • $bool $refundShippingCost
  • $bool $generateCreditSlip
  • $bool $generateVoucher
  • $int $voucherRefundType
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\IssueStandardRefundHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\IssueStandardRefundHandlerInterface
Return type void

ResendOrderEmailCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\ResendOrderEmailCommand __

Command details
Constructor parameters
  • $int $orderId
  • $int $orderStatusId
  • $int $orderHistoryId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\ResendOrderEmailHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\ResendOrderEmailHandlerInterface
Return type void

SendProcessOrderEmailCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\SendProcessOrderEmailCommand Sends email to customer with link for processing the order from cart

Command details
Constructor parameters
  • $int $cartId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\SendProcessOrderEmailHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\SendProcessOrderEmailHandlerInterface
Return type void

SetInternalOrderNoteCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\SetInternalOrderNoteCommand Sets internal note about order that can only be seen in Back Office.

Command details
Constructor parameters
  • $int $orderId
  • $string $internalNote
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\SetInternalOrderNoteHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\SetInternalOrderNoteHandlerInterface
Return type void

UpdateInvoiceNoteCommand

PrestaShop\PrestaShop\Core\Domain\Order\Invoice\Command\UpdateInvoiceNoteCommand Adds note for given invoice.

Command details
Constructor parameters
  • $int $orderInvoiceId
  • $string $note
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\UpdateInvoiceNoteHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\Invoice\CommandHandler\UpdateInvoiceNoteHandlerInterface
Return type void

UpdateOrderShippingDetailsCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\UpdateOrderShippingDetailsCommand Updates shipping details for given order.

Command details
Constructor parameters
  • $int $orderId
  • $int $currentOrderCarrierId
  • $int $newCarrierId
  • $?string $trackingNumber = ''
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\UpdateOrderShippingDetailsHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\UpdateOrderShippingDetailsHandlerInterface
Return type void

UpdateOrderStatusCommand

PrestaShop\PrestaShop\Core\Domain\Order\Command\UpdateOrderStatusCommand Updates order status.

Command details
Constructor parameters
  • $int $orderId
  • $int $newOrderStatusId
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\UpdateOrderStatusHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\CommandHandler\UpdateOrderStatusHandlerInterface
Return type void

UpdateProductInOrderCommand

PrestaShop\PrestaShop\Core\Domain\Order\Product\Command\UpdateProductInOrderCommand Updates product in given order.

Command details
Constructor parameters
  • $int $orderId
  • $int $orderDetailId
  • $string $priceTaxIncluded
  • $string $priceTaxExcluded
  • $int $quantity
  • $?int $orderInvoiceId = NULL
Handler class PrestaShop\PrestaShop\Adapter\Order\CommandHandler\UpdateProductInOrderHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\Product\CommandHandler\UpdateProductInOrderHandlerInterface
Return type void

Order Queries

GetOrderForViewing

PrestaShop\PrestaShop\Core\Domain\Order\Query\GetOrderForViewing Get order for view in Back Office

Query details
Constructor parameters
  • $int $orderId
  • $string $productsSorting = 'ASC'
Handler class PrestaShop\PrestaShop\Adapter\Order\QueryHandler\GetOrderForViewingHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\QueryHandler\GetOrderForViewingHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderForViewing

GetOrderPreview

PrestaShop\PrestaShop\Core\Domain\Order\Query\GetOrderPreview __

Query details
Constructor parameters
  • $int $orderId
Handler class PrestaShop\PrestaShop\Adapter\Order\QueryHandler\GetOrderPreviewHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Order\QueryHandler\GetOrderPreviewHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderPreview

GetOrderProductsForViewing

PrestaShop\PrestaShop\Core\Domain\Order\Query\GetOrderProductsForViewing Query for paginated order products

Query details
Constructor parameters
    Handler class PrestaShop\PrestaShop\Adapter\Order\QueryHandler\GetOrderProductsForViewingHandler

    Implements:

    • PrestaShop\PrestaShop\Core\Domain\Order\QueryHandler\GetOrderProductsForViewingHandlerInterface
    Return type PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderProductsForViewing