diff --git a/README.md b/README.md index 33480d1..bd42dfe 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ To display delivery times, you must edit your template with: ## Copyright and Credits -- Current version: 3.0.0 (02/02/2023) +- Current version: 3.1.0 (03/02/2023) - Compatibility: OpenMage 19.x / 20.x / 21.x, PHP 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 - Client compatibility: Firefox 36+, Chrome 32+, Opera 19+, Edge 16+, Safari 9+ - Translations: English (en), French (fr-FR/fr-CA), German (de), Italian (it), Portuguese (pt-PT/pt-BR), Spanish (es) / Chinese (zh), Czech (cs), Dutch (nl), Greek (el), Hungarian (hu), Japanese (ja), Polish (pl), Romanian (ro), Russian (ru), Slovak (sk), Turkish (tr), Ukrainian (uk) diff --git a/src/app/code/community/Kyrena/Shippingmax/Block/Adminhtml/Config/Delay.php b/src/app/code/community/Kyrena/Shippingmax/Block/Adminhtml/Config/Delay.php index 5e33c45..a68eb92 100644 --- a/src/app/code/community/Kyrena/Shippingmax/Block/Adminhtml/Config/Delay.php +++ b/src/app/code/community/Kyrena/Shippingmax/Block/Adminhtml/Config/Delay.php @@ -1,7 +1,7 @@ * Copyright 2019-2022 | Jérôme Siau @@ -280,22 +280,23 @@ protected function getArrayData(object $rate, int $storeId, string $country, $po $key = empty($key) ? $code : $code.$key; $price = $this->getCarrierPrice($rate, $storeId); + $config = @unserialize(Mage::getStoreConfig('shippingmax_times/'.$country.'/config', $storeId), ['allowed_classes' => false]); return [ 'code' => $code, 'name' => ($rate->getData('carrier_title') != $rate->getData('method_title')) ? $rate->getData('carrier_title').' / '.$rate->getData('method_title') : $rate->getData('carrier_title'), 'country' => $country, 'postcode' => $postcode, - 'name1min' => 'groups['.$country.'][fields][cnf1min_'.$key.'][value]', - 'name1max' => 'groups['.$country.'][fields][cnf1max_'.$key.'][value]', - 'name2min' => 'groups['.$country.'][fields][cnf2min_'.$key.'][value]', - 'name2max' => 'groups['.$country.'][fields][cnf2max_'.$key.'][value]', - 'name3' => 'groups['.$country.'][fields][cnf3_'.$key.'][value]', - 'cnf1min' => Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf1min_'.$key, $storeId), - 'cnf1max' => Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf1max_'.$key, $storeId), - 'cnf2min' => Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf2min_'.$key, $storeId), - 'cnf2max' => Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf2max_'.$key, $storeId), - 'cnf3' => Mage::getStoreConfigFlag('shippingmax_times/'.$country.'/cnf3_'.$key, $storeId), + 'name1min' => 'groups['.$country.'][fields][config][value][cnf1min_'.$key.']', + 'name1max' => 'groups['.$country.'][fields][config][value][cnf1max_'.$key.']', + 'name2min' => 'groups['.$country.'][fields][config][value][cnf2min_'.$key.']', + 'name2max' => 'groups['.$country.'][fields][config][value][cnf2max_'.$key.']', + 'name3' => 'groups['.$country.'][fields][config][value][cnf3_'.$key.']', + 'cnf1min' => $config['cnf1min_'.$key] ?? '', + 'cnf1max' => $config['cnf1max_'.$key] ?? '', + 'cnf2min' => $config['cnf2min_'.$key] ?? '', + 'cnf2max' => $config['cnf2max_'.$key] ?? '', + 'cnf3' => $config['cnf3_'.$key] ?? '', 'price' => [$price => $price], ]; } diff --git a/src/app/code/community/Kyrena/Shippingmax/Helper/Data.php b/src/app/code/community/Kyrena/Shippingmax/Helper/Data.php index 625b53d..2c56793 100644 --- a/src/app/code/community/Kyrena/Shippingmax/Helper/Data.php +++ b/src/app/code/community/Kyrena/Shippingmax/Helper/Data.php @@ -1,7 +1,7 @@ * Copyright 2019-2022 | Jérôme Siau @@ -173,6 +173,7 @@ public function getShippingDate(string $code, bool $days = false, $country = nul $fake = Mage::getModel('customer/address')->setData('country_id', $country)->setData('postcode', $postcode); $country = Mage::getBlockSingleton('shippingmax/rewrite_renderer')->render($fake, 'country'); $storeId = is_null($storeId) ? Mage::app()->getStore()->getId() : $storeId; + $config = @unserialize(Mage::getStoreConfig('shippingmax_times/'.$country.'/config', $storeId), ['allowed_classes' => false]); // recherche des délais // pour shippingmax_chronorelais_cyz_xyz puis pour shippingmax_chronorelais_xyz @@ -181,11 +182,11 @@ public function getShippingDate(string $code, bool $days = false, $country = nul if (empty($postcode)) { // délai sans postcode $key = $rateCode; - $cnf1min = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf1min_'.$key, $storeId); - $cnf1max = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf1max_'.$key, $storeId); - $cnf2min = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf2min_'.$key, $storeId); - $cnf2max = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf2max_'.$key, $storeId); - $cnf3 = Mage::getStoreConfigFlag('shippingmax_times/'.$country.'/cnf3_'.$key, $storeId); + $cnf1min = (int) ($config['cnf1min_'.$key] ?? 0); + $cnf1max = (int) ($config['cnf1max_'.$key] ?? 0); + $cnf2min = (int) ($config['cnf2min_'.$key] ?? 0); + $cnf2max = (int) ($config['cnf2max_'.$key] ?? 0); + $cnf3 = $config['cnf3_'.$key] ?? false; if (!empty($cnf2min)) break; } @@ -194,22 +195,22 @@ public function getShippingDate(string $code, bool $days = false, $country = nul while (--$nb >= 2) { // délai avec postcode $key = $rateCode.'_'.mb_substr(trim($postcode), 0, $nb); - $cnf1min = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf1min_'.$key, $storeId); - $cnf1max = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf1max_'.$key, $storeId); - $cnf2min = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf2min_'.$key, $storeId); - $cnf2max = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf2max_'.$key, $storeId); - $cnf3 = Mage::getStoreConfigFlag('shippingmax_times/'.$country.'/cnf3_'.$key, $storeId); + $cnf1min = (int) ($config['cnf1min_'.$key] ?? 0); + $cnf1max = (int) ($config['cnf1max_'.$key] ?? 0); + $cnf2min = (int) ($config['cnf2min_'.$key] ?? 0); + $cnf2max = (int) ($config['cnf2max_'.$key] ?? 0); + $cnf3 = $config['cnf3_'.$key] ?? false; if (!empty($cnf2min)) break 2; } if (empty($cnf2min)) { // délai sans postcode $key = $rateCode; - $cnf1min = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf1min_'.$key, $storeId); - $cnf1max = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf1max_'.$key, $storeId); - $cnf2min = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf2min_'.$key, $storeId); - $cnf2max = (int) Mage::getStoreConfig('shippingmax_times/'.$country.'/cnf2max_'.$key, $storeId); - $cnf3 = Mage::getStoreConfigFlag('shippingmax_times/'.$country.'/cnf3_'.$key, $storeId); + $cnf1min = (int) ($config['cnf1min_'.$key] ?? 0); + $cnf1max = (int) ($config['cnf1max_'.$key] ?? 0); + $cnf2min = (int) ($config['cnf2min_'.$key] ?? 0); + $cnf2max = (int) ($config['cnf2max_'.$key] ?? 0); + $cnf3 = $config['cnf3_'.$key] ?? false; if (!empty($cnf2min)) break; } diff --git a/src/app/code/community/Kyrena/Shippingmax/etc/config.xml b/src/app/code/community/Kyrena/Shippingmax/etc/config.xml index cf45760..a7d6dad 100644 --- a/src/app/code/community/Kyrena/Shippingmax/etc/config.xml +++ b/src/app/code/community/Kyrena/Shippingmax/etc/config.xml @@ -1,7 +1,7 @@ shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + +
shippingmax/adminhtml_config_delay 1 0 0 - 1 -
+ + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + +
shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - - - shippingmax/adminhtml_config_delay - 1 - 0 - 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + + + shippingmax/adminhtml_config_delay + 1 + 0 + 0 + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + +
shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + +
  • shippingmax/adminhtml_config_delay 1 0 0 - 1 -
  • + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + shippingmax/adminhtml_config_delay 1 0 0 - 1 - + + + adminhtml/system_config_backend_serialized_array + 1 + 0 + 0 + + + diff --git a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/install-2.7.0.php b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/install-3.1.0.php similarity index 97% rename from src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/install-2.7.0.php rename to src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/install-3.1.0.php index 2e256a6..dbe6808 100644 --- a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/install-2.7.0.php +++ b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/install-3.1.0.php @@ -1,7 +1,7 @@ * Copyright 2019-2022 | Jérôme Siau @@ -55,6 +55,7 @@ customer_id int(10) unsigned NOT NULL, details text NOT NULL, PRIMARY KEY (order_id), + INDEX `customer_id` (`customer_id`), FOREIGN KEY (order_id) REFERENCES '.$this->getTable('sales_flat_order').' (entity_id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; '); diff --git a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.0.0-2.1.0.php b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.0.0-2.1.0.php index 9bc8fc3..5615ece 100644 --- a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.0.0-2.1.0.php +++ b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.0.0-2.1.0.php @@ -1,7 +1,7 @@ * Copyright 2019-2022 | Jérôme Siau @@ -31,8 +31,8 @@ set_time_limit(0); try { - $this->run('DELETE FROM '.$this->getTable('shippingmax_coords').' WHERE country_id IN ("KZ","RU");'); - $this->run('DELETE FROM '.$this->getTable('shippingmax_coords').' WHERE country_id IN ("FR","MC") AND postcode LIKE "98000";'); + $this->run('DELETE FROM '.$this->getTable('shippingmax_coords').' WHERE country_id IN ("KZ","RU")'); + $this->run('DELETE FROM '.$this->getTable('shippingmax_coords').' WHERE country_id IN ("FR","MC") AND postcode LIKE "98000"'); } catch (Throwable $t) { $lock->unlock(); diff --git a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.1.0-2.2.0.php b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.1.0-2.2.0.php index a1bb3f5..f17b4de 100644 --- a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.1.0-2.2.0.php +++ b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.1.0-2.2.0.php @@ -1,7 +1,7 @@ * Copyright 2019-2022 | Jérôme Siau @@ -35,7 +35,7 @@ if (empty($config->getData('value'))) $this->run('TRUNCATE '.$this->getTable('shippingmax_coords')); else - $this->run('DELETE FROM '.$this->getTable('shippingmax_coords').' WHERE country_id NOT IN ("KZ","RU");'); + $this->run('DELETE FROM '.$this->getTable('shippingmax_coords').' WHERE country_id NOT IN ("KZ","RU")'); } catch (Throwable $t) { $lock->unlock(); diff --git a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.2.1-2.3.0.php b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.2.1-2.3.0.php index dc52796..8259274 100644 --- a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.2.1-2.3.0.php +++ b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.2.1-2.3.0.php @@ -1,7 +1,7 @@ * Copyright 2019-2022 | Jérôme Siau @@ -31,7 +31,7 @@ set_time_limit(0); try { - $this->run('DELETE FROM '.$this->getTable('shippingmax_coords').' WHERE country_id = "FR" AND postcode IN ("75000", "75001", "75002", "75003", "75004", "75005", "75006", "75007", "75008", "75009", "75010", "75011", "75012", "75013", "75014", "75015", "75016", "75116", "75017", "75018", "75019", "75020", "13000", "13001", "13002", "13003", "13004", "13005", "13006", "13007", "13008", "13009", "13010", "13011", "13012", "13013", "13014", "13015", "13016", "69000", "69001", "69002", "69003", "69004", "69005", "69006", "69007", "69008", "69009");'); + $this->run('DELETE FROM '.$this->getTable('shippingmax_coords').' WHERE country_id = "FR" AND postcode IN ("75000", "75001", "75002", "75003", "75004", "75005", "75006", "75007", "75008", "75009", "75010", "75011", "75012", "75013", "75014", "75015", "75016", "75116", "75017", "75018", "75019", "75020", "13000", "13001", "13002", "13003", "13004", "13005", "13006", "13007", "13008", "13009", "13010", "13011", "13012", "13013", "13014", "13015", "13016", "69000", "69001", "69002", "69003", "69004", "69005", "69006", "69007", "69008", "69009")'); $table = $this->getTable('shippingmax_coords'); if (!$this->getConnection()->tableColumnExists($table, 'updated_at')) diff --git a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.7.0-3.0.0.php b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.7.0-3.0.0.php index 77ad5d7..685dcc8 100644 --- a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.7.0-3.0.0.php +++ b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-2.7.0-3.0.0.php @@ -1,7 +1,7 @@ * Copyright 2019-2022 | Jérôme Siau @@ -31,12 +31,14 @@ set_time_limit(0); try { - $this->run('DELETE FROM '.$this->getTable('core_config_data').' WHERE path LIKE "carriers/shippingmax%/mix_%";'); - $this->run('ALTER TABLE '.$this->getTable('shippingmax_order_details').' ADD INDEX `customer_id` (`customer_id`);'); + $this->run('DELETE FROM '.$this->getTable('core_config_data').' WHERE path LIKE "carriers/shippingmax%/mix_%"'); + $this->run('ALTER TABLE '.$this->getTable('shippingmax_order_details').' ADD INDEX `customer_id` (`customer_id`)'); } catch (Throwable $t) { - $lock->unlock(); - Mage::throwException($t); + if (stripos($t->getMessage(), 'Duplicate key name') === false) { + $lock->unlock(); + Mage::throwException($t); + } } $this->endSetup(); diff --git a/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-3.0.0-3.1.0.php b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-3.0.0-3.1.0.php new file mode 100644 index 0000000..576658d --- /dev/null +++ b/src/app/code/community/Kyrena/Shippingmax/sql/shippingmax_setup/upgrade-3.0.0-3.1.0.php @@ -0,0 +1,61 @@ + + * Copyright 2019-2022 | Jérôme Siau + * https://github.com/kyrena/openmage-shippingmax + * + * This program is free software, you can redistribute it or modify + * it under the terms of the GNU General Public License (GPL) as published + * by the free software foundation, either version 2 of the license, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but without any warranty, without even the implied warranty of + * merchantability or fitness for a particular purpose. See the + * GNU General Public License (GPL) for more details. + */ + +// prevent multiple execution +$lock = Mage::getModel('index/process')->setId('shippingmax_setup'); +if ($lock->isLocked()) + Mage::throwException('Please wait, upgrade is already in progress...'); + +$lock->lockAndBlock(); +$this->startSetup(); + +// ignore user abort and time limit +ignore_user_abort(true); +set_time_limit(0); + +try { + $values = $this->_conn->fetchAll('SELECT path, value FROM '.$this->getTable('core_config_data').' WHERE path LIKE "shippingmax_times/%/cnf%"'); + $config = []; + + foreach ($values as $value) { + + $code = substr($value['path'], strlen('shippingmax_times/'), 2); + $key = substr($value['path'], strlen('shippingmax_times/') + 3); + + if (strtolower($code) == $code) + continue; + + $config[$code][$key] = (string) $value['value']; + } + + foreach ($config as $code => $values) { + $this->setConfigData('shippingmax_times/'.$code.'/config', serialize($values)); + } + + $this->run('DELETE FROM '.$this->getTable('core_config_data').' WHERE path LIKE "shippingmax_times/%/cnf%"'); + Mage::getConfig()->reinit(); +} +catch (Throwable $t) { + $lock->unlock(); + Mage::throwException($t); +} + +$this->endSetup(); +$lock->unlock(); \ No newline at end of file diff --git a/src/app/code/community/Owebia/Shipping2/Model/ConfigParser.php b/src/app/code/community/Owebia/Shipping2/Model/ConfigParser.php index ca51834..d6a8340 100644 --- a/src/app/code/community/Owebia/Shipping2/Model/ConfigParser.php +++ b/src/app/code/community/Owebia/Shipping2/Model/ConfigParser.php @@ -14,7 +14,7 @@ class Owebia_Shipping2_Model_ConfigParser public const COUPLE_REGEX = '(?:[0-9.]+|\*) *(?:\[|\])? *\: *[0-9.]+'; protected $_constants; - protected $_currencyCodes; + protected static $_currencyCodes = []; protected $_propertiesSort; public static $debugIndexCounter = 0; @@ -1940,12 +1940,16 @@ public function cleanProperty(&$row, $key) protected function addCurrencyCodesForFeesAndConditions($array) { - if (empty($this->currencyCodes)) - $this->_currencyCodes = Mage::getSingleton('core/locale_config')->getAllowedCurrencies(); + if (empty(self::$_currencyCodes)) { + $codes = Mage::getSingleton('core/locale_config')->getAllowedCurrencies(); + foreach ($codes as $code) { + self::$_currencyCodes[] = strtolower($code); + } + } - foreach ($this->_currencyCodes as $code) { - $array[] = 'fees_'.strtolower($code); - $array[] = 'conditions_'.strtolower($code); + foreach (self::$_currencyCodes as $code) { + $array[] = 'fees_'.$code; + $array[] = 'conditions_'.$code; } return $array; diff --git a/src/app/code/community/Owebia/Shipping2/changes.diff b/src/app/code/community/Owebia/Shipping2/changes.diff index 42b91ed..33ed020 100644 --- a/src/app/code/community/Owebia/Shipping2/changes.diff +++ b/src/app/code/community/Owebia/Shipping2/changes.diff @@ -192,7 +192,7 @@ diff -r -u -w Shipping2/Model/ConfigParser.php Shipping2/Model/ConfigParser.php + public const COUPLE_REGEX = '(?:[0-9.]+|\*) *(?:\[|\])? *\: *[0-9.]+'; + protected $_constants; -+ protected $_currencyCodes; ++ protected static $_currencyCodes = []; + protected $_propertiesSort; public static $debugIndexCounter = 0; @@ -848,19 +848,23 @@ diff -r -u -w Shipping2/Model/ConfigParser.php Shipping2/Model/ConfigParser.php public function cleanProperty(&$row, $key) { $input = $row[$key]['value']; -@@ -1998,4 +1937,17 @@ class Owebia_Shipping2_Model_ConfigParser +@@ -1998,4 +1937,21 @@ class Owebia_Shipping2_Model_ConfigParser } $row[$key]['value'] = $input; } + + protected function addCurrencyCodesForFeesAndConditions($array) + { -+ if (empty($this->currencyCodes)) -+ $this->_currencyCodes = Mage::getSingleton('core/locale_config')->getAllowedCurrencies(); ++ if (empty(self::$_currencyCodes)) { ++ $codes = Mage::getSingleton('core/locale_config')->getAllowedCurrencies(); ++ foreach ($codes as $code) { ++ self::$_currencyCodes[] = strtolower($code); ++ } ++ } + -+ foreach ($this->_currencyCodes as $code) { -+ $array[] = 'fees_'.strtolower($code); -+ $array[] = 'conditions_'.strtolower($code); ++ foreach (self::$_currencyCodes as $code) { ++ $array[] = 'fees_'.$code; ++ $array[] = 'conditions_'.$code; + } + + return $array;