T
T
trenton2021-04-20 15:55:09
WooCommerce
trenton, 2021-04-20 15:55:09

How can I make it so that the user can enter his order number in the field, and the status of this order is displayed?

Button as a search.
From what side do you approach this?
The number and status of the order is displayed in the personal account, so it is possible to pull it out to another place, right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lev Rozanov, 2021-04-20
@MetisKot

  1. Field for entering the order number by the user
  2. Get order data by id (don't forget to check what comes from the user):$order = wc_get_order($order_id_by_search_field);
  3. Get order status:$order->get_status();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question