I want to apply coupon code programmatically when the condition is true. If condition false coupon code should be not applied.
Please help me.
coupon-codesmagento2shopping-cart-price-rules
I want to apply coupon code programmatically when the condition is true. If condition false coupon code should be not applied.
Please help me.
Best Answer
You can try this below code :
Construct Method :
Then, you can use this below code in your function :
Object Manager Method :
Note : Use construct method instead of object Manager.