I have searched almost all question but didn't get any hint how can i add coupon code from module...?
I have created module and from front side that is 'catalog\controller\module\mycoupon' i want to add coupon code auto on database, for adding i use this code
$this->model_sale_coupon->addCoupon($this->request->post);
but for that i need to load model 'sale/coupon' but which is located in admin controller so how can i call that model into catalog module ?
Or do i need to add that via DB model directly on database?
$this->db->query();
I am getting this error "Notice: Error: Could not load model checkout/cart!" because its outside catalog right how to call that?
My aim is to create coupon code directly on fly when someone click on submit.