2

There is observer in my magento 1 site for event vat_check_after.

In this observer the code is:

$validation_result = $observer->getEvent()->getValidationResult();
if($validation_result->getVatRemoved() == true){
.....
}

but in one page checkout there is exception thrown:

Call to undefined method stdClass::getVatRemoved()

I did not find this method anywhere so what should I do to prevent exception? How can I debug this issue?

1

Looks like $observer->getEvent()->getValidationResult() return an instance of stdClass.
This means, you can get the value you need like this $validation->result->vat_removed

  • Ok with my vars it would be like: $validation_result->result->vat_removed OR $validation_result->vat_removed? Please let me know. – Stack user May 28 at 6:04
  • I have no idea how $validator_result looks like. You can check how $validation_result. You can do that with a simple var_dump. – Marius May 28 at 6:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.