Title: [Plugin: Zingiri Web Shop] Bugfix patch for tax code
Last modified: August 20, 2016

---

# [Plugin: Zingiri Web Shop] Bugfix patch for tax code

 *  Resolved [Robert Heller](https://wordpress.org/support/users/robertpheller/)
 * (@robertpheller)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-zingiri-web-shop-bugfix-patch-for-tax-code/)
 * I found a couple of bugs in the tax handling code (in file zingiri-web-shop/fws/
   classes/tax.class.php)
 * 1) At line 18, there is a test to check if `$this->taxByCategory[$category]` 
   is set — this test is not needed and messes things up later in the code.
 * 2) At line 101, the customer’s country is fetched. This is later compared to 
   the tax country. The problem is, the country in the customer is stored as the
   2-3 letter ISO name and the country in the tax database is stored as the full
   English name. I added code to look up the proper full english name so that the
   compare later will work correctly.
 * Here is the patch:
 *     ```
       diff -c -r zingiri-web-shop/fws/classes/tax.class.php /var/www/trainstore/wordpress/wp-content/plugins/zingiri-web-shop/fws/classes/tax.class.php
       *** zingiri-web-shop/fws/classes/tax.class.php	2012-06-30 06:55:28.000000000 -0400
       --- /var/www/trainstore/wordpress/wp-content/plugins/zingiri-web-shop/fws/classes/tax.class.php	2012-07-23 14:04:05.000000000 -0400
       ***************
       *** 15,21 ****
         		global $dbtablesprefix,$no_vat,$db_prices_including_vat;
   
         		$taxtot=0;
       ! 		if (!isset($this->taxByCategory[$category])) $this->taxByCategory[$category]=array(); 
   
         		if ($no_vat == 1) {
         			$in_vat = $price;
       --- 15,21 ----
         		global $dbtablesprefix,$no_vat,$db_prices_including_vat;
   
         		$taxtot=0;
       ! 		//if (!isset($this->taxByCategory[$category])) $this->taxByCategory[$category]=array(); 
   
         		if ($no_vat == 1) {
         			$in_vat = $price;
       ***************
       *** 99,104 ****
       --- 99,109 ----
         			$state="";
         		} else {
         			$country=$customer->data['COUNTRY'];
       + 			$country_q = "select <code>NAME_EN</code> from <code>&quot;.$dbtablesprefix.&quot;country</code> WHERE <code>ISO</code>='".$country."' LIMIT 1";
       + 			$sql_country = mysql_query($country_q) or die(mysql_error());
       + 			if ($c_country = mysql_fetch_array($sql_country)) {
       + 				$country = $c_country['NAME_EN'];
       + 			}
         			$state=$customer->data['STATE'];
         		}
       ```
   
 * [http://wordpress.org/extend/plugins/zingiri-web-shop/](http://wordpress.org/extend/plugins/zingiri-web-shop/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [zingiri](https://wordpress.org/support/users/zingiri/)
 * (@zingiri)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-zingiri-web-shop-bugfix-patch-for-tax-code/#post-2914707)
 * Thanks will get it fixed ASAP.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Zingiri Web Shop] Bugfix patch for tax code’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/zingiri-web-shop_1e1e1b.svg)
 * [Zingiri Web Shop](https://wordpress.org/plugins/zingiri-web-shop/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/zingiri-web-shop/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/zingiri-web-shop/)
 * [Active Topics](https://wordpress.org/support/plugin/zingiri-web-shop/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/zingiri-web-shop/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/zingiri-web-shop/reviews/)

## Tags

 * [bugfix](https://wordpress.org/support/topic-tag/bugfix/)
 * [sales tax](https://wordpress.org/support/topic-tag/sales-tax/)
 * [tax](https://wordpress.org/support/topic-tag/tax/)

 * 1 reply
 * 2 participants
 * Last reply from: [zingiri](https://wordpress.org/support/users/zingiri/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-zingiri-web-shop-bugfix-patch-for-tax-code/#post-2914707)
 * Status: resolved