f653cfac by Kevin Burton

updated payhistory page

1 parent 3427f5d5
......@@ -131,8 +131,43 @@ use WP_User;
$row_class = ($i%2) ? "odd" : "";
if ( $item['post_id'] > 0 ) {
$post = get_post($item['post_id']);
$description = $post->post_title;
$post = get_post($item['post_id']);
if ($post->post_type=="events") {
$event_term_slugs = array();
$terms = get_the_terms($item['post_id'],'event_type');
if (!empty($terms)) {
foreach($terms as $types) {
$event_term_slugs[$types->slug] = $types->name;
}
}
}
if ( isset($event_term_slugs['webinar']) ) {
$description = $post->post_title . " | " . date("M d, Y",get_post_meta($item['post_id'],'event_date',true));
} else {
$description = $post->post_title . " | " . get_post_meta($item['post_id'],'location',true);
}
if ( count($item['discounts']) > 0 ) {
$item['discount_amount'] = "";
$discount_text = "<br /><span>";
for ($i=0; $i < count($item['discounts']); $i++) {
if ($i > 0) { $discount_text .= "<br />"; }
$discount_text .= "- $".$item['discounts'][$i]['discount']." OFF <em>".$item['discounts'][$i]['discount_label']."</em>";
$item['discount_amount'] += $item['discounts'][$i]['discount'];
}
$discount_text .= "</span>";
$description = "<strong>". $description ."</strong>".$discount_text;
}
} else {
$description = $item['description'];
}
......