close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How do I change shipping and tax for international customers

Thread begun 1/04/2010 8:27 am by Roxana | Last modified 1/26/2010 8:01 pm by Roxana | 5364 views | 22 replies |

Roxana

How do I change shipping and tax for international customers

Hi,

We have a German based multilingual website serving domestic and international customers. Domestic customers pay a set amount of shipping and tax which is reflected on the cart page and the confirm page (I am thinking of taking these amounts of the cart page).

Depending on which country is selected, the customer gets redirected to the respective success page (domestic or international) from the confirm page.

Instead of redirecting the customers from the confirm page, I would like to redirect them from the checkout page (that way international customers would not have to confirm taxes and shipping cost that don't apply to them).

The redirect on the confirm page is set up in the store cart details behaviour like this:
$WA_redirectURL = (((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"") == ' Deutschland')?"checkout_success.php": (((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"") == ' Germany')?"checkout_success.php": (((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"") == ' Allemagne')?"checkout_success.php": (((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"") == ' Alemania')?"checkout_success.php":"checkout_success2.php";

If I applied this code to the checkout page, how would I have to wrap it?

Could someone help me with this?

To make things a little more complicated, we also have a branch in Canada. In Canada every province has different tax rules, and some customers are tax exempt. Can eCart accommodate that?

Sign in to reply to this post

Eric Mittman

Do you have the other confirm page already crafted? If not you will need to ensure that you have the page created before you can make use of it.

You can do a very similar thing to what you have done already, you will check the shipping country and based on this send the user to an alternate version of the page. Here is an example of what that may look like.

php:
if(isset($_POST["shipping_country"]) && $_POST["shipping_country"] == ' Alemania'){

header("Location: confirm2.php");
}



This is just an example of what this would look like, it would be up to you to get the custom code implemented correctly.

You can use eCart for your taxes in Canada, you will just need to craft tax rules that look at the country as well as the province and apply the appropriate tax for that region.

Sign in to reply to this post

Roxana

Hi Eric,

Thank you for your reply. The page confirm2.php looks very similar to confirm.php. I went ahead and tried to implement the code you posted above, but I did not get the redirect to work. I also tried the code from the confirm page without any luck.

I am also not sure the code would redirect correctly. Like on the confirm page customers from Germany should be redirected to confirm.php, and all other countries to confirm2.php.

I would very much appreciate, if you could help me to implement the code?

As far as the Canadian taxes go, I overlooked that all prices are in Euro. So for now I will treat them as regular international customers.

Sign in to reply to this post

Eric Mittman

The code that I posted should be placed on the regular confirm page. It will check the shipping country selected. In the example if the selected country is Alemania then the user will be redirected to confirm2.

It is a very simple check of the posted shipping_country. To test it out you would need to ensure that you select the country listed in the if statement. If there are multiple countries that could trigger this you can either add them to the condition or create new if statements. For the value that I used I based it off of the custom code you implemented earlier.

If you have any further problems with this you can print out the value that is being compared so that you can determine if they are matching or not. To do this you would add in this line of code just after the if statement:

php:
<?php die($_POST["shipping_country"]); ?>
Sign in to reply to this post

Roxana

Hi Eric,

Thank you for getting back. It works now :)

I falsely assumed that I needed to implement the redirect on the checkout page. After giving it more thought, it makes no sense, because at that point there is no entry in the database to compare to.

I changed the action on the checkout page to confirm2.php, and the code on confirm2 redirects to confirm.php, if shipping_country is Deutschland, Germany, Allemagne or Alemania.

Thank you again for the great advice.

Roxana

Sign in to reply to this post

Eric Mittman

You are very welcome, I'm glad you got it working now.

Sign in to reply to this post

Roxana

redirect causes a problem

Hi Eric,

I thought all was well and working, but the redirect seems to cause a problem. From the checkout page the customer is directed to confirm2.php, if the shipping_country is Germany, the customer gets redirected to confirm.php with this code:

<?php
//Redirect to confirm.php if shipping_country is Germany
if(isset($_POST["shipping_country"]) && $_POST["shipping_country"] == ' Deutschland'){
header("Location: confirm.php");
}
if(isset($_POST["shipping_country"]) && $_POST["shipping_country"] == ' Germany'){
header("Location: confirm.php");
}
if(isset($_POST["shipping_country"]) && $_POST["shipping_country"] == ' Allemagne'){
header("Location: confirm.php");
}
if(isset($_POST["shipping_country"]) && $_POST["shipping_country"] == ' Alemania'){
header("Location: confirm.php");
}
?>

The problem is now, that on confirm.php (for German customers) none of the contact info is displayed. For confirm2.php the contact info is displayed without any problems. The code of both pages is exactly the same, but for one page the contact info is displayed, and for the other not. This leads me to believe, that the redirect could cause the problem.

BTW, once I confirm the order, on the success page the contact info is all there.

Eric, if you would help me, could you maybe open a ticket for this problem, so I can send you the files?

Roxana

Sign in to reply to this post

Roxana

I have one more piece of information. I changed the action on the checkout page to confirm.php to avoid the redirect in case shipping_country is Germany. Then all contact info is displayed. So the problem seems to be the redirect.

Sign in to reply to this post

Eric Mittman

I have a feeling that I know what the problem is. If you are redirecting the user before the session variables are set for the values submitted by the form then the values may not appear on the confirm page.

On your confirm page with the redirect code you should see a series of session variables that are being set, if you put the code after this then it should work. If you have any further trouble with this please post back with a copy of the page minus your account details so that we can take a look at the problem.

Sign in to reply to this post

Roxana

Hi Eric,

Thank you for getting back. I had the same idea and put the redirect at the end of the php section. But that didn't work. I also tried deleting lines 115-302, as well as the store cart summary behavior and the store cart details behavior from the confirm page. My idea was, that those values would already have been provided by confirm2.php, but I still had the same result.

I tried to attached both pages, but I have problems uploading the pages. For both pages I get the message "Upload errors: ... invalid file".

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