Skip to content

Instantly share code, notes, and snippets.

@tranepura
Created April 21, 2015 05:28
Show Gist options
  • Select an option

  • Save tranepura/7d5ddbc416d016148f94 to your computer and use it in GitHub Desktop.

Select an option

Save tranepura/7d5ddbc416d016148f94 to your computer and use it in GitHub Desktop.
To remove global variable $tax_config from conn.php ticket #2129
<?php
/*
* Ticket #2129
* Remove Global Variable $tax_settings from conn.php
*
*/
class MainTaxSettings{
//Returns Tax rate by Country
function getTaxRateByCountry ($country){
$taxRates = array(
"default" => 0,
"australia" => 10,
"new_zealand" => 15,
"united_states" => 0,
"canada" => 0,
"united_kingdom" => 20,
"ireland" => 20,
"south_africa" => 14
);
$taxRate = "";
foreach ($taxRates as $key => $value) {
if ($key == $country) {
$taxRate = $value;
}
}
return $taxRate;
}
//returns a result set for sql query
private function fetchRowFromSql ($sql){
$result_select = mysql_query($sql);
if (mysql_num_rows($result_select)==0)
{
mysql_free_result($result_select);
return null;
}
else
{
$fetchedrow = mysql_fetch_row($result_select);
}
$returnresult = $fetchedrow;
return $returnresult;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment