-
Notifications
You must be signed in to change notification settings - Fork 15
Fatal Error in Helper/TaxClass.php #104
Comments
Hi there. This issue actually doesn't involve the pull request I did earlier. They are separate issues I believe. The PR I did was a pretty simple fix. I'm not so sure about this one, so I didn't want to take a stab at it without letting you know about it first. Thanks! |
@TonyDeStefano - Thank you for the clarification. |
@TonyDeStefano - I've been able to reproduce this issue with the following steps:
Essentially, the problem occurs because the AvaTax queue process is trying to load a product that no longer exists. I'm refactoring the code to attempt to load an order item's associated product, but when that fails to produce a product, we will just use null values instead. This will prevent an error and still include the item on the AvaTax request and keep the sales tax as accurate as possible. One situation where this will result in a tax discrepancy is when a product in Magento was assigned a specific tax class at the time the order and invoice were created; because once the product is deleted, the tax code will use the default assigned by Avalara for tax calculation. |
@TonyDeStefano - This issue has been addressed as of release 1.3.2. Please upgrade your installation (in a dev/stage environment for testing first of course). Closing this issue. |
Preconditions
Steps to reproduce
Expected result
Actual result
Fatal error: Uncaught TypeError: Argument 1 passed to ClassyLlama\AvaTax\Helper\TaxClass::getItemCodeOverride() must be an instance of Magento\Catalog\Model\Product, null given, called in /var/www/html/magento/app/code/ClassyLlama/AvaTax/Framework/Interaction/Line.php on line 218 and defined in /var/www/html/magento/app/code/ClassyLlama/AvaTax/Helper/TaxClass.php on line 139
The text was updated successfully, but these errors were encountered: