close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Cart is not correctly applying shipping state variable to tax rules

Thread began 2/20/2014 1:21 pm by Maggie Simpson | Last modified 2/24/2014 9:42 am by Jason Byrnes | 1339 views | 5 replies |

Maggie Simpson

Cart is not correctly applying shipping state variable to tax rules

We currently have nexus in four states, and I have written tax rules for all municipalities within those four states. I have upwards of twenty tax rules that apply the shipping state variable, if it exists and is equal to (for example) Nebraska, followed by the municipality, if it exists and is equal to (for example) Creighton. My trouble is that Creighton (for example) is a town in two of the states in which we have nexus, and it appears that the cart tax rules are ignoring the state variable, proceeding to apply the tax rule for each state, essentially almost doubling the tax. For example, a 400 dollar item being shipped to Creighton, NE, where the tax rate is is 6.5% is being charged $42.00 because it is also applying the Creighton, SD tax rate, which is 4%, on top of the NE rate. My example code is as follows...

//eCart Rule
function WAEC_eCart1_Nebraska65SalesTax() {
$totalTax = 0;
if (true && ((isset($_SESSION['eCartCheckoutForm_shipping_state_province'])) && (isset($_SESSION['eCartCheckoutForm_shipping_city'])) && ((isset($_SESSION['eCartCheckoutForm_shipping_state_province'])?$_SESSION['eCartCheckoutForm_shipping_state_province']:"") == "NE") && ((isset($_SESSION['eCartCheckoutForm_shipping_city'])?$_SESSION['eCartCheckoutForm_shipping_city']:"") == "chester") || ((isset($_SESSION['eCartCheckoutForm_shipping_city'])?$_SESSION['eCartCheckoutForm_shipping_city']:"") == "cordova") || ((isset($_SESSION['eCartCheckoutForm_shipping_city'])?$_SESSION['eCartCheckoutForm_shipping_city']:"") == "creighton"))) {
$totalTax += ($this->GetTaxableTotal() * 0.065);//Result
}
return WA_eCart_FormatNumber($totalTax, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

//eCart Rule
function WAEC_eCart1_SouthDakota4SalesTax() {
$totalTax = 0;
if (true && ((isset($_SESSION['eCartCheckoutForm_shipping_state_province'])) && (isset($_SESSION['eCartCheckoutForm_shipping_city'])) && ((isset($_SESSION['eCartCheckoutForm_shipping_state_province'])?$_SESSION['eCartCheckoutForm_shipping_state_province']:"") == "SD") && ((isset($_SESSION['eCartCheckoutForm_shipping_city'])?$_SESSION['eCartCheckoutForm_shipping_city']:"") == "creighton")|| ((isset($_SESSION['eCartCheckoutForm_shipping_city'])?$_SESSION['eCartCheckoutForm_shipping_city']:"") == "agar") || ((isset($_SESSION['eCartCheckoutForm_shipping_city'])?$_SESSION['eCartCheckoutForm_shipping_city']:"") == "allen") || ((isset($_SESSION['eCartCheckoutForm_shipping_city'])?$_SESSION['eCartCheckoutForm_shipping_city']:"") == "bath"))) {
$totalTax += ($this->TotalColumn("TotalPrice") * .04);//Result
}
return WA_eCart_FormatNumber($totalTax, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

Both are being applied to one purchase... any thoughts?

Sign in to reply to this post

Jason ByrnesWebAssist

Please provide a Skype username or a US phone number and a good time to contact you when you will be in front of your computer and we will have an engineer contact you to resolve this issue over the phone.

We are available Monday - Friday from 9am - 4pm EST (except major U.S. holidays).

Sign in to reply to this post

Maggie Simpson

phone number included in private message

Sign in to reply to this post

Jason ByrnesWebAssist

see pm

Sign in to reply to this post

Maggie Simpson

please see pm

Sign in to reply to this post

Jason ByrnesWebAssist

You reported:
"-- further update... added an opening parenthesis before the beginning of the city session variable options AND added a closing parenthesis after the city session variable options. turns out I wasn't missing an opening parenthesis, but a set of parenthesis to define the city options as a unit of choices. worked like a charm, thank heavens."

glad to hear it is working

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...