diff --git a/track-order-by-order-id.php b/track-order-by-order-id.php index 194f007..9d83972 100644 --- a/track-order-by-order-id.php +++ b/track-order-by-order-id.php @@ -2,11 +2,11 @@ /** * Plugin Name: Order Tracking by Order Number Only * Description: Allows users to track their WooCommerce orders using only the order number, without email or login. [track_order_by_number]. đ WhatsApp me for custom plugin/solutions - * Version: 1.0.8 + * Version: 1.1.0 * Author: absoftlab * Author Email: absoftlab@gmail.com * Author URI: https://absoftlab.com - * License: GPL2 + * License: GPL2 */ if (!defined('ABSPATH')) exit; // Exit if accessed directly @@ -34,8 +34,25 @@ function otbn_track_order_shortcode() { $order = wc_get_order($order_id); if ($order) { - $status = wc_get_order_status_name($order->get_status()); - echo "
â āĻāĻ āĻ āϰā§āĻĄāĻžāϰāĻāĻŋ #$order_id āĻŦāϰā§āϤāĻŽāĻžāύā§: $status āĻ āĻāĻĒāĻĄā§āĻ āĻšā§ā§āĻā§āĨ¤
"; + $status = $order->get_status(); + + // Custom messages for each status + $status_messages = array( + 'pending' => 'đĻ āĻāĻĒāύāĻžāϰ āĻ āϰā§āĻĄāĻžāϰāĻāĻŋ āϰāĻŋāϏāĻŋāĻ āĻāϰāĻž āĻšāϝāĻŧā§āĻā§ āĻāĻŦāĻ āĻĒā§āĻŽā§āύā§āĻā§āϰ āĻ āĻĒā§āĻā§āώāĻžāϝāĻŧ āĻāĻā§āĨ¤', + 'processing' => 'âī¸ āĻāĻĒāύāĻžāϰ āĻ āϰā§āĻĄāĻžāϰāĻāĻŋ āĻĒā§āϰāĻā§āϰāĻŋāϝāĻŧāĻžāϧā§āύ āϰāϝāĻŧā§āĻā§ āĻāĻŦāĻ āĻā§āĻŦ āĻļā§āĻā§āϰāĻ āĻĄā§āϞāĻŋāĻāĻžāϰāĻŋ āĻšāĻŦā§āĨ¤', + 'on-hold' => 'â¸ī¸ āĻāĻĒāύāĻžāϰ āĻ āϰā§āĻĄāĻžāϰāĻāĻŋ āϏāĻžāĻŽāϝāĻŧāĻŋāĻāĻāĻžāĻŦā§ āϏā§āĻĨāĻāĻŋāϤ āϰāϝāĻŧā§āĻā§āĨ¤', + 'completed' => 'â āĻāĻĒāύāĻžāϰ āĻ āϰā§āĻĄāĻžāϰāĻāĻŋ āϏāĻĢāϞāĻāĻžāĻŦā§ āϏāĻŽā§āĻĒāύā§āύ āĻšāϝāĻŧā§āĻā§āĨ¤ āϧāύā§āϝāĻŦāĻžāĻĻ!', + 'cancelled' => 'â āĻāĻĒāύāĻžāϰ āĻ āϰā§āĻĄāĻžāϰāĻāĻŋ āĻŦāĻžāϤāĻŋāϞ āĻāϰāĻž āĻšāϝāĻŧā§āĻā§āĨ¤', + 'refunded' => 'đ° āĻāĻĒāύāĻžāϰ āĻ āϰā§āĻĄāĻžāϰā§āϰ āĻāĻžāĻāĻž āĻĢā§āϰāϤ āĻĻā§āĻāϝāĻŧāĻž āĻšāϝāĻŧā§āĻā§āĨ¤', + 'failed' => 'â ī¸ āĻāĻĒāύāĻžāϰ āĻ āϰā§āĻĄāĻžāϰā§āϰ āĻĒā§āĻŽā§āύā§āĻ āĻŦā§āϝāϰā§āĻĨ āĻšāϝāĻŧā§āĻā§āĨ¤ āĻ āύā§āĻā§āϰāĻš āĻāϰ⧠āĻĒā§āύāϰāĻžāϝāĻŧ āĻā§āώā§āĻāĻž āĻāϰā§āύāĨ¤', + ); + + if (isset($status_messages[$status])) { + echo "{$status_messages[$status]}
"; + } else { + echo "đĸ āĻāĻĒāύāĻžāϰ āĻ āϰā§āĻĄāĻžāϰā§āϰ āϏā§āĻā§āϝāĻžāĻāĻžāϏ: " . wc_get_order_status_name($status) . "
"; + } + } else { echo "â #$order_id āĻāĻ āύāĻžāĻŽā§āĻŦāĻžāϰā§āϰ āĻ āϰā§āĻĄāĻžāϰ āĻĒāĻžāĻāϝāĻŧāĻž āϝāĻžāϝāĻŧāύāĻŋāĨ¤
"; } @@ -43,4 +60,3 @@ function otbn_track_order_shortcode() { return ob_get_clean(); } -