Version Description
2018/05/11 =
Melhorado o comportamento quando login e senha para tabela de rastreamento esto incorretos.
Melhorada a descrio para opo de integrao com tabela de rastreamento.
Download this release
Release Info
| Developer | claudiosanches |
| Plugin | |
| Version | 3.7.1 |
| Comparing to | |
| See all releases | |
Code changes from version 3.7.0 to 3.7.1
includes/class-wc-correios-tracking-history.php
CHANGED
|
@@ -68,6 +68,7 @@ class WC_Correios_Tracking_History {
|
|
| 68 |
/**
|
| 69 |
* Access API Correios.
|
| 70 |
*
|
|
|
|
| 71 |
* @param array $tracking_codes Tracking codes.
|
| 72 |
* @return array
|
| 73 |
*/
|
|
@@ -112,6 +113,12 @@ class WC_Correios_Tracking_History {
|
|
| 112 |
// Handle single object.
|
| 113 |
$objects = array( $response->return->objeto );
|
| 114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
// Fix when return only last event.
|
| 116 |
if ( is_object( $objects[0]->evento ) ) {
|
| 117 |
$objects[0]->evento = array( $objects[0]->evento );
|
| 68 |
/**
|
| 69 |
* Access API Correios.
|
| 70 |
*
|
| 71 |
+
* @throws Exception When username or password fails.
|
| 72 |
* @param array $tracking_codes Tracking codes.
|
| 73 |
* @return array
|
| 74 |
*/
|
| 113 |
// Handle single object.
|
| 114 |
$objects = array( $response->return->objeto );
|
| 115 |
|
| 116 |
+
// Check for invalid username and passowrd.
|
| 117 |
+
if ( isset( $objects[0]->numero ) && 'Erro' === $objects[0]->numero ) {
|
| 118 |
+
$objects = null; // Reset values to disable tracking table.
|
| 119 |
+
throw new Exception( 'Invalid username or password!' );
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
// Fix when return only last event.
|
| 123 |
if ( is_object( $objects[0]->evento ) ) {
|
| 124 |
$objects[0]->evento = array( $objects[0]->evento );
|
includes/integrations/class-wc-correios-integration.php
CHANGED
|
@@ -73,7 +73,7 @@ class WC_Correios_Integration extends WC_Integration {
|
|
| 73 |
'tracking' => array(
|
| 74 |
'title' => __( 'Tracking History Table', 'woocommerce-correios' ),
|
| 75 |
'type' => 'title',
|
| 76 |
-
'description' => __( 'Displays a table with informations about the shipping in My Account > View Order page.', 'woocommerce-correios' ),
|
| 77 |
),
|
| 78 |
'tracking_enable' => array(
|
| 79 |
'title' => __( 'Enable/Disable', 'woocommerce-correios' ),
|
|
@@ -255,7 +255,7 @@ class WC_Correios_Integration extends WC_Integration {
|
|
| 255 |
* @return array
|
| 256 |
*/
|
| 257 |
public function setup_tracking_user_data( $user_data ) {
|
| 258 |
-
if (
|
| 259 |
$user_data = array(
|
| 260 |
'login' => $this->tracking_login,
|
| 261 |
'password' => $this->tracking_password,
|
| 73 |
'tracking' => array(
|
| 74 |
'title' => __( 'Tracking History Table', 'woocommerce-correios' ),
|
| 75 |
'type' => 'title',
|
| 76 |
+
'description' => __( 'Displays a table with informations about the shipping in My Account > View Order page. Required username and password that can be obtained with the Correios\' commercial area.', 'woocommerce-correios' ),
|
| 77 |
),
|
| 78 |
'tracking_enable' => array(
|
| 79 |
'title' => __( 'Enable/Disable', 'woocommerce-correios' ),
|
| 255 |
* @return array
|
| 256 |
*/
|
| 257 |
public function setup_tracking_user_data( $user_data ) {
|
| 258 |
+
if ( $this->tracking_login && $this->tracking_password ) {
|
| 259 |
$user_data = array(
|
| 260 |
'login' => $this->tracking_login,
|
| 261 |
'password' => $this->tracking_password,
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: https://claudiosanches.com/doacoes/
|
|
| 4 |
Tags: shipping, delivery, woocommerce, correios
|
| 5 |
Requires at least: 4.0
|
| 6 |
Tested up to: 4.9
|
| 7 |
-
Stable tag: 3.7.
|
| 8 |
Requires PHP: 5.6
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
@@ -204,6 +204,11 @@ Em caso de dúvidas, basta abrir um tópico no [fórum de suporte do plugin](htt
|
|
| 204 |
|
| 205 |
== Changelog ==
|
| 206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
= 3.7.0 - 2018/05/08 =
|
| 208 |
|
| 209 |
- Atualizados os valores do Impresso e Carta, mais detalhes em [#97](https://github.com/claudiosanches/woocommerce-correios/pull/97) e [#100](https://github.com/claudiosanches/woocommerce-correios/pull/100).
|
|
@@ -215,9 +220,11 @@ Em caso de dúvidas, basta abrir um tópico no [fórum de suporte do plugin](htt
|
|
| 215 |
|
| 216 |
== Upgrade Notice ==
|
| 217 |
|
| 218 |
-
= 3.7.
|
| 219 |
|
| 220 |
- Atualizados os valores do Impresso e Carta.
|
| 221 |
- Adicionada opção para peso extra nos métodos de Impresso e Carta.
|
| 222 |
- Adicionada opções para usar rastreamento com dados administrativos.
|
| 223 |
- Melhorado a exibição e salvamento da estimativa de entrega.
|
|
|
|
|
|
| 4 |
Tags: shipping, delivery, woocommerce, correios
|
| 5 |
Requires at least: 4.0
|
| 6 |
Tested up to: 4.9
|
| 7 |
+
Stable tag: 3.7.1
|
| 8 |
Requires PHP: 5.6
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 204 |
|
| 205 |
== Changelog ==
|
| 206 |
|
| 207 |
+
= 3.7.1 - 2018/05/11 =
|
| 208 |
+
|
| 209 |
+
- Melhorado o comportamento quando login e senha para tabela de rastreamento estão incorretos.
|
| 210 |
+
- Melhorada a descrição para opção de integração com tabela de rastreamento.
|
| 211 |
+
|
| 212 |
= 3.7.0 - 2018/05/08 =
|
| 213 |
|
| 214 |
- Atualizados os valores do Impresso e Carta, mais detalhes em [#97](https://github.com/claudiosanches/woocommerce-correios/pull/97) e [#100](https://github.com/claudiosanches/woocommerce-correios/pull/100).
|
| 220 |
|
| 221 |
== Upgrade Notice ==
|
| 222 |
|
| 223 |
+
= 3.7.1 =
|
| 224 |
|
| 225 |
- Atualizados os valores do Impresso e Carta.
|
| 226 |
- Adicionada opção para peso extra nos métodos de Impresso e Carta.
|
| 227 |
- Adicionada opções para usar rastreamento com dados administrativos.
|
| 228 |
- Melhorado a exibição e salvamento da estimativa de entrega.
|
| 229 |
+
- Melhorado o comportamento quando login e senha para tabela de rastreamento estão incorretos.
|
| 230 |
+
- Melhorada a descrição para opção de integração com tabela de rastreamento.
|
woocommerce-correios.php
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
* Description: Adds Correios shipping methods to your WooCommerce store.
|
| 6 |
* Author: Claudio Sanches
|
| 7 |
* Author URI: https://claudiosanches.com
|
| 8 |
-
* Version: 3.7.
|
| 9 |
* License: GPLv2 or later
|
| 10 |
* Text Domain: woocommerce-correios
|
| 11 |
* Domain Path: /languages
|
|
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 33 |
exit; // Exit if accessed directly.
|
| 34 |
}
|
| 35 |
|
| 36 |
-
define( 'WC_CORREIOS_VERSION', '3.7.
|
| 37 |
define( 'WC_CORREIOS_PLUGIN_FILE', __FILE__ );
|
| 38 |
|
| 39 |
if ( ! class_exists( 'WC_Correios' ) ) {
|
| 5 |
* Description: Adds Correios shipping methods to your WooCommerce store.
|
| 6 |
* Author: Claudio Sanches
|
| 7 |
* Author URI: https://claudiosanches.com
|
| 8 |
+
* Version: 3.7.1
|
| 9 |
* License: GPLv2 or later
|
| 10 |
* Text Domain: woocommerce-correios
|
| 11 |
* Domain Path: /languages
|
| 33 |
exit; // Exit if accessed directly.
|
| 34 |
}
|
| 35 |
|
| 36 |
+
define( 'WC_CORREIOS_VERSION', '3.7.1' );
|
| 37 |
define( 'WC_CORREIOS_PLUGIN_FILE', __FILE__ );
|
| 38 |
|
| 39 |
if ( ! class_exists( 'WC_Correios' ) ) {
|
