heranke Posted July 8, 2013 Posted July 8, 2013 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>'; } ?> Quote Recommended SEO Addons: Most Important: Header Tags SEO - Ultimate SEO V 2.2d Recommended Addons: Also Purchased (AP) Preselection - Contribution 3294
multimixer Posted July 8, 2013 Posted July 8, 2013 Create a zone, add all EU countries to it and check against this zone Quote My community profile | Template system for osCommerce - New: Responsive | Feedback channel
heranke Posted July 8, 2013 Author Posted July 8, 2013 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. Quote Recommended SEO Addons: Most Important: Header Tags SEO - Ultimate SEO V 2.2d Recommended Addons: Also Purchased (AP) Preselection - Contribution 3294
Chris H Posted July 9, 2013 Posted July 9, 2013 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. Quote
heranke Posted July 10, 2013 Author Posted July 10, 2013 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. Quote Recommended SEO Addons: Most Important: Header Tags SEO - Ultimate SEO V 2.2d Recommended Addons: Also Purchased (AP) Preselection - Contribution 3294
heranke Posted July 10, 2013 Author Posted July 10, 2013 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 Quote Recommended SEO Addons: Most Important: Header Tags SEO - Ultimate SEO V 2.2d Recommended Addons: Also Purchased (AP) Preselection - Contribution 3294
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.