appointment-additional-info.php 838 B

123456789101112131415161718192021222324252627
  1. <?php
  2. if ( !isset($appointment_id) || !is_numeric($appointment_id) ) {
  3. return;
  4. }
  5. $appointment = Booked_WC_Appointment::get($appointment_id);
  6. // if there are no products then do not show payment info
  7. if ( !$appointment->products ) {
  8. return;
  9. }
  10. $payment_class = 'booked_wc_payment_pending';
  11. // if order is available then pull the status from it
  12. if ( $appointment->order_id ) {
  13. if ( $appointment->is_paid ) {
  14. $payment_class = 'booked_wc_payment_completed';
  15. }
  16. $status_text = $appointment->payment_status_text;
  17. } else if ( !$appointment->order_id || $appointment->order_id && !$appointment->is_paid ) {
  18. $status_text = __('Awaiting Payment', 'booked-woocommerce-payments');
  19. }
  20. ?>
  21. <br><i class="booked-icon booked-icon-cart"></i><span class="<?php echo $payment_class ?>"><?php echo $status_text ?></span>