opnh Posted October 6, 2016 Share Posted October 6, 2016 Hello How to pass a value from a method public static function gcashId() from LoyaltyModule class from LoyaltyModule.php code to ParentOrderController in ParentOrderController.php file Link to comment Share on other sites More sharing options...
Apium Posted October 6, 2016 Share Posted October 6, 2016 (edited) I assume you could call that method from an override on the ParentOrderController, but I am not sure if that'd be the best course of action as I do not know what you are trying to achieve. Edited October 6, 2016 by Apium (see edit history) Link to comment Share on other sites More sharing options...
opnh Posted October 6, 2016 Author Share Posted October 6, 2016 I am applying one feature called GCASH the customer credited with Rs. 5000 cash he can use that credit cash for every product using the voucher and get 10% discount on each product so he can use that voucher untill 5000 becomes zero So I want to disable the voucher when the amount becomes zero from the output of gcash(); method So I tried to override the ParentOrderController using the below code in the section if ($this->nbProducts) condition but I am getting error if ($this->nbProducts) { if (CartRule::isFeatureActive()) { if (Tools::isSubmit('submitAddDiscount')) { $cart_rules = $this->context->cart->getCartRules(); $my_mod = new LoyaltyModule; if(Tools::isSubmit('action') && Tools::getValue('action') == 'gcashId') $getdislast=$my_mod->gcashId(); echo $getdislast; if($getdislast == 0) { $this->errors[] = Tools::displayError('Sorry....The voucher code is invalid because your GCASH 5000 rupees became zero.'); } } } So how to do this Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now