close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Cart is not correctly applying shipping state variable to tax rules

Thread began 2/20/2014 4:21 pm by Maggie Simpson | Last modified 2/24/2014 12:42 pm by Maggie Simpson | 399 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?

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...