|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| __construct (\Magento\SalesRule\Model\Service\CouponManagementService $couponManagementService, \Magento\SalesRule\Api\Data\CouponGenerationSpecInterfaceFactory $generationSpecFactory) | |
| generateCodes (array $parameters) | |
Allows to generate a pool of coupon codes.
Generated coupon code - auto generated string, which is used on checkout in order to get discount (fixed or in percents) on whole customer shopping cart or on items in this shopping cart. Class was added due to Backward Compatibility and is used as proxy to:
Definition at line 16 of file CouponGenerator.php.
| __construct | ( | \Magento\SalesRule\Model\Service\CouponManagementService | $couponManagementService, |
| \Magento\SalesRule\Api\Data\CouponGenerationSpecInterfaceFactory | $generationSpecFactory | ||
| ) |
All objects should be injected through constructor, because we need to have working service already after it initializing
| Service\CouponManagementService | $couponManagementService | |
| \Magento\SalesRule\Api\Data\CouponGenerationSpecInterfaceFactory | $generationSpecFactory |
Definition at line 49 of file CouponGenerator.php.
| generateCodes | ( | array | $parameters | ) |
Generate a pool of generated coupon codes
This method is used as proxy, due to high coupling in constructor
| array | $parameters |
Definition at line 68 of file CouponGenerator.php.