0

May be a stupid question, but I just can't seem to find any documentation on it.

How do I set up a hook in cartthrob? I need to do some special calculations on the tax.

I tried

ee()->cartthrob->core->hooks->set_hook("cart_tax_end");
public function cart_tax_end($tax) {
    return 200;
}

But that didn't seem to do anything...

2

CT's hooks work in the same way as native EE hooks. This means that you need to create an extension to use them: http://ellislab.com/expressionengine/user-guide/development/extensions.html

HOWEVER, depending on your exact requirements, it may be best to create a Cartthrob tax plugin: http://cartthrob.com/docs/developers/tax_plugins/index.html

| improve this answer | |
  • I tried that but Hook is not even calling. Am I missing something? – Mufi - Amici Infotech May 9 '18 at 14:58

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.