close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Sales Tax Calculation in eCart 6

Thread began 8/04/2014 10:19 am by joerg431091 | Last modified 8/04/2014 2:35 pm by Jason Byrnes | 1344 views | 9 replies |

joerg431091

Sales Tax Calculation in eCart 6

Hi,

I have problems with eCart6 calculating / displaying sales tax, in our case in North Carolina.

Here is what I have in the Tax Tab (eCart Merchandising Rule) of the eCart object:

Taxable total > 0
AND If Session variable eCartCheckoutForm_state_province == NC

(image attached)

The rule in my cart_PHP.php is:


function WAEC_TTC_SalesTax() {
$totalTax = 0;
if (true && (($this->GetTaxableTotal() > 0) && ((isset($_SESSION['eCartCheckoutForm_state_province'])?$_SESSION['eCartCheckoutForm_state_province']:"") == "NC"))) {
$totalTax += ($this->GetTaxableTotal() * 0.0725);//Result
}
return WA_eCart_FormatNumber($totalTax, $this->ForceDecimalsC, $this->DecimalPlacesC);
}


Any ideas what I might doing wrong here?

Thanks a lot.

Joerg

Sign in to reply to this post

Jason ByrnesWebAssist

perhaps you are using the wrong session name.


on the confirm page, add the following code in the body to write the session contents to the page and identify the session name fro the state:

<pre><?php @session_start(); var_dump($_SESSION); ?></pre>
Sign in to reply to this post

joerg431091

Thanks for your response Jason.

I added the code and here is the result on the page:

array(2) {
["TTC_Items"]=>
string(323) "1028|WAECART|Nespresso Vertuo Machine Black|WAECART||WAECART|Nespresso_Vertuo_Black_Single_120x100.jpg|WAECART|13|WAECART|1|WAECART|269.1|WAECART|Black|WAECART|8.32" x 11.91" x 11.93"|WAECART|0|WAECART|GCA1-US-BK-NE|WAECART|140716569197|WAECART|13|WAECART|269.1|WAECART|1 Nespresso Vertuo Machine Black (1028)|WAECART|269.1"
["WAEC_ContinueRedirect"]=>
string(35) "/products_detail.php?ProductID=1028"
}

I am not sure whether I read this correctly. Where can I see the session name?

Thanks for your help.

Joerg

Sign in to reply to this post

Jason ByrnesWebAssist

it doesn't look like you have gone through the checkout page yet,

tax can not be calculated till you go through the checkout page to set the billing state. tax will be calculated on the confirm page.

Sign in to reply to this post

joerg431091

I know. There is no tax calculation after I set the billing state. The tax usually appears after entering all billing and shipping information in the checkout.php page where you enter the credit card information and submit the order. But no Tax is calculated - not even in the checkout_success.php page.

The system somehow seem to recognize the information in the eCart object because once I remove the tax rule from the eCart object = tax is calculated regardless of state. It is just once I enter the state (NC) as described above that no tax is calculated at all.

Here again is the result of the dump session code that you asked me to put into the confirm.php page. Can you identify the session value in this result?

array(2) {
["TTC_Items"]=>
string(286) "763|WAECART|Rodeo Cow Leather Collar|WAECART||WAECART|Karlie_09308_120x100.jpg|WAECART|0.2|WAECART|1|WAECART|33.95|WAECART|Black / Cognac|WAECART|17.25" x 1.00"|WAECART|0|WAECART|09307|WAECART|140716856922|WAECART|0.2|WAECART|33.95|WAECART|1 Rodeo Cow Leather Collar (763)|WAECART|33.95"
["WAEC_ContinueRedirect"]=>
string(34) "/products_detail.php?ProductID=763"
}

Thx.

Joerg

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

joerg431091

Thanks Jason - please see PM

Sign in to reply to this post

Jason ByrnesWebAssist

the correct session is:

$_SESSION['WASF_CheckoutWizard_Basic_Default']['State']


so change this line:
if (true && (($this->GetTaxableTotal() > 0) && ((isset($_SESSION['eCartCheckoutForm_state_province'])?$_SESSION['eCartCheckoutForm_state_province']:"") == "NC"))) {

to:
if (true && (($this->GetTaxableTotal() > 0) && ((isset($_SESSION['WASF_CheckoutWizard_Basic_Default']['State'])?$_SESSION['WASF_CheckoutWizard_Basic_Default']['State']:"") == "NC"))) {

Sign in to reply to this post

joerg431091

That did it. Thank you so much. I changed the checkout form at one point in the past and did not consider this.

Thanks a lot and have a great day.

Best,
Joerg

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post
loading

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