updated payhistory page
Showing
1 changed file
with
37 additions
and
2 deletions
| ... | @@ -131,8 +131,43 @@ use WP_User; | ... | @@ -131,8 +131,43 @@ use WP_User; |
| 131 | $row_class = ($i%2) ? "odd" : ""; | 131 | $row_class = ($i%2) ? "odd" : ""; |
| 132 | 132 | ||
| 133 | if ( $item['post_id'] > 0 ) { | 133 | if ( $item['post_id'] > 0 ) { |
| 134 | $post = get_post($item['post_id']); | 134 | $post = get_post($item['post_id']); |
| 135 | $description = $post->post_title; | 135 | |
| 136 | if ($post->post_type=="events") { | ||
| 137 | $event_term_slugs = array(); | ||
| 138 | $terms = get_the_terms($item['post_id'],'event_type'); | ||
| 139 | if (!empty($terms)) { | ||
| 140 | foreach($terms as $types) { | ||
| 141 | $event_term_slugs[$types->slug] = $types->name; | ||
| 142 | } | ||
| 143 | } | ||
| 144 | |||
| 145 | } | ||
| 146 | |||
| 147 | |||
| 148 | |||
| 149 | |||
| 150 | if ( isset($event_term_slugs['webinar']) ) { | ||
| 151 | $description = $post->post_title . " | " . date("M d, Y",get_post_meta($item['post_id'],'event_date',true)); | ||
| 152 | } else { | ||
| 153 | $description = $post->post_title . " | " . get_post_meta($item['post_id'],'location',true); | ||
| 154 | } | ||
| 155 | |||
| 156 | if ( count($item['discounts']) > 0 ) { | ||
| 157 | $item['discount_amount'] = ""; | ||
| 158 | |||
| 159 | $discount_text = "<br /><span>"; | ||
| 160 | for ($i=0; $i < count($item['discounts']); $i++) { | ||
| 161 | if ($i > 0) { $discount_text .= "<br />"; } | ||
| 162 | $discount_text .= "- $".$item['discounts'][$i]['discount']." OFF <em>".$item['discounts'][$i]['discount_label']."</em>"; | ||
| 163 | $item['discount_amount'] += $item['discounts'][$i]['discount']; | ||
| 164 | } | ||
| 165 | $discount_text .= "</span>"; | ||
| 166 | $description = "<strong>". $description ."</strong>".$discount_text; | ||
| 167 | } | ||
| 168 | |||
| 169 | |||
| 170 | |||
| 136 | } else { | 171 | } else { |
| 137 | $description = $item['description']; | 172 | $description = $item['description']; |
| 138 | } | 173 | } | ... | ... |
-
Please register or sign in to post a comment