// comment
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8690 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
56c570e4b8
commit
5bc5979e2d
1 file changed
+11
-17
+11
-17
@@ -52,13 +52,13 @@ class TaxRuleCore extends ObjectModel
|
|||||||
public function getFields()
|
public function getFields()
|
||||||
{
|
{
|
||||||
$this->validateFields();
|
$this->validateFields();
|
||||||
$fields['id_tax_rules_group'] = (int)($this->id_tax_rules_group);
|
$fields['id_tax_rules_group'] = (int)$this->id_tax_rules_group;
|
||||||
$fields['id_country'] = (int)$this->id_country;
|
$fields['id_country'] = (int)$this->id_country;
|
||||||
$fields['id_state'] = (int)$this->id_state;
|
$fields['id_state'] = (int)$this->id_state;
|
||||||
$fields['zipcode_from'] = (int)$this->zipcode_from;
|
$fields['zipcode_from'] = (int)$this->zipcode_from;
|
||||||
$fields['zipcode_to'] = (int)$this->zipcode_to;
|
$fields['zipcode_to'] = (int)$this->zipcode_to;
|
||||||
$fields['behavior'] = (int)$this->behavior;
|
$fields['behavior'] = (int)$this->behavior;
|
||||||
$fields['id_tax'] = (int)($this->id_tax);
|
$fields['id_tax'] = (int)$this->id_tax;
|
||||||
$fields['description'] = $this->description;
|
$fields['description'] = $this->description;
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
@@ -81,18 +81,6 @@ class TaxRuleCore extends ObjectModel
|
|||||||
SELECT * FROM `'._DB_PREFIX_.'tax_rule`
|
SELECT * FROM `'._DB_PREFIX_.'tax_rule`
|
||||||
WHERE `id_tax_rule` = '.(int)$id_tax_rule);
|
WHERE `id_tax_rule` = '.(int)$id_tax_rule);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
public static function getTaxRulesByGroupId($id_group)
|
|
||||||
{
|
|
||||||
if (empty($id_group))
|
|
||||||
die(Tools::displayError());
|
|
||||||
|
|
||||||
return Db::getInstance()->ExecuteS('
|
|
||||||
SELECT *
|
|
||||||
FROM `'._DB_PREFIX_.'tax_rule`
|
|
||||||
WHERE `id_tax_rules_group` = '.(int)$id_group
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public static function getTaxRulesByGroupId($id_lang, $id_group)
|
public static function getTaxRulesByGroupId($id_lang, $id_group)
|
||||||
{
|
{
|
||||||
@@ -151,7 +139,7 @@ class TaxRuleCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
$zip_codes = preg_split('/-/', $zip_codes);
|
$zip_codes = preg_split('/-/', $zip_codes);
|
||||||
|
|
||||||
if (sizeof($zip_codes) == 2)
|
if (count($zip_codes) == 2)
|
||||||
{
|
{
|
||||||
$from = $zip_codes[0];
|
$from = $zip_codes[0];
|
||||||
$to = $zip_codes[1];
|
$to = $zip_codes[1];
|
||||||
@@ -160,13 +148,13 @@ class TaxRuleCore extends ObjectModel
|
|||||||
$from = $zip_codes[1];
|
$from = $zip_codes[1];
|
||||||
$to = $zip_codes[0];
|
$to = $zip_codes[0];
|
||||||
}
|
}
|
||||||
elseif ($zip_codes[0] == $zip_codes[1])
|
else if ($zip_codes[0] == $zip_codes[1])
|
||||||
{
|
{
|
||||||
$from = $zip_codes[0];
|
$from = $zip_codes[0];
|
||||||
$to = 0;
|
$to = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (sizeof($zip_codes) == 1)
|
else if (count($zip_codes) == 1)
|
||||||
{
|
{
|
||||||
$from = $zip_codes[0];
|
$from = $zip_codes[0];
|
||||||
$to = 0;
|
$to = 0;
|
||||||
@@ -175,6 +163,12 @@ class TaxRuleCore extends ObjectModel
|
|||||||
return array($from, $to);
|
return array($from, $to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace a tax_rule id by an other one in the tax_rule table
|
||||||
|
*
|
||||||
|
* @param int $old_id
|
||||||
|
* @param int $new_id
|
||||||
|
*/
|
||||||
public static function swapTaxId($old_id, $new_id)
|
public static function swapTaxId($old_id, $new_id)
|
||||||
{
|
{
|
||||||
return Db::getInstance()->Execute('
|
return Db::getInstance()->Execute('
|
||||||
|
|||||||
Reference in new issue
Block a user