The code that you posted looks like it should be working for you without this error. I have made the updates that are needed to the original file and I'm attaching it to this post.
Please give it a try with this new file to ensure that the error goes away. Make sure you update it on your live server as well. The file needs to be placed inside of the WA_eCart folder in your site.