Finally, got it working with this code:-
function return_custom_price($price, $product) {
global $post, $woocommerce;
$post_id = $post->ID;
if($post_id == '696' || $post_id == '697' || $post_id == '705' /*|| $post_id == '53'*/ || $post_id == ''){
// cart, checkout, , order recieved, order now
$post_id = $product->id;
}
$new_price = get_post_meta($post_id, '_price', true);
if($new_price=='') {
$new_price = $price;
} else {
$api_call = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20csv%20where%20url%3D%22http%3A%2F%2Ffinance.yahoo.com%2Fd%2Fquotes.csv%3Fe%3D.csv%26f%3Dc4l1%26s%3DNZD%3DX%2CAUD%3DX%22%3B&format=json&diagnostics=true&callback=";
$data[] = json_decode(file_get_contents($api_call));
$nzd = (double) $data[0]->query->results->row[0]->col1;
$aud = (double) $data[0]->query->results->row[1]->col1;
$new_price = ( $nzd / $aud ) * $new_price;
}
return $new_price;
}
add_filter('woocommerce_get_price', 'return_custom_price', $product, 2);