mirror of
https://hk.gh-proxy.com/https://github.com/absoftlabs/track-order-by-order-id.git
synced 2025-10-04 02:10:58 +08:00
add custome messge based on order status
This commit is contained in:
parent
52e7d416fa
commit
aa0c2413bf
1 changed files with 21 additions and 5 deletions
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* 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]. 📞 <a style="text-decoration:none; color:blue; font-weight:bold;" href="https://wa.me/8801798930232" target="_blank">WhatsApp me for custom plugin/solutions</a>
|
||||
* Version: 1.0.8
|
||||
* Version: 1.1.0
|
||||
* Author: absoftlab
|
||||
* Author Email: absoftlab@gmail.com
|
||||
* Author URI: https://absoftlab.com
|
||||
|
@ -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 "<p style=\"color:black;\">✅ এই অর্ডারটি <strong>#$order_id</strong> বর্তমানে: <strong>$status</strong> এ আপডেট হয়েছে।</p>";
|
||||
$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 "<p style=\"color:black;\">{$status_messages[$status]}</p>";
|
||||
} else {
|
||||
echo "<p style=\"color:black;\">📢 আপনার অর্ডারের স্ট্যাটাস: <strong>" . wc_get_order_status_name($status) . "</strong></p>";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "<p style=\"color:black;\">❌ <strong>#$order_id</strong> এই নাম্বারের অর্ডার পাওয়া যায়নি।</p>";
|
||||
}
|
||||
|
@ -43,4 +60,3 @@ function otbn_track_order_shortcode() {
|
|||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue