WooCommerce customize parts: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Felder) |
|||
| (2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 3: | Zeile 3: | ||
=== Felder === | === Felder === | ||
Überblick | |||
* https://www.businessbloomer.com/woocommerce-easily-get-order-info-total-items-etc-from-order-object/ | |||
* https://developer.woocommerce.com/2022/01/17/the-plan-for-the-woocommerce-custom-order-table/ | |||
Query wc_get_orders | Query wc_get_orders | ||
* https://wordpress.stackexchange.com/questions/337852/query-woocommerce-orders-where-meta-data-does-not-exist | * https://wordpress.stackexchange.com/questions/337852/query-woocommerce-orders-where-meta-data-does-not-exist | ||
* https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query | * https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query | ||
<syntaxhighlight lang=php> | |||
// Get an instance of the WC_Order object (same as before) | |||
$order = wc_get_order( $order_id ); | |||
$order_id = $order->get_id(); // Get the order ID | |||
$parent_id = $order->get_parent_id(); // Get the parent order ID (for subscriptions…) | |||
$user_id = $order->get_user_id(); // Get the costumer ID | |||
$user = $order->get_user(); // Get the WP_User object | |||
$order_status = $order->get_status(); // Get the order status | |||
$currency = $order->get_currency(); // Get the currency used | |||
$payment_method = $order->get_payment_method(); // Get the payment method ID | |||
$payment_title = $order->get_payment_method_title(); // Get the payment method title | |||
$date_created = $order->get_date_created(); // Get date created (WC_DateTime object) | |||
$date_modified = $order->get_date_modified(); // Get date modified (WC_DateTime object) | |||
$billing_country = $order->get_billing_country(); // Customer billing country | |||
</syntaxhighlight> | |||
=== Meta Felder === | === Meta Felder === | ||
Aktuelle Version vom 10. März 2022, 11:08 Uhr
Orders[Bearbeiten]
Felder[Bearbeiten]
Überblick
- https://www.businessbloomer.com/woocommerce-easily-get-order-info-total-items-etc-from-order-object/
- https://developer.woocommerce.com/2022/01/17/the-plan-for-the-woocommerce-custom-order-table/
Query wc_get_orders
- https://wordpress.stackexchange.com/questions/337852/query-woocommerce-orders-where-meta-data-does-not-exist
- https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query
// Get an instance of the WC_Order object (same as before)
$order = wc_get_order( $order_id );
$order_id = $order->get_id(); // Get the order ID
$parent_id = $order->get_parent_id(); // Get the parent order ID (for subscriptions…)
$user_id = $order->get_user_id(); // Get the costumer ID
$user = $order->get_user(); // Get the WP_User object
$order_status = $order->get_status(); // Get the order status
$currency = $order->get_currency(); // Get the currency used
$payment_method = $order->get_payment_method(); // Get the payment method ID
$payment_title = $order->get_payment_method_title(); // Get the payment method title
$date_created = $order->get_date_created(); // Get date created (WC_DateTime object)
$date_modified = $order->get_date_modified(); // Get date modified (WC_DateTime object)
$billing_country = $order->get_billing_country(); // Customer billing country
Meta Felder[Bearbeiten]
https://help.themehigh.com/hc/en-us/articles/900005426543-Frequently-Asked-Questions
<?php $order_meta = get_post_meta( $order_id, $field_name, true ) ;?>
- werden zB vom Plugin checkout-field-editor-pro benutzt
- https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/
<?php echo get_post_meta( $order->id, '_shipping_first_name', true) ;?>