Jump to content
Sign in to follow this  
heranke

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

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×