Jump to content

Fatal Error In Module Avalaratax


Recommended Posts

I was in the back office in the Localization>Localization tab and saw that PS had a Recommended Module update called alvaratax so I tried to install it.  I don't believe there was any confirmation or any button to 'save' so I moved on.  Now when I click on Recommended Modules (in localization>Localization) I get a pop-up that just hangs and cannot see if this mod is installed correctly.  It's not listed in the Mods folder.

 

And when I try to view the installed mods from the Back Office (Modules>Modules) I get this error:

 

[PrestaShop] Fatal error in module avalaratax:
syntax error, unexpected ''customer_tax_address_id'' (T_CONSTANT_ENCAPSED_STRING)

 

and cannot view any of the mods whatsoever so I'm kind of stuck.  Any help here would be hot.

 

 

v 1.6 installed locally using default bootstrap.

Link to comment
Share on other sites

same error here.

Avalara module is the worse module you will find in Prestashop

I did get in touch with my Avalara representative a month ago, and it is on my request (through NuRelm) that they started working on a new module.

The initial module V3.5.5 did not work correctly in Prestashop 1.6.1.1 (not taxes displayed in shopping cart)

Nurelm was contacted by my Avalara representative but Nurelm never contacted me directly to let me know that they were working on a new module.

Very bad support from Nurelm, and now they succeeded in breaking the back office.

I am going to contact my Avalara rep (since Nurlem does not bother talking to me) and let him know that Nurelm broke the back office.

I took some drastic measure: connected through FTP to my website hosting server and completely deleted the Avalaratax module.

Back office is working again.

Edited by lweinlan (see edit history)
Link to comment
Share on other sites

for the future be very careful in downloading the new AVALARA module once it is fixed.

I have an excellent testsite creator module that is an exact clone of the live website. That's were I will be testing the new AVALARA module once they have fixed it. If stuff breaks on the test site, no big deal since it is not the "real" website.

I would not install this AVALARA module on a live website before being sure that it is not going to break your back office.

Link to comment
Share on other sites

Hi Everyone,
 
We've recently taken over maintenance of the module, and have made a ton of updates to the module that should make it a much more useful tool.
 
We're sorry about this issue.  It's due to changes between the version of PHP you're using vs the PHP version modules are tested on.  It looks like you're using a version of PHP that's lower than 5.5.0, which handles a function that the module uses slightly differently.  There are 2 options to resolve this:
 
Option A ) You can update to PHP 5.5.0, or
 
Option B ) If updating PHP is problematic, you need to make 2 changes to one file.  The file is modules/avalaratax/avalaratax.php, here are the two lines to change:
 
Change #1:
If you're comfortable with Github, this is the change to make.
Or, go to line 589, which should look like this prior to updating:
 
