cancel
Showing results for 
Search instead for 
Did you mean: 

How to get coupon information?

How to get coupon information?

Hi all, I am new to magento 2.

I have the coupon code and trying to use \Magento\SalesRule\Model\Coupon $coupon but no luck.

 

I put this to construct "use \Magento\SalesRule\Model\Coupon $coupon"

error message:

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\SalesRule\Model\CouponRepository::__construct() must be an instance of Magento\SalesRule\Model\CouponFactory, none given, called in /var/www/html/magento/app/code/

 

can someone please help?

 

1 REPLY 1

Re: How to get coupon information?

problem solved...need to do setup:upgrade and clear cache.....