Open tomandersen opened 1 year ago
+10
"Appointment Field" is the only addition needed in the code (ie add Appointment Field to the menu) . I can see how to code it, but don't want a custom version of the plugin running!
You may use a custom code to add something you need without modifying the plugin itself
Something like this should work
class Jet_Appointment_Additional_Macros {
private $manager;
public function __construct() {
add_filter( 'jet-apb/macros-list', array( $this, 'add_macros' ), 0, 2 );
}
public function add_macros( $macros_list, $manager ) {
$this->manager = $manager;
$macros_list['new_macro'] = array(
'label' => 'New Macro',
'cb' => array( $this, 'process_new_macro' ),
'args' => array(
'arg1' => array(
'label' => 'Argument 1',
'type' => 'text',
'default' => '',
),
),
);
return $macros_list;
}
public function process_new_macro( $result = null, $args_str = null ) {
$appointment = $this->manager->get_macros_object();
return $args_str ?? 'test';
}
}
new Jet_Appointment_Additional_Macros;
+1
Before adding a new feature request, please, make sure you’ve checked:
Appointments is a private repo.
I could write the easy part of this feature request in 5 mins by editing the file
jet-appointments-booking/includes/macros.php
REQUEST
Please add support for all fields in the appointment table: EG Missing: user_name
This would require adding a few lines of code and a new function called appointment_user_name
BUT I have added a column to the Appointments table! So how to make macros for all columns in the ? You have a thing called "Appointment Meta" perhaps one called "Appointment Field" would be nice.
That way we can get the user_name and user_phone into the admin emails we send out! Thanks.