| @@ -190,8 +190,22 @@ | ||
| 190 | 190 | $appointment = Appointments::get_full_appointment_by_id( $appointment_id ); |
| 191 | 191 | $status = $appointment->status; |
| 192 | 192 | $payment_status = $appointment->payment_status; |
| 193 | 193 | |
| 194 | + $payment_status_labels = array( | |
| 195 | + 'pending' => __( 'pending', 'bookit' ), | |
| 196 | + 'cancelled' => __( 'cancelled', 'bookit' ), | |
| 197 | + 'rejected' => __( 'rejected', 'bookit' ), | |
| 198 | + 'complete' => __( 'complete', 'bookit' ), | |
| 199 | + ); | |
| 200 | + | |
| 201 | + $appointment_status_labels = array( | |
| 202 | + 'pending' => __( 'pending', 'bookit' ), | |
| 203 | + 'approved' => __( 'approved', 'bookit' ), | |
| 204 | + 'cancelled' => __( 'cancelled', 'bookit' ), | |
| 205 | + 'delete' => __( 'delete', 'bookit' ), | |
| 206 | + ); | |
| 207 | + | |
| 194 | 208 | $vars = array( |
| 195 | 209 | '[admin]' => get_option( 'admin_email' ), |
| 196 | 210 | '[staff]' => $appointment->staff_email, |
| 197 | 211 | '[customer]' => $appointment->customer_email, |
| @@ -204,12 +218,12 @@ | ||
| 204 | 218 | '[appointment_id]' => $appointment->id, |
| 205 | 219 | '[appointment_day]' => date( get_option( 'date_format' ), $appointment->date_timestamp ), |
| 206 | 220 | '[start_time]' => date( get_option( 'time_format' ), $appointment->start_time ), |
| 207 | 221 | '[payment_method]' => $appointment->payment_method, |
| 208 | - '[payment_status]' => __( $payment_status, 'bookit' ), // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 222 | + '[payment_status]' => $payment_status_labels[ $payment_status ] ?? $payment_status, | |
| 209 | 223 | '[price]' => $appointment->price, |
| 210 | 224 | '[total]' => bookit_price( $appointment->price ), |
| 211 | - '[status]' => __( $status, 'bookit' ), // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 225 | + '[status]' => $appointment_status_labels[ $status ] ?? $status, | |
| 212 | 226 | '[reason]' => $reason, |
| 213 | 227 | ); |
| 214 | 228 | |
| 215 | 229 | return $vars; |