Version Description
2016/09/15 =
Corrigida a utilizao das classes de entrega para os mtodos de Carta Registrada, Impresso Normal e Impresso Urgente.
Download this release
Release Info
| Developer | claudiosanches |
| Plugin | |
| Version | 3.1.1 |
| Comparing to | |
| See all releases | |
Code changes from version 3.1.0 to 3.1.1
- includes/abstracts/abstract-wc-correios-shipping-carta.php +5 -5
- includes/shipping/class-wc-correios-shipping-carta-registrada.php +4 -0
- includes/shipping/class-wc-correios-shipping-impresso-normal.php +4 -0
- includes/shipping/class-wc-correios-shipping-impresso-urgente.php +4 -0
- languages/woocommerce-correios.pot +2 -2
- readme.txt +7 -2
- woocommerce-correios.php +2 -2
includes/abstracts/abstract-wc-correios-shipping-carta.php
CHANGED
|
@@ -169,15 +169,15 @@ abstract class WC_Correios_Shipping_Carta extends WC_Correios_Shipping {
|
|
| 169 |
*
|
| 170 |
* @param array $package Shipping package.
|
| 171 |
*
|
| 172 |
-
* @return float
|
| 173 |
*/
|
| 174 |
protected function get_package_weight( $package ) {
|
| 175 |
$weight = 0;
|
| 176 |
|
| 177 |
foreach ( $package['contents'] as $value ) {
|
| 178 |
-
$product
|
| 179 |
-
$qty
|
| 180 |
-
$product_weight
|
| 181 |
|
| 182 |
// Check if all or some items in the cart don't supports this shipping method.
|
| 183 |
if ( $this->shipping_class !== $product->get_shipping_class() ) {
|
|
@@ -185,7 +185,7 @@ abstract class WC_Correios_Shipping_Carta extends WC_Correios_Shipping {
|
|
| 185 |
$this->log->add( $this->id, 'One or all items in the cart do not supports the configured shipping class' );
|
| 186 |
}
|
| 187 |
|
| 188 |
-
return
|
| 189 |
}
|
| 190 |
|
| 191 |
if ( $qty > 0 && $product->needs_shipping() ) {
|
| 169 |
*
|
| 170 |
* @param array $package Shipping package.
|
| 171 |
*
|
| 172 |
+
* @return float|bool
|
| 173 |
*/
|
| 174 |
protected function get_package_weight( $package ) {
|
| 175 |
$weight = 0;
|
| 176 |
|
| 177 |
foreach ( $package['contents'] as $value ) {
|
| 178 |
+
$product = $value['data'];
|
| 179 |
+
$qty = $value['quantity'];
|
| 180 |
+
$product_weight = 0;
|
| 181 |
|
| 182 |
// Check if all or some items in the cart don't supports this shipping method.
|
| 183 |
if ( $this->shipping_class !== $product->get_shipping_class() ) {
|
| 185 |
$this->log->add( $this->id, 'One or all items in the cart do not supports the configured shipping class' );
|
| 186 |
}
|
| 187 |
|
| 188 |
+
return false;
|
| 189 |
}
|
| 190 |
|
| 191 |
if ( $qty > 0 && $product->needs_shipping() ) {
|
includes/shipping/class-wc-correios-shipping-carta-registrada.php
CHANGED
|
@@ -147,7 +147,11 @@ class WC_Correios_Shipping_Carta_Registrada extends WC_Correios_Shipping_Carta {
|
|
| 147 |
return 0;
|
| 148 |
}
|
| 149 |
|
|
|
|
| 150 |
$weight = $this->get_package_weight( $package );
|
|
|
|
|
|
|
|
|
|
| 151 |
|
| 152 |
foreach ( $this->get_costs() as $cost_weight => $costs ) {
|
| 153 |
if ( $weight <= $cost_weight ) {
|
| 147 |
return 0;
|
| 148 |
}
|
| 149 |
|
| 150 |
+
// Get the package weight and validate.
|
| 151 |
$weight = $this->get_package_weight( $package );
|
| 152 |
+
if ( false === $weight ) {
|
| 153 |
+
return 0;
|
| 154 |
+
}
|
| 155 |
|
| 156 |
foreach ( $this->get_costs() as $cost_weight => $costs ) {
|
| 157 |
if ( $weight <= $cost_weight ) {
|
includes/shipping/class-wc-correios-shipping-impresso-normal.php
CHANGED
|
@@ -106,7 +106,11 @@ class WC_Correios_Shipping_Impresso_Normal extends WC_Correios_Shipping_Impresso
|
|
| 106 |
return 0;
|
| 107 |
}
|
| 108 |
|
|
|
|
| 109 |
$weight = $this->get_package_weight( $package );
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
if ( $weight <= $this->shipping_method_weight_limit ) {
|
| 112 |
if ( $weight > 1000 ) {
|
| 106 |
return 0;
|
| 107 |
}
|
| 108 |
|
| 109 |
+
// Get the package weight and validate.
|
| 110 |
$weight = $this->get_package_weight( $package );
|
| 111 |
+
if ( false === $weight ) {
|
| 112 |
+
return 0;
|
| 113 |
+
}
|
| 114 |
|
| 115 |
if ( $weight <= $this->shipping_method_weight_limit ) {
|
| 116 |
if ( $weight > 1000 ) {
|
includes/shipping/class-wc-correios-shipping-impresso-urgente.php
CHANGED
|
@@ -84,7 +84,11 @@ class WC_Correios_Shipping_Impresso_Urgente extends WC_Correios_Shipping_Impress
|
|
| 84 |
return 0;
|
| 85 |
}
|
| 86 |
|
|
|
|
| 87 |
$weight = $this->get_package_weight( $package );
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
if ( $weight <= $this->shipping_method_weight_limit ) {
|
| 90 |
foreach ( $this->get_costs() as $cost_weights => $costs ) {
|
| 84 |
return 0;
|
| 85 |
}
|
| 86 |
|
| 87 |
+
// Get the package weight and validate.
|
| 88 |
$weight = $this->get_package_weight( $package );
|
| 89 |
+
if ( false === $weight ) {
|
| 90 |
+
return 0;
|
| 91 |
+
}
|
| 92 |
|
| 93 |
if ( $weight <= $this->shipping_method_weight_limit ) {
|
| 94 |
foreach ( $this->get_costs() as $cost_weights => $costs ) {
|
languages/woocommerce-correios.pot
CHANGED
|
@@ -2,9 +2,9 @@
|
|
| 2 |
# This file is distributed under the GPLv2 or later.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
-
"Project-Id-Version: WooCommerce Correios 3.1.
|
| 6 |
"Report-Msgid-Bugs-To: https://wordpress.org/plugins/woocommerce-domination/\n"
|
| 7 |
-
"POT-Creation-Date: 2016-09-
|
| 8 |
"MIME-Version: 1.0\n"
|
| 9 |
"Content-Type: text/plain; charset=utf-8\n"
|
| 10 |
"Content-Transfer-Encoding: 8bit\n"
|
| 2 |
# This file is distributed under the GPLv2 or later.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
+
"Project-Id-Version: WooCommerce Correios 3.1.1\n"
|
| 6 |
"Report-Msgid-Bugs-To: https://wordpress.org/plugins/woocommerce-domination/\n"
|
| 7 |
+
"POT-Creation-Date: 2016-09-15 05:33:12+00:00\n"
|
| 8 |
"MIME-Version: 1.0\n"
|
| 9 |
"Content-Type: text/plain; charset=utf-8\n"
|
| 10 |
"Content-Transfer-Encoding: 8bit\n"
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: http://claudiosmweb.com/doacoes/
|
|
| 4 |
Tags: shipping, delivery, woocommerce, correios
|
| 5 |
Requires at least: 4.0
|
| 6 |
Tested up to: 4.6
|
| 7 |
-
Stable tag: 3.1.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -203,6 +203,10 @@ Em caso de dúvidas, basta abrir um tópico no [fórum de suporte do plugin](htt
|
|
| 203 |
|
| 204 |
== Changelog ==
|
| 205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
= 3.1.0 - 2016/09/13 =
|
| 207 |
|
| 208 |
- Adicionado os métodos Impresso Normal e Impresso Urgente (obrigado a [@jckronbauer](https://github.com/jckronbauer)).
|
|
@@ -249,9 +253,10 @@ Em caso de dúvidas, basta abrir um tópico no [fórum de suporte do plugin](htt
|
|
| 249 |
|
| 250 |
== Upgrade Notice ==
|
| 251 |
|
| 252 |
-
= 3.1.
|
| 253 |
|
| 254 |
- Adicionado os métodos Impresso Normal e Impresso Urgente (obrigado a [@jckronbauer](https://github.com/jckronbauer)).
|
| 255 |
- Adicionada opção para enviar novamente e-mail do código de rastreio.
|
| 256 |
- Adicionada mensagem de erro quando serviço é indisponível no trecho informado.
|
|
|
|
| 257 |
- E mais outras várias alterações que podem ser verificadas pelo [GitHub](https://github.com/claudiosmweb/woocommerce-correios/compare/2.3.0...3.0.0).
|
| 4 |
Tags: shipping, delivery, woocommerce, correios
|
| 5 |
Requires at least: 4.0
|
| 6 |
Tested up to: 4.6
|
| 7 |
+
Stable tag: 3.1.1
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 203 |
|
| 204 |
== Changelog ==
|
| 205 |
|
| 206 |
+
= 3.1.1 - 2016/09/15 =
|
| 207 |
+
|
| 208 |
+
- Corrigida a utilização das classes de entrega para os métodos de Carta Registrada, Impresso Normal e Impresso Urgente.
|
| 209 |
+
|
| 210 |
= 3.1.0 - 2016/09/13 =
|
| 211 |
|
| 212 |
- Adicionado os métodos Impresso Normal e Impresso Urgente (obrigado a [@jckronbauer](https://github.com/jckronbauer)).
|
| 253 |
|
| 254 |
== Upgrade Notice ==
|
| 255 |
|
| 256 |
+
= 3.1.1 =
|
| 257 |
|
| 258 |
- Adicionado os métodos Impresso Normal e Impresso Urgente (obrigado a [@jckronbauer](https://github.com/jckronbauer)).
|
| 259 |
- Adicionada opção para enviar novamente e-mail do código de rastreio.
|
| 260 |
- Adicionada mensagem de erro quando serviço é indisponível no trecho informado.
|
| 261 |
+
- Corrigida a utilização das classes de entrega para os métodos de Carta Registrada, Impresso Normal e Impresso Urgente.
|
| 262 |
- E mais outras várias alterações que podem ser verificadas pelo [GitHub](https://github.com/claudiosmweb/woocommerce-correios/compare/2.3.0...3.0.0).
|
woocommerce-correios.php
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
* Description: Correios para WooCommerce
|
| 6 |
* Author: Claudio Sanches
|
| 7 |
* Author URI: http://claudiosmweb.com/
|
| 8 |
-
* Version: 3.1.
|
| 9 |
* License: GPLv2 or later
|
| 10 |
* Text Domain: woocommerce-correios
|
| 11 |
* Domain Path: languages/
|
|
@@ -29,7 +29,7 @@ if ( ! class_exists( 'WC_Correios' ) ) :
|
|
| 29 |
*
|
| 30 |
* @var string
|
| 31 |
*/
|
| 32 |
-
const VERSION = '3.1.
|
| 33 |
|
| 34 |
/**
|
| 35 |
* Instance of this class.
|
| 5 |
* Description: Correios para WooCommerce
|
| 6 |
* Author: Claudio Sanches
|
| 7 |
* Author URI: http://claudiosmweb.com/
|
| 8 |
+
* Version: 3.1.1
|
| 9 |
* License: GPLv2 or later
|
| 10 |
* Text Domain: woocommerce-correios
|
| 11 |
* Domain Path: languages/
|
| 29 |
*
|
| 30 |
* @var string
|
| 31 |
*/
|
| 32 |
+
const VERSION = '3.1.1';
|
| 33 |
|
| 34 |
/**
|
| 35 |
* Instance of this class.
|
