Skip to content

Instantly share code, notes, and snippets.

@alokstha1
Last active July 18, 2017 07:54
Show Gist options
  • Save alokstha1/851d8b93f6cb15d9dbc48786babd827d to your computer and use it in GitHub Desktop.
Save alokstha1/851d8b93f6cb15d9dbc48786babd827d to your computer and use it in GitHub Desktop.
Woocommerce hook after checkout
<?php
add_action( 'woocommerce_thankyou', 'woo_after_checkout', 10, 1 );
function woo_after_checkout( $order_id ) {
$order_detail = new WC_Order( $order_id );
$order_detail->get_billing_email();
$order_detail->get_billing_first_name();
$order_detail->get_billing_last_name();
$order_detail->get_billing_company();
foreach ( $order_detail->get_items() as $item_id => $item ) {
$product = $item->get_product();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment