Log in
Model

Codegenerator

Magento\SalesRule\Model\Coupon\Codegenerator

What it does

This class generates random coupon codes for sales rules/promotions in Magento 2.

Developers use this when creating coupon code generation functionality, allowing customization of code length, alphabet characters, and delimiters.

It's primarily used by the SalesRule module when merchants need to auto-generate unique promotional codes.

Public Methods

  • generateCode()
  • getDelimiter()