I seem to have found a bug with Cartthrob 2.6 where the tax is calculated incorrectly when using allow_user_price="yes" within the "add_to_cart_form" tag. The cart seems to display the tax of the item, rather than the allowed user price which should override this. The previous version of CT was working fine.

(Updated on EE 2.9)

Has anyone come across this and found any solution? I will have a dig about to see what is going on, but it's unusable in my case until I find a fix.

UPDATE: I've looked into this further and it seems to be where the base_price() function is called and uses retrieves the item's price rather than the dynamic price in this case (found in in cartthrob/core/item/Cartthrob_item_product.php).

If there's a way to detect if product has a dynamic price, then we could tell it to use retrieve the calculated price. However I am unable to see any identifier to say this has a dynamic price within the $item/$this object? Or perhaps I'm missing something?!? Any suggestions very welcome...


  • In case anyone needs to know, I had a call from Cartthrob who was helpful suggesting a fix for this.
    – SyA
    Aug 5, 2014 at 22:13
  • What was the fix they suggested? Sep 10, 2014 at 13:59

1 Answer 1


Ah yes... The fix is to replace line 566 within the cartthrob/cartthrob/core/Cartthrob_item.php file.

This is within the get_item_tax function where you'd replace:

$tax = $plugin->get_tax($this->base_price(), $this);


$tax = $plugin->get_tax($cost, $this);

This fixed the problem and haven't seen any issues with it.


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.