Created
May 12, 2016 13:33
-
-
Save kish2011/ecf2aa7144b483c46710d6692af79013 to your computer and use it in GitHub Desktop.
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
function listify_get_job_listing_price_job_id( $job_id ) { | |
global $wpdb; | |
$order_itemmeta_sql = 'SELECT * FROM ' . | |
$wpdb->prefix . 'woocommerce_order_itemmeta WHERE | |
meta_key ="_job_id" AND meta_value=' .$job_id; | |
$order_itemmeta_results = $wpdb->get_row( $order_itemmeta_sql , OBJECT ); | |
$order_items_sql = 'SELECT * FROM ' . | |
$wpdb->prefix . 'woocommerce_order_items WHERE | |
order_item_id =' .$order_itemmeta_results->order_item_id; | |
$order_items_results = $wpdb->get_row( $order_items_sql , OBJECT ); | |
$order = new WC_Order( $order_items_results->order_id ); | |
$get_formatted_order_total = $order->get_formatted_order_total(); | |
return $get_formatted_order_total; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment