{"id":15003,"date":"2026-04-25T16:45:22","date_gmt":"2026-04-25T16:45:22","guid":{"rendered":"https:\/\/mymedistore.in\/index.php\/track-order\/"},"modified":"2026-04-25T16:45:22","modified_gmt":"2026-04-25T16:45:22","slug":"track-order","status":"publish","type":"page","link":"https:\/\/mymedistore.in\/index.php\/track-order\/","title":{"rendered":"Track Your Order"},"content":{"rendered":"\n        <div class=\"tpc-track-page\">\n\n            <!-- Header -->\n            <div class=\"tpc-track-header\">\n                <div class=\"tpc-track-icon\">\ud83d\ude9a<\/div>\n                <h2>Track Your Shipment<\/h2>\n                <p>Enter your AWB \/ Tracking number to get live delivery status<\/p>\n            <\/div>\n\n            <!-- Search Box -->\n            <div class=\"tpc-track-search-wrap\">\n                <div class=\"tpc-track-search-box\">\n                    <input type=\"text\"\n                        id=\"tpc-awb-input\"\n                        placeholder=\"Enter AWB Number (e.g. MAA938093439)\"\n                        value=\"\"\n                        autocomplete=\"off\" \/>\n                    <button type=\"button\" id=\"tpc-track-btn\" onclick=\"tpcPublicTrack()\">\n                        \ud83d\udd0d Track\n                    <\/button>\n                <\/div>\n                <p class=\"tpc-search-hint\">Your AWB number is in the dispatch email we sent you<\/p>\n            <\/div>\n\n            <!-- Result Area -->\n            <div id=\"tpc-track-result-area\" style=\"display:none;\">\n\n                <!-- Status Card -->\n                <div class=\"tpc-result-card\">\n                    <div class=\"tpc-result-header\">\n                        <div>\n                            <div class=\"tpc-result-courier\">The Professional Couriers<\/div>\n                            <div class=\"tpc-result-awb\">AWB: <strong id=\"tpc-display-awb\"><\/strong><\/div>\n                        <\/div>\n                        <div id=\"tpc-current-status-badge\" class=\"tpc-status-pill\"><\/div>\n                    <\/div>\n\n                    <!-- Timeline -->\n                    <div class=\"tpc-result-timeline\" id=\"tpc-timeline\"><\/div>\n\n                    <!-- Full History -->\n                    <div class=\"tpc-history-section\" id=\"tpc-history-section\" style=\"display:none;\">\n                        <button type=\"button\" class=\"tpc-history-toggle-btn\" onclick=\"tpcToggleHistory()\">\n                            \u25bc View Full Tracking History\n                        <\/button>\n                        <div id=\"tpc-history-list\" class=\"tpc-history-list tpc-hidden\"><\/div>\n                    <\/div>\n                <\/div>\n\n            <\/div>\n\n            <!-- Error Area -->\n            <div id=\"tpc-track-error\" class=\"tpc-track-error\" style=\"display:none;\"><\/div>\n\n            <!-- Loading -->\n            <div id=\"tpc-track-loading\" class=\"tpc-track-loading\" style=\"display:none;\">\n                <div class=\"tpc-spinner\"><\/div>\n                <p>Fetching tracking details from TPC...<\/p>\n            <\/div>\n\n        <\/div>\n\n        <script>\n        \/\/ Auto track if AWB in URL\n        document.addEventListener('DOMContentLoaded', function() {\n            const awb = document.getElementById('tpc-awb-input').value.trim();\n            if (awb) tpcPublicTrack();\n        });\n\n        function tpcPublicTrack() {\n            const awb      = document.getElementById('tpc-awb-input').value.trim();\n            const result   = document.getElementById('tpc-track-result-area');\n            const error    = document.getElementById('tpc-track-error');\n            const loading  = document.getElementById('tpc-track-loading');\n            const btn      = document.getElementById('tpc-track-btn');\n\n            if (!awb) {\n                alert('Please enter an AWB number!');\n                return;\n            }\n\n            \/\/ Reset\n            result.style.display  = 'none';\n            error.style.display   = 'none';\n            loading.style.display = 'block';\n            btn.disabled          = true;\n            btn.textContent       = 'Tracking...';\n\n            fetch('https:\/\/mymedistore.in\/wp-admin\/admin-ajax.php', {\n                method: 'POST',\n                headers: { 'Content-Type': 'application\/x-www-form-urlencoded' },\n                body: new URLSearchParams({\n                    action: 'tpc_public_track',\n                    nonce:  'a787c88bc6',\n                    pod_no: awb\n                })\n            })\n            .then(r => r.json())\n            .then(data => {\n                loading.style.display = 'none';\n                btn.disabled          = false;\n                btn.textContent       = '\ud83d\udd0d Track';\n\n                if (data.success && data.data && data.data.length > 0) {\n                    tpcRenderResult(awb, data.data);\n                    result.style.display = 'block';\n                } else {\n                    error.style.display   = 'block';\n                    error.innerHTML = '\u274c ' + (data.data || 'AWB not found. Please check the number.');\n                }\n            })\n            .catch(() => {\n                loading.style.display = 'none';\n                btn.disabled          = false;\n                btn.textContent       = '\ud83d\udd0d Track';\n                error.style.display   = 'block';\n                error.innerHTML       = '\u274c Network error. Please try again.';\n            });\n        }\n\n        function tpcRenderResult(awb, events) {\n            const latest      = events[0];\n            const activity    = latest.Activity || '';\n            const isDelivered = activity.toUpperCase().includes('DELIVERED');\n            const isOFD       = activity.toUpperCase().includes('OUT FOR DELIVERY');\n\n            \/\/ AWB display\n            document.getElementById('tpc-display-awb').textContent = awb;\n\n            \/\/ Status badge\n            const badge = document.getElementById('tpc-current-status-badge');\n            badge.textContent  = (isDelivered ? '\u2705 ' : '\ud83d\ude9b ') + activity;\n            badge.className    = 'tpc-status-pill ' + (isDelivered ? 'tpc-pill-delivered' : 'tpc-pill-transit');\n\n            \/\/ Timeline\n            const timeline = document.getElementById('tpc-timeline');\n            timeline.innerHTML = `\n                <div class=\"tpc-t-step tpc-t-done\">\n                    <div class=\"tpc-t-dot\"><\/div>\n                    <div class=\"tpc-t-info\">\n                        <strong>Shipment Booked<\/strong>\n                        <span>Registered with The Professional Couriers<\/span>\n                    <\/div>\n                <\/div>\n                <div class=\"tpc-t-step ${(isOFD || isDelivered) ? 'tpc-t-done' : 'tpc-t-pending'}\">\n                    <div class=\"tpc-t-dot\"><\/div>\n                    <div class=\"tpc-t-info\">\n                        <strong>Out for Delivery<\/strong>\n                        <span>${latest.City || ''}<\/span>\n                    <\/div>\n                <\/div>\n                <div class=\"tpc-t-step ${isDelivered ? 'tpc-t-done' : 'tpc-t-pending'}\">\n                    <div class=\"tpc-t-dot\"><\/div>\n                    <div class=\"tpc-t-info\">\n                        <strong>Delivered<\/strong>\n                        ${isDelivered ? `<span>${latest.Date || ''}<\/span>` : '<span>Pending<\/span>'}\n                        ${isDelivered && latest.Receiver ? `<span>Received by: ${latest.Receiver}<\/span>` : ''}\n                    <\/div>\n                <\/div>\n            `;\n\n            \/\/ History\n            if (events.length > 1) {\n                const historySection = document.getElementById('tpc-history-section');\n                const historyList    = document.getElementById('tpc-history-list');\n                historySection.style.display = 'block';\n                historyList.innerHTML = events.map(e => `\n                    <div class=\"tpc-h-item\">\n                        <div class=\"tpc-h-dot ${e.Activity && e.Activity.toUpperCase().includes('DELIVERED') ? 'tpc-h-dot-green' : ''}\"><\/div>\n                        <div class=\"tpc-h-content\">\n                            <strong>${e.Activity || ''}<\/strong>\n                            <span>${e.City || ''} ${e.Date ? '\u2014 ' + e.Date : ''}<\/span>\n                        <\/div>\n                    <\/div>\n                `).join('');\n            }\n        }\n\n        function tpcToggleHistory() {\n            const list = document.getElementById('tpc-history-list');\n            const btn  = document.querySelector('.tpc-history-toggle-btn');\n            list.classList.toggle('tpc-hidden');\n            btn.textContent = list.classList.contains('tpc-hidden')\n                ? '\u25bc View Full Tracking History'\n                : '\u25b2 Hide History';\n        }\n        <\/script>\n\n        \n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-15003","page","type-page","status-publish","hentry"],"pure_taxonomies":[],"_links":{"self":[{"href":"https:\/\/mymedistore.in\/index.php\/wp-json\/wp\/v2\/pages\/15003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mymedistore.in\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mymedistore.in\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mymedistore.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mymedistore.in\/index.php\/wp-json\/wp\/v2\/comments?post=15003"}],"version-history":[{"count":0,"href":"https:\/\/mymedistore.in\/index.php\/wp-json\/wp\/v2\/pages\/15003\/revisions"}],"wp:attachment":[{"href":"https:\/\/mymedistore.in\/index.php\/wp-json\/wp\/v2\/media?parent=15003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}