Last active
July 18, 2017 07:54
-
-
Save alokstha1/851d8b93f6cb15d9dbc48786babd827d to your computer and use it in GitHub Desktop.
Woocommerce hook after checkout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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