diff --git a/Models/Agency.php b/Models/Agency.php index 70f1219bc..c2d10ddc9 100755 --- a/Models/Agency.php +++ b/Models/Agency.php @@ -8,8 +8,6 @@ class Agency { const AGENCY_SELECTED_JADLOG_CENTRALIZED = 'melhorenvio_option_agency_jadlog_centralized'; - const AGENCY_SELECTED_CORREIOS_CENTRALIZED = 'melhorenvio_option_agency_correios_centralized'; - const AGENCY_SELECTED_LOGGI = 'melhorenvio_option_agency_loggi'; const AGENCY_SELECTED_JET = 'melhorenvio_option_agency_jet'; @@ -32,15 +30,6 @@ public function getJadlogCentralized() { return get_option( self::AGENCY_SELECTED_JADLOG_CENTRALIZED, null ); } - /** - * function to get the id of agency Correios centralized selected. - * - * @return array - */ - public function getCorreiosCentralized() { - return get_option( self::AGENCY_SELECTED_CORREIOS_CENTRALIZED, null ); - } - /** * function to get the id of agency Loggi selected. * @@ -86,19 +75,6 @@ public function setJadlogCentralized( $data ) { return true; } - /** - * @param array $data - * @return bool - */ - public function setCorreiosCentralized( $data ) { - delete_option( self::AGENCY_SELECTED_CORREIOS_CENTRALIZED ); - if ( ! add_option( self::AGENCY_SELECTED_CORREIOS_CENTRALIZED, $data ) ) { - return false; - } - - return true; - } - /** * @param array $data * @return bool diff --git a/Models/ShippingService.php b/Models/ShippingService.php index 55855ae02..05032ac76 100644 --- a/Models/ShippingService.php +++ b/Models/ShippingService.php @@ -4,7 +4,7 @@ class ShippingService { - const SERVICES_CORREIOS = array( 1, 2, 17, 28, 29, 30 ); + const SERVICES_CORREIOS = array( 1, 2, 17 ); const SERVICES_JADLOG = array( 3, 4, 27 ); @@ -14,12 +14,8 @@ class ShippingService { const CORREIOS_PAC = 1; - const CORREIOS_PAC_CENTRALIZED = 28; - const CORREIOS_SEDEX = 2; - const CORREIOS_SEDEX_CENTRALIZED = 29; - const JADLOG_PACKAGE = 3; const JADLOG_PACKAGE_CENTRALIZED = 27; @@ -36,8 +32,6 @@ class ShippingService { const CORREIOS_MINI = 17; - const CORREIOS_MINI_CENTRALIZED = 30; - const LOGGI_EXPRESS = 31; const LOGGI_COLETA = 32; @@ -86,12 +80,8 @@ public static function getCodeByMethodId( $methodId ) { switch ( $methodId ) { case 'melhorenvio_correios_pac': return self::CORREIOS_PAC; - case 'melhorenvio_correios_pac_centralized': - return self::CORREIOS_PAC_CENTRALIZED; case 'melhorenvio_correios_sedex': return self::CORREIOS_SEDEX; - case 'melhorenvio_correios_sedex_centralized': - return self::CORREIOS_SEDEX_CENTRALIZED; case 'melhorenvio_jadlog_package': return self::JADLOG_PACKAGE; case 'melhorenvio_jadlog_package_centralized': @@ -112,8 +102,6 @@ public static function getCodeByMethodId( $methodId ) { return self::AZUL_ECOMMERCE; case 'melhorenvio_correios_mini': return self::CORREIOS_MINI; - case 'melhorenvio_correios_mini_centralized': - return self::CORREIOS_MINI_CENTRALIZED; case 'melhorenvio_latam_juntos': return self::LATAM_JUNTOS; case 'melhorenvio_buslog_rodoviario': diff --git a/Models/Version.php b/Models/Version.php index c2fbde39d..87792e5c4 100755 --- a/Models/Version.php +++ b/Models/Version.php @@ -4,5 +4,5 @@ class Version { - const VERSION = '2.15.5'; + const VERSION = '2.15.6'; } diff --git a/Services/AgenciesSelectedService.php b/Services/AgenciesSelectedService.php index 8661d67a4..69a167feb 100644 --- a/Services/AgenciesSelectedService.php +++ b/Services/AgenciesSelectedService.php @@ -26,13 +26,6 @@ public function getJadlogCentralized() { return $this->agencyModel->getJadlogCentralized(); } - /** - * @return array - */ - public function getCorreiosCentralized() { - return $this->agencyModel->getCorreiosCentralized(); - } - /** * @return array */ @@ -71,24 +64,12 @@ public function setJadlogCentralized( $data ) { return $this->agencyModel->setJadlogCentralized( $data ); } - /** - * @param array $data - * @return bool - */ - public function setCorreiosCentralized( $data ) { - if ( empty( $data ) ) { - return true; - } - - return $this->agencyModel->setCorreiosCentralized( $data ); - } - /** * @param array $data * @return bool */ public function setLoggi( $data ) { - + if ( empty( $data ) ) { return true; } diff --git a/Services/CartService.php b/Services/CartService.php index a8a268739..152a28f34 100644 --- a/Services/CartService.php +++ b/Services/CartService.php @@ -143,14 +143,6 @@ private function getAgencyToInsertCart( $shippingMethodId ) { $agenciesSelectedService = new AgenciesSelectedService(); - if (in_array($shippingMethodId, [ - ShippingService::CORREIOS_SEDEX_CENTRALIZED, - ShippingService::CORREIOS_PAC_CENTRALIZED, - ShippingService::CORREIOS_MINI_CENTRALIZED]) - ) { - return $agenciesSelectedService->getCorreiosCentralized(); - } - if ((int) $shippingMethodId === ShippingService::JADLOG_PACKAGE_CENTRALIZED) { return $agenciesSelectedService->getJadlogCentralized(); } diff --git a/Services/ConfigurationsService.php b/Services/ConfigurationsService.php index c61988b26..f884ab830 100644 --- a/Services/ConfigurationsService.php +++ b/Services/ConfigurationsService.php @@ -75,10 +75,6 @@ public function saveConfigurations( $data ) { ( new AgenciesSelectedService() )->set( $response['agency'] ); } - if ( ! empty( $data['agency_correios_centralized'] ) ) { - ( new AgenciesSelectedService() )->setCorreiosCentralized( $data['agency_correios_centralized'] ); - } - if ( ! empty( $data['agency_jadlog_centralized'] ) ) { ( new AgenciesSelectedService() )->setJadlogCentralized( $data['agency_jadlog_centralized'] ); } @@ -140,8 +136,6 @@ public function getConfigurations() { $agenciesCentralizedsJadlog = array(); - $agenciesCentralizedsCorreios = array(); - $agenciesLoggi = array(); $agenciesSelecteds = array(); @@ -158,10 +152,6 @@ public function getConfigurations() { $address['company'] = ShippingCompany::JADLOG; $agenciesCentralizedsJadlog = ( new AgenciesService($address))->get(); - $address['serviceId'] = ShippingService::CORREIOS_SEDEX_CENTRALIZED; - $address['company'] = ShippingCompany::CORREIOS; - $agenciesCentralizedsCorreios = ( new AgenciesService($address))->get(); - $address['serviceId'] = ShippingService::LOGGI_EXPRESS; $address['company'] = ShippingCompany::LOGGI; $agenciesLoggi = ( new AgenciesService($address))->get(); @@ -170,7 +160,6 @@ public function getConfigurations() { $agenciesSelectedService = new AgenciesSelectedService(); $agenciesSelecteds = $agenciesSelectedService->get(); - $agencyCorreiosCentralizedSelected = $agenciesSelectedService->getCorreiosCentralized(); $agencyJadlogCentralizedSelected = $agenciesSelectedService->getJadlogCentralized(); $agencyLoggiSelected = $agenciesSelectedService->getLoggi(); @@ -182,7 +171,6 @@ public function getConfigurations() { ShippingCompany::JADLOG ), 'agenciesJadlogCentralized' => $agenciesCentralizedsJadlog, - 'agenciesCorreiosCentralized' => $agenciesCentralizedsCorreios, 'agenciesLoggi' => $agenciesLoggi, 'agenciesAzul' => $this->filterAgenciesByCompany( $agencies, @@ -205,7 +193,6 @@ public function getConfigurations() { ShippingCompany::JADLOG ), 'agencyJadlogCentralizedSelected' => $agencyJadlogCentralizedSelected, - 'agencyCorreiosCentralizedSelected' => $agencyCorreiosCentralizedSelected, 'agencyLoggiSelected' => $agencyLoggiSelected, 'agencyLatamSelected' => $this->filterAgencySelectedByCompany( $agenciesSelecteds, diff --git a/assets/src/admin/components/Configuracoes.vue b/assets/src/admin/components/Configuracoes.vue index 2a59f3f56..c3a00c6ce 100755 --- a/assets/src/admin/components/Configuracoes.vue +++ b/assets/src/admin/components/Configuracoes.vue @@ -299,39 +299,6 @@
- Escolha a agência correios centralizado de sua preferência para realizar o envio dos - seus produtos. -
-@@ -755,7 +722,6 @@ export default { canUpdate: true, origin: null, agency: null, - agency_correios_centralized: null, agency_jadlog_centralized: null, agency_loggi: null, agency_azul: null, @@ -766,7 +732,6 @@ export default { show_calculator: false, show_all_agencies_jadlog: false, show_all_agencies_azul: false, - show_all_agencies_correios_centralized: false, show_all_agencies_jadlog_centralized: false, show_all_agencies_loggi: false, options_calculator: { @@ -799,7 +764,6 @@ export default { label: "getLabel", dimension: "getDimension", agencySelected_: "getAgencySelected", - agencyCorreiosCentralizedSelected_: "getAgencyCorreiosCentralizedSelected", agencyJadlogCentralizedSelected_: "getAgencyJadlogCentralizedSelected", agencyLoggiSelected_: "getAgencyLoggiSelected", agencyAzulSelected_: "getAgencyAzulSelected", diff --git a/assets/src/admin/components/Pedido/Documentos.vue b/assets/src/admin/components/Pedido/Documentos.vue index b7b604db6..71b483b84 100644 --- a/assets/src/admin/components/Pedido/Documentos.vue +++ b/assets/src/admin/components/Pedido/Documentos.vue @@ -5,11 +5,8 @@ \ No newline at end of file + diff --git a/assets/src/admin/store/configuration.js b/assets/src/admin/store/configuration.js index b76564ef7..d3c1e60b7 100755 --- a/assets/src/admin/store/configuration.js +++ b/assets/src/admin/store/configuration.js @@ -25,14 +25,12 @@ const configuration = { weight: 1 }, agencies: [], - agenciesCorreiosCentralized: [], agenciesJadlogCentralized: [], agenciesLoggi: [], agenciesAzul: [], agenciesLatam: [], agenciesJeT: [], allAgencies: [], - allAgenciesCorreiosCentralized: [], allAgenciesJadlogCentralized: [], allAgenciesLoggi: [], allAgenciesAzul: [], @@ -49,7 +47,6 @@ const configuration = { }, where_calculator: 'woocommerce_after_add_to_cart_form', agencySelected: null, - agencyCorreiosCentralizedSelected: null, agencyJadlogCentralizedSelected: null, agencyLoggiSelected: null, agencyAzulSelected: null, @@ -85,9 +82,6 @@ const configuration = { setAgencyAzul: (state, data) => { state.agenciesAzul = data }, - setAgencyCorreiosCentralized: (state, data) => { - state.agenciesCorreiosCentralized = data - }, setAgencyJadlogCentralized: (state, data) => { state.agenciesJadlogCentralized = data }, @@ -106,9 +100,6 @@ const configuration = { setAgencyAzulSelected: (state, data) => { state.agencyAzulSelected = data }, - setAgencyCorreiosCentralizedSelected: (state, data) => { - state.agencyCorreiosCentralizedSelected = data - }, setAgencyJadlogCentralizedSelected: (state, data) => { state.agencyJadlogCentralizedSelected = data }, @@ -127,9 +118,6 @@ const configuration = { setAllAgencyAzul: (state, data) => { state.allAgenciesAzul = data }, - setAllAgencyCorreiosCentralized: (state, data) => { - state.allAgenciesCorreiosCentralized = data - }, setAllAgencyJadlogCentralized: (state, data) => { state.allAgenciesJadlogCentralized = data }, @@ -173,7 +161,6 @@ const configuration = { getDimension: state => state.dimension, getAgencies: state => state.agencies, getAgenciesAzul: state => state.agenciesAzul, - getAgenciesCorreiosCentralized: state => state.agenciesCorreiosCentralized, getAgenciesJadlogCentralized: state => state.agenciesJadlogCentralized, getAgenciesLoggi: state => state.agenciesLoggi, getAgenciesLatam: state => state.agenciesLatam, @@ -181,7 +168,6 @@ const configuration = { getAllAgencies: state => state.allAgencies, getAgencySelected: state => state.agencySelected, getAgencyAzulSelected: state => state.agencyAzulSelected, - getAgencyCorreiosCentralizedSelected: state => state.agencyCorreiosCentralizedSelected, getAgencyJadlogCentralizedSelected: state => state.agencyJadlogCentralizedSelected, getAgencyLoggiSelected: state => state.agencyLoggiSelected, getAgencyLatamSelected: state => state.agencyLatamSelected, @@ -231,11 +217,6 @@ const configuration = { commit('setAllAgencyAzul', response.data.allAgenciesAzul); } - if (response.data.agenciesCorreiosCentralized && !isNull(response.data.agenciesCorreiosCentralized)) { - commit('setAgencyCorreiosCentralized', response.data.agenciesCorreiosCentralized); - commit('setAllAgencyCorreiosCentralized', response.data.allAgenciesCorreiosCentralized); - } - if (response.data.agenciesJadlogCentralized && !isNull(response.data.agenciesJadlogCentralized)) { commit('setAgencyJadlogCentralized', response.data.agenciesJadlogCentralized); commit('setAllAgencyJadlogCentralized', response.data.allAgenciesJadlogCentralized); @@ -261,7 +242,6 @@ const configuration = { } commit('setAgencySelected', response.data.agencySelected) commit('setAgencyAzulSelected', response.data.agencyAzulSelected) - commit('setAgencyCorreiosCentralizedSelected', response.data.agencyCorreiosCentralizedSelected) commit('setAgencyJadlogCentralizedSelected', response.data.agencyJadlogCentralizedSelected) commit('setAgencyLoggiSelected', response.data.agencyLoggiSelected) commit('setAgencyLatamSelected', response.data.agencyLatamSelected) @@ -299,15 +279,6 @@ const configuration = { } }) }, - getAgenciesCorreiosCentralized: ({ commit }, data) => { - commit('toggleLoader', true); - Axios.post(`${ajaxurl}?action=get_agencies&city=${data.city}&state=${data.state}&serviceId=28&company=1`).then(function (response) { - commit('toggleLoader', false); - if (response && response.status === 200) { - commit('setAgencyCorreiosCentralized', response.data.agencies); - } - }) - }, getAgenciesJadlogCentralized: ({ commit }, data) => { commit('toggleLoader', true); Axios.post(`${ajaxurl}?action=get_agencies&city=${data.city}&state=${data.state}&serviceId=27&company=2`).then(function (response) { diff --git a/assets/src/admin/utils/shipping-services.js b/assets/src/admin/utils/shipping-services.js index 273e6dd80..be86dc419 100644 --- a/assets/src/admin/utils/shipping-services.js +++ b/assets/src/admin/utils/shipping-services.js @@ -1,8 +1,5 @@ const CORREIOS_PAC = 1; -const CORREIOS_PAC_CENTRALIZED = 28; const CORREIOS_SEDEX = 2; -const CORREIOS_MINI_CENTRALIZED = 30; -const CORREIOS_SEDEX_CENTRALIZED = 29; const JADLOG_PACKAGE = 3; const JADLOG_PACKAGE_CENTRALIZED = 27; const JADLOG_COM = 4; @@ -17,9 +14,7 @@ const BUSLOG_RODOVIARIO = 22; export default { CORREIOS_PAC, - CORREIOS_PAC_CENTRALIZED, CORREIOS_SEDEX, - CORREIOS_SEDEX_CENTRALIZED, JADLOG_PACKAGE, JADLOG_PACKAGE_CENTRALIZED, JADLOG_COM, @@ -30,6 +25,5 @@ export default { AZUL_AMANHA, AZUL_ECOMMERCE, CORREIOS_MINI, - CORREIOS_MINI_CENTRALIZED, BUSLOG_RODOVIARIO -}; \ No newline at end of file +}; diff --git a/melhor-envio-beta.php b/melhor-envio-beta.php index 36c53b535..2b9906871 100755 --- a/melhor-envio-beta.php +++ b/melhor-envio-beta.php @@ -3,7 +3,7 @@ Plugin Name: Melhor Envio Plugin URI: https://melhorenvio.com.br Description: Plugin para cotação e compra de fretes utilizando a API da Melhor Envio. -Version: 2.15.5 +Version: 2.15.6 Author: Melhor Envio Author URI: melhorenvio.com.br License: GPL2 @@ -281,9 +281,7 @@ public function init_hooks() add_filter('woocommerce_shipping_methods', function ($methods) { $methods['melhorenvio_correios_pac'] = 'WC_Melhor_Envio_Shipping_Correios_Pac'; - $methods['melhorenvio_correios_pac_centralized'] = 'WC_Melhor_Envio_Shipping_Correios_Pac_Centralized'; $methods['melhorenvio_correios_sedex'] = 'WC_Melhor_Envio_Shipping_Correios_Sedex'; - $methods['melhorenvio_correios_sedex_centralized'] = 'WC_Melhor_Envio_Shipping_Correios_Sedex_Centralized'; $methods['melhorenvio_jadlog_package'] = 'WC_Melhor_Envio_Shipping_Jadlog_Package'; $methods['melhorenvio_jadlog_package_centralized'] = 'WC_Melhor_Envio_Shipping_Jadlog_Package_Centralized'; $methods['melhorenvio_jadlog_com'] = 'WC_Melhor_Envio_Shipping_Jadlog_Com'; @@ -293,7 +291,6 @@ public function init_hooks() $methods['melhorenvio_azul_amanha'] = 'WC_Melhor_Envio_Shipping_Azul_Amanha'; $methods['melhorenvio_azul_ecommerce'] = 'WC_Melhor_Envio_Shipping_Azul_Ecommerce'; $methods['melhorenvio_correios_mini'] = 'WC_Melhor_Envio_Shipping_Correios_Mini'; - $methods['melhorenvio_correios_mini_centralized'] = 'WC_Melhor_Envio_Shipping_Correios_Mini_Centralized'; $methods['melhorenvio_buslog_rodoviario'] = 'WC_Melhor_Envio_Shipping_Buslog_Rodoviario'; $methods['melhorenvio_jet_standard'] = 'WC_Melhor_Envio_Shipping_JeT_Standard'; return $methods; diff --git a/readme.md b/readme.md index 5f1ab1a2d..c421075d6 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,9 @@ === Melhor Envio === -Version: 2.15.5 +Version: 2.15.6 Tags: frete, fretes, cotação, cotações, correios, envio, jadlog, latam latam cargo, azul, azul cargo express, melhor envio Requires at least: 4.7 Tested up to: 6.5 -Stable tag: 2.15.5 +Stable tag: 2.15.6 Requires PHP: 7.2+ Requires Wordpress 4.0+ Requires WooCommerce 4.0+ @@ -68,6 +68,9 @@ Observação: Atenção com as medidas de unidades utilizadas, cuidado se você Pronto! o plugin do Melhor Envio está funcionando. == Changelog == += 2.15.6 = +* Remove serviços centralizados dos Correios. + = 2.15.5 = * Corrige reatividade na adição dos dados de NF. diff --git a/services_methods/class-wc-melhor-envio-shipping-correios-mini-centralized.php b/services_methods/class-wc-melhor-envio-shipping-correios-mini-centralized.php deleted file mode 100644 index c6ee4c199..000000000 --- a/services_methods/class-wc-melhor-envio-shipping-correios-mini-centralized.php +++ /dev/null @@ -1,27 +0,0 @@ -id = self::ID; - $this->method_title = self::METHOD_TITLE; - parent::__construct( $instance_id ); - } - } -} diff --git a/services_methods/class-wc-melhor-envio-shipping-correios-pac-centralized.php b/services_methods/class-wc-melhor-envio-shipping-correios-pac-centralized.php deleted file mode 100644 index ccfa9a7bf..000000000 --- a/services_methods/class-wc-melhor-envio-shipping-correios-pac-centralized.php +++ /dev/null @@ -1,27 +0,0 @@ -id = self::ID; - $this->method_title = self::METHOD_TITLE; - parent::__construct( $instance_id ); - } - } -} diff --git a/services_methods/class-wc-melhor-envio-shipping-correios-sedex-centralized.php b/services_methods/class-wc-melhor-envio-shipping-correios-sedex-centralized.php deleted file mode 100644 index 28e44b05b..000000000 --- a/services_methods/class-wc-melhor-envio-shipping-correios-sedex-centralized.php +++ /dev/null @@ -1,27 +0,0 @@ -id = self::ID; - $this->method_title = self::METHOD_TITLE; - parent::__construct( $instance_id ); - } - } -}