Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust status to show trackingo to client #183

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Models/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
namespace MelhorEnvio\Models;

class Version {

const VERSION = '2.15.0';
}
7 changes: 5 additions & 2 deletions Services/TrackingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function addTrackingWcOrder( $order, $tracking ) {
* @param int $orderId
* @return string $tracking
*/

public function getTrackingOrder( $order ) {

$data = $order->get_meta(self::TRACKING_MELHOR_ENVIO);
Expand Down Expand Up @@ -107,7 +108,6 @@ private function addTrackingToOrderClients() {
add_action(
'woocommerce_my_account_my_orders_column_tracking',
function ( $order ) {

$text = 'Não disponível';
if ( $this->isWaitingToBePosted( $order ) ) {
$text = 'Aguardando postagem';
Expand All @@ -129,6 +129,9 @@ function ( $order ) {
* @return bool
*/
private function isWaitingToBePosted( $order ) {
return in_array( $order->get_status(), array( 'processing', 'completed' ) );
return !in_array(
$order->get_status(),
['on-hold', 'cancelled', 'refunded']
);
}
}
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Pronto! o plugin do Melhor Envio está funcionando.
== Changelog ==
= 2.15.0 =
* Adiciona compatibilidade com WC HPOS.
* Ajuste na exibição de rastreio para os clientes.

= 2.14.0 =
* Adiciona serviço de Loggi coleta.
Expand Down