// fix validation rules

This commit is contained in:
Rémi Gaillard
2013-07-17 11:43:54 +02:00
parent 22f1cd70f1
commit b41c724e97
2 changed files with 22 additions and 1 deletions
+17
View File
@@ -463,6 +463,23 @@ class CarrierCore extends ObjectModel
return $carriers;
}
public static function getIdTaxRulesGroupMostUsed()
{
return Db::getInstance()->getValue('
SELECT id_tax_rules_group
FROM (
SELECT COUNT(*) n, carrier_shop.id_tax_rules_group
FROM '._DB_PREFIX_.'carrier c
'.Shop::addSqlAssociation('carrier', 'c').'
JOIN '._DB_PREFIX_.'tax_rules_group trg ON (carrier_shop.id_tax_rules_group = trg.id_tax_rules_group)
WHERE trg.active = 1
GROUP BY carrier.id_tax_rules_group
ORDER BY n DESC
LIMIT 1
) most_used'
);
}
public static function getDeliveredCountries($id_lang, $active_countries = false, $active_carriers = false, $contain_states = null)
{
@@ -672,7 +672,11 @@ class AdminCarrierWizardControllerCore extends AdminController
if (Shop::isFeatureActive())
{
$multistore_field = array(array('shop'));
array_splice($step_fields, 1, 0, $multistore_field);
$tmp = $step_fields;
$step_fields = array(1 => $tmp[1]) + $multistore_field;
array_shift($tmp);
foreach ($tmp as $row)
$step_field[] = $row;
}
$rules = array();