Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Showing an information box on checkout_confirmation.php - How to do that?


heranke

Recommended Posts

Dear Community,

 

[Description]

Since changes in law from 08/2012 there is the need to show information about tax and duty-regulations IF (AND ONLY IF) the customers is sitting outside the EU and want to ship it there. (See http://www.haendlerbund.de/hinweisblaetter/finish/1-hinweisblaetter/99-button-loesung.pdf)

 

Showing an information box on checkout_confirmation.php isnt a problem but:

Since it shoud only show up if the customers shipping adress is Non-EU I need an if(customer is NON-EU)-clause.

Alternatively an if(total_tax>0)-clause should work either.

 

[Question]

I am searching a variable to make the show-up-information-box depend from shipping adress or total-tax that can be used within checkout_confirmation.php.

 

Any ideas?

 

Regards

heranke

 

Here is what I got (~/catalog/checkout_confirmation.php). Yes, there are XXX.

 

<?php
if (XXX){
echo '	 <tr>' .
 '	 <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">' .
 '		 <tr>' . "\n" .
 '		 <td>' . TEXT_ORDER_TAX_HINT . '</td>' . "\n" .
 '		 </tr>' . "\n" .	
 '	 </table></td>' .
 '	 </tr>';
}
?>

Recommended SEO Addons:

Most Important: Header Tags SEO - Ultimate SEO V 2.2d

Recommended Addons:

Also Purchased (AP) Preselection - Contribution 3294

Link to comment
Share on other sites

Zone for EU is implemented. No trouble with tax calcs.

 

Which variable do I have to use for check against zone? This is the point I need help.

 

[information] If the customers is within EU taxes are positiv and shown.

 

I looked at ot_tax.php, ot_total.php, order.php, order_total.php even checkout_process.php assuming it should be there. And I tried different variables with no success for now.

Recommended SEO Addons:

Most Important: Header Tags SEO - Ultimate SEO V 2.2d

Recommended Addons:

Also Purchased (AP) Preselection - Contribution 3294

Link to comment
Share on other sites

My own solution, to a similar problem, was to create a column called 'zone' in the countries table. Some of the entries, in the column, are 'EU' and some are not.

 

$query =

' SELECT zone
FROM ' . TABLE_COUNTRIES .
' WHERE countries_id = ' . $order->delivery['country']['id']
;
$result = mysql_query($query);

if ($result) {
$row = mysql_fetch_row($result);
}

 

So your

 

if (XXX){

 

is then

 

if ($row[0] != 'EU'){

 

For the archive, I don't believe that this law has been ratified in all EU countries. Or even in most of them.

Link to comment
Share on other sites

Thanx Chris for your reply.

 

At first sight this solution should do the job. I will have a try and report back.

 

Since all means should be on board with osc stock functions there should be a simpler solution.

 

I imagine there are to ways:

1. direct way: Looking for the country the customer is sitting. if(country!=EU){show info}

2. indirect way: Looking for the calculated taxes. Assuming it has positive value in case of EU, and zero value otherwise. if(taxes==0){show info}.

 

The first way should be preferred.

 

What I am wondering is, if i add some products to the cart and do the checkout until checkout_confirmation.php it shows the calculated taxes correctly.

 

checkout_confirmation.php shows

 

<?php
 if (MODULE_ORDER_TOTAL_INSTALLED) {
   echo $order_total_modules->output();
 }
?>

 

Since total values are encapsuled within output() I cant reach the variable for the tax. Is there a way to break it down again?

I am not that familiar with the totalling modules yet. I guess this is beeing calculated in ot_tax.php?

 

Is there a guide for the totalling mechanism?

 

For the archive: Implementing this for sure and be on the bright side.

Recommended SEO Addons:

Most Important: Header Tags SEO - Ultimate SEO V 2.2d

Recommended Addons:

Also Purchased (AP) Preselection - Contribution 3294

Link to comment
Share on other sites

Ok, found $order->info['tax'] is showing the amount of taxes.

 

And the following code works so far:

 

 if ($order->info['tax']==0){
  echo '	 <tr>' .
 '	    <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">' .  
 '		  <tr>' . "\n" .
 '		    <td>' . TEXT_ORDER_TAX_HINT . '</td>' . "\n" .
 '		  </tr>' . "\n" .	
 '	    </table></td>' .
 '	  </tr>';
 }

 

Any ideas to achieve this by the 1st preferred way?

 

Regards

heranke

Recommended SEO Addons:

Most Important: Header Tags SEO - Ultimate SEO V 2.2d

Recommended Addons:

Also Purchased (AP) Preselection - Contribution 3294

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...