manicozyvision
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Booking Calendar] Hook neededThank you for updating the hooks in your last release of your plugin.
We need your assistance for below points:1. We found that we need a function to retrieve the form fields. So we request you to add the below function in wpbc-dev-api.php
function getFormFields() { $obj=array(); if(class_exists('WPBC_Page_SettingsFormFieldsFree')) { $form_fields = WPBC_Page_SettingsFormFieldsFree::get_booking_form_structure_for_visual(); foreach($form_fields as $field) { if($field['name'] != '' && $field['label'] != '' && !in_array($field['type'],array('captcha','submit'))) { $obj[$field['name']]=$field['label']; } } } return $obj; }
2. We have smsalert plugin so we require phone field in booking form. we do not want users to add the phone field manually.You have already done it for email field i.e is automated created by plugin and non-removable. Please suggest a solution for it.
Hope positive response from your side. Thanks in advance.
Forum: Plugins
In reply to: [WP Booking Calendar] Hook neededwaiting for the update of the plugin. Please revert.
Forum: Plugins
In reply to: [WP Booking Calendar] Hook neededPlease add below hooks at the below files
booking\core\lib\wpbc-ajax.php
line 199
line 204
line 259
line 410booking\core\lib\wpbc-booking-new.php
line 187
line 451
line 509
line 565add this function to booking\core\wpbc-dev-api.php line 17 to 45
function wpbc_api_get_booking_by_id($booking_id=null)
{
global $wpdb;
$slct_sql = “SELECT * FROM {$wpdb->prefix}booking as b left join {$wpdb->prefix}bookingdates as bd on (b.booking_id = bd.booking_id) WHERE b.booking_id IN ({$booking_id}) LIMIT 0,1”;
$slct_sql_results = $wpdb->get_results( $slct_sql,ARRAY_A );
if ( count($slct_sql_results) > 0 ) {
$data = $slct_sql_results[0];
$formdata_array = explode(‘~’,$data[‘form’]);$formdata_array_count = count($formdata_array);
for ( $i=0 ; $i < $formdata_array_count ; $i++) {if ( empty( $formdata_array[$i] ) ) {
continue;
}
$elemnts = explode(‘^’,$formdata_array[$i]);
$type = $elemnts[0];
$element_name = $elemnts[1];
$value = $elemnts[2];
$value = nl2br($value);
$data[‘formdata’][$element_name] = $value;
}}
return $data;
}
I have made above changes to 3 files, you can download from below link to check and merge in your code
https://projects.cozyvision.com/booking.zip
- This reply was modified 4 years, 9 months ago by manicozyvision.
Forum: Plugins
In reply to: [WP Booking Calendar] Hook neededHi,
Thank you for your reply. I checked the given file link. But it does not fulfil my purpose. I want to capture the events such as new booking , booking approved, booking denied, booking pending, booking deleted. For your reference, I am sharing below file links and line number where updation is required. Please look into these files and revert back to me as soon as possible.
booking\core\lib\wpbc-ajax.php
line 195
line 199
line 255
line 405booking\core\lib\wpbc-booking-new.php
line 450
line 508
line 563