Main function for returning orders, uses the WC_Order_Factory class.
Fonction principale pour le retour des commandes, utilise la classe WC_Order_Factory.
$the_order = false
Sortie :
@param mixed $the_order Post object or post ID of the order. @return bool|WC_Order|WC_Order_Refund
// Récupérer une commande et afficher ses informations
$order = wc_get_order(123); // ID de la commande
if ($order) {
echo 'Statut: ' . $order->get_status();
echo 'Total: ' . $order->get_total();
echo 'Client: ' . $order->get_billing_email();
// Parcourir les articles
foreach ($order->get_items() as $item) {
echo $item->get_name() . ' x' . $item->get_quantity();
}
}
Chargement des actualités...