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

public function cart_tax_end($tax) {
    return 200;

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

1 Answer 1


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

  • I tried that but Hook is not even calling. Am I missing something? May 9, 2018 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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