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(); } -