Washington state tax lookup issues.

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Washington state tax lookup issues.

Post by compunerdy » Fri Nov 29, 2013 10:04 pm

I was noticing my site was going really slow when I was logged in (with WA address assigned to my login) and figured out it was due to the tax lookup tool.

I know the states server must be having issues as I keep getting 500 server errors posted in my log file. I can force one by clicking on a bunch of items rapidly.

I have asked this before and never received a answer but why does it send a tax request EVERY time I click on a item? Is there a option to show the tax on the item pages or something and if so is there some way to turn it off? There is no reason I can think of to flood their servers with requests for no reason.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Washington state tax lookup issues.

Post by jmestep » Mon Dec 02, 2013 6:09 am

The tax is calculated anywhere the price is shown, probably because of the option check for the VAT tax. You would need to change all those places is my guess.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: Washington state tax lookup issues.

Post by compunerdy » Mon Dec 02, 2013 9:44 am

Any idea where I should start? Having it lookup tax every time someone views a item is crazy..

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: Washington state tax lookup issues.

Post by compunerdy » Wed Dec 04, 2013 12:16 pm

I just found out it only looks up the tax when you view items if there is something in the cart so it is more likely the mini cart reloading that causes the lookup?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Washington state tax lookup issues.

Post by jmestep » Thu Dec 05, 2013 6:40 am

This is just an untested theory.
Code looks for tax info in places like the following in the productpriceconlib. The "true" below means whether to calculate tax or not.
So changing that to false would seem to not calculate tax.
Also, in lines like this TaxHelper.GetShopPrice(_Product.Price, _Product.TaxCodeId);, it looks like if you pass a 0, it won't calculate price.

Code: Select all

  ProductCalculator pcalc = ProductCalculator.LoadForProduct(_Product.ProductId, 1, _OptionList, AlwaysConvert.ToList(",", _SelectedKitProducts), Token.Instance.UserId, true);

                //IF REQUIRED MAKE ADJUSTMENTS TO DISPLAYED PRICE TO INCLUDE VAT
                LSDecimal basePriceWithVAT = TaxHelper.GetShopPrice(_Product.Price, _Product.TaxCodeId);
                LSDecimal priceWithVAT = pcalc.PriceWithTax;
                LSDecimal msrpWithVAT = TaxHelper.GetShopPrice(_Product.MSRP, _Product.TaxCodeId);

As I said, it is a theory and I haven't thoroughly tested and when I test, it will be in Gold. If the above theory is true, it looks like it would be nice to have a setting in the admin where if it was set to not calculate tax until checkout, that would save looking up for taxes all the time. There are settings to not show tax, but none to not calculate all together.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Washington state tax lookup issues.

Post by Katie » Thu Dec 05, 2013 8:20 am

We also use the WA state tax service, and we get 500 errors in the log too. I'm not sure it's happening with the mini-basket though. Today, I did some testing and there are no errors, but on Tuesday (3rd), I saw quite a few of them. The Tax Settings page has display options, and you can turn off the tax calculations for 'Shopping Display'. This will remove them until the user goes to checkout and an address is known. This is how we have it set. I tested both ways though.

I suspect that WA state tax services are not that reliable and there may be some issues on their end. Otherwise, I would be able to reproduce this on a regular basis - and I can't.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: Washington state tax lookup issues.

Post by compunerdy » Thu Dec 05, 2013 10:16 am

I have mine set at "do not show taxes while shopping" so that definitely does not stop all tax lookups except at checkout. This is easy to test by just turning on debug mode and watching the log file.

When I am logged in with my Washington address (have not verified it does not just do it to everyone) and I do not have any items in my cart then there are no tax lookups but as soon as I add one item to the cart then every time I view another item (page reloads is probably more the cause) tax is looked up. This is quite apparent with the WA servers being pretty slow lately especially when a 500 error hits in the background and the page takes 30sec to load.

Katie, can you guys please figure out what code changes need to be done so tax is only looked up at checkout? I have been talking to the WA state guys about their server issues and will let them know you have had the same issues as me lately. Sometimes it works nice and fast but it seems to be having issues a lot lately.

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Washington state tax lookup issues.

Post by Katie » Thu Dec 05, 2013 10:33 am

Katie, can you guys please figure out what code changes need to be done so tax is only looked up at checkout?
Did Judy's suggestion work? I didn't realize the tax setting is just a display variable and the basket items are still being checked.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: Washington state tax lookup issues.

Post by compunerdy » Thu Dec 05, 2013 1:07 pm

The mini basket is causing it due to the basket.Recalculate();

If I comment that out it stops looking up the tax on reload. Should I just leave that commented out or look somewhere else to stop it?

Post Reply