if (empty($s_cart['cart_id']) || empty($s_cart['customer_id']) || empty('customer_tax_address_id') || empty('carrier')) {
 
and change it to this:
 
if (empty($s_cart['cart_id']) || empty($s_cart['customer_id']) || empty($s_cart['customer_tax_address_id']) || empty($s_cart['carrier'])) {
 
Change #2:
Either use this Github commit listing, or
Go to line 1638, which should look like this prior to your update:

if (!empty(trim($entity_use_code))) {
 
And change it to the following:
 
if (!(trim($entity_use_code) == false)) {
 
Please let us know if that does the trick, and we'll report back if we find any further PHP version issues.  Meanwhile, we'll test on older versions of PHP and push all the updates once that's done.

Edited by nurelm (see edit history)
Link to comment
Share on other sites

It worked!

 

I have PS installed locally so I can't fool around with the PHP but I tried to reinstall the module again and got the same errors.  Then I made the 2 changes in the avalaratax.php file you advised using Notepad++ and it works fine now.

 

Thanks so very much! 

 

Reason for the edit:  I just noticed that now there appears to be 2 separate instances of the avalaratax module.  The first is inside a folder labeled avalaratax.  The second is in a folder labeled: b8e6eee831f83671d8286f8fc8d4c5b8>avalaratax.

 

The files inside both seem to be identical and I imagine the 2nd one above to be some kind of error duplicate.  Ok to delete that one?

Edited by Copernican Theory (see edit history)
  • Like 1
Link to comment
Share on other sites

Copernican Theory: Awesome, I'm glad that worked.  I would [cautiously] remove that 2nd folder with the long name, start by just moving it out of your prestashop folder and test everything prior to deleting it.

 

lweinlan: I'm sorry to hear of the bad experience you had a month ago. We actually started work on the module prior to that, and were working with Avalara support to communicate updates through them while we focused on making updates to the module.  We've been communicating through our support email since this morning, and will continue working with you until any issues you're having are resolved to your satisfaction.

Link to comment
Share on other sites

For anyone arriving at this topic, here's a summary:

 

If you are running PrestaShop on a version of PHP that is older than 5.5.x and using version 3.5.6 of the Avalara module, you'll either need to update PHP to 5.5.x or following this procedure:
 
 
Also, be sure to check out the README once you update to make sure your Avatax module setup is correct:
 
 
And, please make sure you backup your store before making ANY updates, and preferably make all updates on a staging server prior to doing so on a live server
 
Good luck!
Link to comment
Share on other sites

Hi NuRelm, below is the error I got when I try to "save settings or click here to test connection" at the BO:

 

[PrestaShop] Fatal error in module file :/home/walfave4038/public_html/modules/avalaratax/sdk/AvaTax.php:
require_once(): Failed opening required '/home/walfave4038/public_html/modules/avalaratax/sdk/classes/AvaCert2Svc/LeoFrameworkHelper.class.php' (include_path='/home/walfave4038/public_html/tools/htmlpurifier/standalone:.:/usr/lib/php:/usr/local/lib/php’)
 
php on my shop have been updated php to 5.6.17 and followed instruction here: https://github.com/nurelm/prestashop-avalaratax/tree/feature/feature-module-rewrite
 
Please advice,
 
Thanks. 
 
Iyalla Walcourt
Link to comment
Share on other sites

  • 3 weeks later...

Hi Iyalla, we have heard from a number of users that the Leo Themes conflicts with the Avalara module (along with a few other modules). Please contact Leo's support to see if they can offer suggestions on how to avoid the conflict.

 

Thanks and sorry I couldn't offer more help on that issue!

Link to comment
Share on other sites

  • 4 months later...

Hey there @nurelm

 

I'm having a similar issue here, but it seems like its the Mailer built-in to PrestaShop which is having the issue?  Thoughts?

 

Warning: require_once(/var/www/abc.com/modules/avalaratax/sdk/classes/AvaCert2Svc/Swift_Attachment.class.php): failed to open stream: No such file or directory in /var/www/abc.com/modules/avalaratax/sdk/AvaTax.php on line 22

 
Fatal error: require_once(): Failed opening required '/var/www/abc.com/modules/avalaratax/sdk/classes/AvaCert2Svc/Swift_Attachment.class.php' (include_path='/var/www/abc.com/tools/htmlpurifier/standalone:.:/opt/rh/php55/root/usr/share/pear:/opt/rh/php55/root/usr/share/php') in /var/www/abc.com/modules/avalaratax/sdk/AvaTax.php on line 22
 
Edited for completeness:
 
php version: 5.5.21
PrestaShop: 1.6.1.5
AvaTax: 3.5.7
Edited by eric.arnoldy (see edit history)
Link to comment
Share on other sites

I find this absolutely unbelievable. You provide a module and you ask everyone to make changes to it if they have an older PHP version.

 

Is it really too much work to add a few lines to the module?:

if (version_compare(phpversion(), '5.5.0', '<')) 
{}
else
{}
  • Like 1
Link to comment
Share on other sites

Hi @eric.arnoldy, it looks like there might have been a problem installing the module.  We see this happen sometimes with PS module installs, where somehow the install gets botched through no fault of your own.

 

Please try uninstalling the AvaTax module, then for good measure removing the [prestashop]/modules/avalaratax/ directory completely.  Then reinstall and see if the same file is reported as missing.

Link to comment
Share on other sites

  • 5 months later...

Hello,

I try to make the change in the file avalaratax.php. Everything goes well

 

for the first modification but I do not find the lines corresponding to the second modification.

 

If (! (Trim ($ entity_use_code) == false)) {

 

Thank you for your help.

 

I'm in prestashop 1.6 in php 5.5

 

The mistake :

 

[PrestaShop] Fatal error in module file: /home/.../www/.../modules/avalaratax/avalaratax.php: Requirements: '/home/l.../www/.../modules/avalaratax/backward_compatibility/backward.php' (include_path = '/ home / ... / www / ... / tools / htmlpurifier / standalone:. / Usr /local/php5.6/lib/php ')

Edited by Delphine1759 (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...