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

Warning: You are browsing the documentation for PrestaShop 1.7, which is outdated.

You might want to read an updated version of this page for the current version, PrestaShop 8. Read the updated version of this page

Learn how to upgrade to the latest version.

CartRule domain

CartRule Commands

AddCartRuleCommand

PrestaShop\PrestaShop\Core\Domain\CartRule\Command\AddCartRuleCommand Adds new cart rule

Command details
Constructor parameters
  • $array $localizedNames
  • $bool $highlightInCart
  • $bool $allowPartialUse
  • $int $priority
  • $bool $isActive
  • $DateTime $validFrom
  • $DateTime $validTo
  • $int $totalQuantity
  • $int $quantityPerUser
  • $PrestaShop\PrestaShop\Core\Domain\CartRule\ValueObject\CartRuleAction\CartRuleActionInterface $cartRuleAction
  • $float $minimumAmount
  • $int $minimumAmountCurrencyId
  • $bool $isMinimumAmountTaxExcluded
  • $bool $isMinimumAmountShippingExcluded
Handler class PrestaShop\PrestaShop\Adapter\CartRule\CommandHandler\AddCartRuleHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\CartRule\CommandHandler\AddCartRuleHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\CartRule\ValueObject\CartRuleId

BulkDeleteCartRuleCommand

PrestaShop\PrestaShop\Core\Domain\CartRule\Command\BulkDeleteCartRuleCommand Deletes cart rules in bulk action

Command details
Constructor parameters
  • $array $cartRuleIds
Handler class PrestaShop\PrestaShop\Adapter\CartRule\CommandHandler\BulkDeleteCartRuleHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\CartRule\CommandHandler\BulkDeleteCartRuleHandlerInterface
Return type void

BulkToggleCartRuleStatusCommand

PrestaShop\PrestaShop\Core\Domain\CartRule\Command\BulkToggleCartRuleStatusCommand Toggles cart rule status in bulk action

Command details
Constructor parameters
  • $array $cartRuleIds
  • $bool $expectedStatus
Handler class PrestaShop\PrestaShop\Adapter\CartRule\CommandHandler\BulkToggleCartRuleStatusHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\CartRule\CommandHandler\BulkToggleCartRuleStatusHandlerInterface
Return type void

DeleteCartRuleCommand

PrestaShop\PrestaShop\Core\Domain\CartRule\Command\DeleteCartRuleCommand Deletes cart rule

Command details
Constructor parameters
  • $int $cartRuleId
Handler class PrestaShop\PrestaShop\Adapter\CartRule\CommandHandler\DeleteCartRuleHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\CartRule\CommandHandler\DeleteCartRuleHandlerInterface
Return type void

ToggleCartRuleStatusCommand

PrestaShop\PrestaShop\Core\Domain\CartRule\Command\ToggleCartRuleStatusCommand Toggles cart rule status

Command details
Constructor parameters
  • $int $cartRuleId
  • $bool $expectedStatus
Handler class PrestaShop\PrestaShop\Adapter\CartRule\CommandHandler\ToggleCartRuleStatusHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\CartRule\CommandHandler\ToggleCartRuleStatusHandlerInterface
Return type void

CartRule Queries

GetCartRuleForEditing

PrestaShop\PrestaShop\Core\Domain\CartRule\Query\GetCartRuleForEditing Gets cart rule for editing in Back Office

Query details
Constructor parameters
  • $int $cartRuleId
Handler class PrestaShop\PrestaShop\Adapter\CartRule\QueryHandler\GetCartRuleForEditingHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\CartRule\QueryHandler\GetCartRuleForEditingHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\CartRule\QueryResult\EditableCartRule

SearchCartRules

PrestaShop\PrestaShop\Core\Domain\CartRule\Query\SearchCartRules Searches for cart rules

Query details
Constructor parameters
  • $string $searchPhrase
Handler class PrestaShop\PrestaShop\Adapter\CartRule\QueryHandler\SearchCartRulesHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\CartRule\QueryHandler\SearchCartRulesHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\CartRule\QueryResult\FoundCartRule[]