Log in
Helper

Coupon

Magento\SalesRule\Helper\Coupon

What it does

This helper class manages coupon code generation and configuration in Magento 2.

Developers use it to retrieve default settings for auto-generated coupon codes (length, format, prefix, suffix, dash intervals) and to access character sets for different coupon formats (alphanumeric, alphabetical, numeric).

It centralizes all coupon-related configuration values and formatting options used throughout the sales rule system.

Public Methods

  • getFormatsList()
  • getDefaultLength()
  • getDefaultFormat()
  • getDefaultPrefix()
  • getDefaultSuffix()
  • getDefaultDashInterval()
  • getCharset()
  • getCodeSeparator()