Closed iqbalmbadhan closed 3 weeks ago
@iqbalmbadhan Hi, since we already have the feature to search order status by order number, why do I need to use the code again?
@hmbashar thanks bhai for your plugin. In our organisation we are using this and happy with it. Suddenly our manager ask me to set tracking with order number only instead mobile and order number. That’s why I make a little change and post it as a comment. Keep up the good work best of luck.
@hmbashar thanks bhai for your plugin. In our organisation we are using this and happy with it. Suddenly our manager ask me to set tracking with order number only instead mobile and order number. That’s why I make a little change and post it as a comment. Keep up the good work best of luck.
"Thank you for your response, but the code format in your comment is not displaying properly. Please edit your comment and use a code format like this is a code format here
https://prnt.sc/AdiaSgDhBQHt so that others can easily copy and use the code if needed."
Replace process.php file to use the order number for tracking.
`<?php // Don't call the file directly if (!defined('ABSPATH')) exit;
if (!class_exists('CBWCT_ORDER_TRACKER')) { return; }
// set variable for getting value from input field $get_order_number = sanitize_text_field($_POST['order_number']); $get_phone_number = sanitize_text_field($_POST['phone_number']);
if (empty($get_order_number)) { // search field empty check apply_filters('cbwct_order_number_phone_number_required', esc_html('Order Number field is required', 'cbwct')); } else { if (!isset($get_order_number)) { // order number empty $order = NULL; } else { if (CBWCT_ORDER_TRACKER::order_number_exists($get_order_number) == false) { echo apply_filters('cbwct_order_is_not_found', esc_html('order is not found!', 'cbwct'), $get_order_number); } else { $order = wc_get_order($get_order_number); // set order number $order_data = $order->get_data(); // The Order data
} ?>`