Jump to content

How to pass a value to the controller code


opnh

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...