Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Hook Reference
  • Docs Home

Packages

  • BKAP
    • Addons
    • Admin-Bookings
    • Attribute-Lockout
    • Block-Pricing
    • Booking-Box
    • Booking-Confirmation
    • Booking-Process
    • Cancel-Order
    • Cart
    • Checkout-Process
    • Core
    • Date-Time
    • Emails
    • Functions
    • Global-Function
    • Global-Settings
    • Google-Calendar-Sync
    • ICS
    • Import-Booking
    • Labels
    • License
    • Menus
    • Meta-Boxes
    • Reschedule
    • Resources
    • Search-Widget
    • Special-Price
    • Uninstall
    • Validation
    • Variation-Lockout
    • Vendors
      • Dokan
      • WC-Vendors
    • View-Bookings
  • None

Classes

  • bkap_booking_box_class

Class bkap_booking_box_class

Class for Booking meta box

Package: BKAP\Booking-Box
Author: Tyche Softwares
Class: bkap_booking_box_class
Located at booking-box.php

Methods summary

public static
# bkap_process_bookings_box( integer $post_id, array $post )

This function updates the booking settings for each product in the wp_postmeta table in the database. It will be called when update / publish button clicked on admin side.

This function updates the booking settings for each product in the wp_postmeta table in the database. It will be called when update / publish button clicked on admin side.

Parameters

$post_id
  • Post ID
$post
  • Contains the data

Since

1.0

Hook

woocommerce_process_product_meta
public static
# bkap_booking_box( )

This function adds a meta box for booking settings on product page.

This function adds a meta box for booking settings on product page.

Since

1.0

Hook

add_meta_boxes
public static
# bkap_print_js( )

Adds JS code for Vertical tabs in the Booking meta box.

Adds JS code for Vertical tabs in the Booking meta box.

Since

2.2

Hook

admin_footer
public static
# bkap_meta_box( )

Displays the settings for the product in the Booking meta box.

Displays the settings for the product in the Booking meta box.

Since

1.0
public static
# bkap_save_button( str $save_fn )

This function will print a save button in each of the tabs. It needs the callback JS function as the parameter

This function will print a save button in each of the tabs. It needs the callback JS function as the parameter

Parameters

$save_fn
  • Name of the callback JS function.

Since

4.6.0
public static
# bkap_get_weekdays_html( integer $product_id, boolean $lockout = false, boolean $price = true, array $booking_settings = array() )

The function adds the html for the Weekdays UI which allows the admin to enable/disable weekdays, set lockout and price for the same.

The function adds the html for the Weekdays UI which allows the admin to enable/disable weekdays, set lockout and price for the same.

Parameters

$product_id
$lockout
$price
$booking_settings
settings

Since

4.0.0
public static
# bkap_get_specific_html( integer $product_id, array $booking_settings )

Adds the specific dates availability checkbox and the table for the same.

Adds the specific dates availability checkbox and the table for the same.

Parameters

$product_id
  • Product ID
$booking_settings

Since

4.0.0
public static
# bkap_get_specific_heading_html( $product_id )

Prints the table headers for the 'Set Availability by Dates/Months' which allows the admin to enable/disable weekdays, set lockout and price for the same.

Prints the table headers for the 'Set Availability by Dates/Months' which allows the admin to enable/disable weekdays, set lockout and price for the same.

Parameters

$product_id
Product ID

Since

4.0.0
public static
# bkap_get_specific_default_row_html( integer $product_id, array $booking_settings )

Prints the default row for the 'Set Availability by Dates/Months' which allows the admin to enable/disable weekdays, set lockout and price for the same. This row is used to add new rows to the table.

Prints the default row for the 'Set Availability by Dates/Months' which allows the admin to enable/disable weekdays, set lockout and price for the same. This row is used to add new rows to the table.

Parameters

$product_id
  • Product ID
$booking_settings
  • Existing Booking Settings

Since

4.0.0
public static
# bkap_get_specific_row_to_display_html( integer $product_id, array $booking_settings )

Prints the existing data for the 'Set Availability by Dates/Months' which allows the admin to enable/disable weekdays, set lockout and price for the same.

Prints the existing data for the 'Set Availability by Dates/Months' which allows the admin to enable/disable weekdays, set lockout and price for the same.

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings

Since

4.0.0
public static
# bkap_load_time_slots( )

Displays Time Slots present for a product

Displays Time Slots present for a product

Since

4.5.0
public static
# bkap_get_pagination_for_time_slots( integer $bkap_per_page_time_slots, integer $bkap_total_time_slots_number, integer $bkap_total_pages, string $bkap_encode_booking_times )

Create pagination links for the Time Slots table.

Create pagination links for the Time Slots table.

Parameters

$bkap_per_page_time_slots
  • Number of Time Slots to be displayed per page.
$bkap_total_time_slots_number
  • Number of slots present for the product.
$bkap_total_pages
  • Total Number of pages that need to be displayed.
$bkap_encode_booking_times
  • JSON Encoded time slots data

Since

4.5.0
public static
# bkap_get_date_time_html( integer $product_id, array $booking_settings = array() )

Displays the Time Slots data in the Availability tab.

Displays the Time Slots data in the Availability tab.

Parameters

$product_id
  • Product ID
$booking_settings

Since

4.0.0
public static
# bkap_get_daydate_and_time_heading( integer $product_id, array $booking_settings, string $bkap_display_time_slots_pagination, integer $bkap_per_page_time_slots, integer $bkap_total_time_slots_number, integer $bkap_total_pages, string $bkap_encode_booking_times )

Displays the table headers for the Time Slots table in Booking meta box->Availability tab.

Displays the table headers for the Time Slots table in Booking meta box->Availability tab.

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings
$bkap_display_time_slots_pagination
  • Display pagination or no. Blanks - indicates Yes
$bkap_per_page_time_slots
  • Time Slots to be displayed per page
$bkap_total_time_slots_number
  • Total Number of Slots
$bkap_total_pages
  • Number of pages
$bkap_encode_booking_times
  • JSON encoded time slots data

Since

4.5.0
public static
# bkap_get_daydate_and_time_table_base_data( integer $product_id, array $booking_settings )

Add the default row for the time slots table. This row is used to add other data when the New icon is clicked.

Add the default row for the time slots table. This row is used to add other data when the New icon is clicked.

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings

Since

4.0.0
public static
# bkap_save_settings( )

This function saves the data from the tabs. Different save buttons are present in each tab. They all will call this function, which will check the data present and save the same.

This function saves the data from the tabs. Different save buttons are present in each tab. They all will call this function, which will check the data present and save the same.

Since

4.0.0
public
# setup_data( integer $product_id, stdClass $clean_booking_options, stdClass $clean_settings_data, $ranges_array, $clean_gcal_data, $clean_fixed_block_data, $clean_price_range_data )

Creates the data to be saved in the DB when either the Save button is clicked from one of the tabs or the product is Published/Updated.

Creates the data to be saved in the DB when either the Save button is clicked from one of the tabs or the product is Published/Updated.

Parameters

$product_id
$clean_booking_options
$clean_settings_data
$ranges_array
$clean_gcal_data
$clean_fixed_block_data
$clean_price_range_data

Since

4.0.0
public array
# create_date_list( str $dates_string )

Receives a string which contains a list of dates and the number of recurring years. It splits it into an array where the date is the key and the number of years is the value

Receives a string which contains a list of dates and the number of recurring years. It splits it into an array where the date is the key and the number of years is the value

Parameters

$dates_string

String format is as below: date1,date2+years;date3+years;....

Returns

array
$dates_array

Since

4.0.0
public array
# create_specific_price_list( string $dates_string )

Creates and returns an array of specific dates with their prices

Creates and returns an array of specific dates with their prices

Parameters

$dates_string
  • Specific Dates with the prices

Returns

array
$dates_array - [date] = 'Price'

Since

4.0.0
public array
# create_range_data( string $range_string )

Returns an array of the custom ranges data. This includes the Ranges setup using 'Custom Range' as well as 'Range of Months'.

Returns an array of the custom ranges data. This includes the Ranges setup using 'Custom Range' as well as 'Range of Months'.

Parameters

$range_string
  • Contains the data passed from the table in string format

Returns

array
$range_array - Array with keys 'start', 'end', years_to_recur' and 'range_type'

Since

4.0.0
public
# update_single_post_meta( integer $product_id, array $booking_options, array $settings_data, array $block_ranges, $gcal_data )

Updates the individual booking settings data in the post meta table.

Updates the individual booking settings data in the post meta table.

Parameters

$product_id
  • Product ID
$booking_options
  • Data for Booking Options tab
$settings_data
  • Data for Availability tab
$block_ranges
  • Data for Block Pricing tab
$gcal_data
Data for Google Sync Settings tab

Since

4.0.0
public
# update_serialized_post_meta( integer $product_id, array $booking_options, array $settings_data, array $block_ranges, $gcal_data )

Updates the 'woocommerce_booking_settings' record in postmeta table for the product.

Updates the 'woocommerce_booking_settings' record in postmeta table for the product.

Parameters

$product_id
  • Product ID
$booking_options
  • Data for Booking Options tab
$settings_data
  • Data for Availability tab
$block_ranges
  • Data for Block Pricing tab
$gcal_data
Data for Google Sync Settings tab

Since

4.0.0
public
# update_bkap_history_only_days( integer $product_id, array $settings_data )

Updates the Booking History table for Only Days Booking Type

Updates the Booking History table for Only Days Booking Type

Parameters

$product_id
  • Product ID
$settings_data
  • Data for Availability tab

Since

4.0.0
public
# update_bkap_history_date_time( integer $product_id, array $settings_data )

Updates the Booking History table for Date & Time Booking Type

Updates the Booking History table for Date & Time Booking Type

Parameters

$product_id
  • Product ID
$settings_data
  • Data for Availability tab

Since

4.0.0
public
# bkap_delete_specific_range( )

Called when a record from the Set Availability by Dates/Months Table in Booking meta box->Availability tab needs to be deleted.

Called when a record from the Set Availability by Dates/Months Table in Booking meta box->Availability tab needs to be deleted.

Called via AJAX

Since

4.0.0
public
# delete_ranges( integer $product_id, string $record_type, string $start, string $end )

Deletes a record from the Set Availability by Dates/Months Table in Booking meta box->Availability tab.

Deletes a record from the Set Availability by Dates/Months Table in Booking meta box->Availability tab.

Parameters

$product_id
  • Product ID
$record_type
  • Such as 'range_of_months', 'custom_range' and so on.
$start
  • Start Date
$end
  • End Date

Since

4.0.0
public integer
# get_range_key( array $range, string $start, string $end )

Returns the array key from a given range if a match is found.

Returns the array key from a given range if a match is found.

Parameters

$range
  • array to search
$start
  • start date (j-n-Y)
$end
  • end date (j-n-Y)

Returns

integer
$key - array key

Since

4.0.0
public
# delete_single_range( integer $product_id, string $range_name, integer $key )

Deletes a given array record from the individual booking settings in postmeta.

Deletes a given array record from the individual booking settings in postmeta.

Parameters

$product_id
  • Product ID
$range_name
  • Meta Key from which the data needs to be removed.
$key
  • Array key to be removed.

Since

4.0.0
public
# delete_serialized_range( integer $product_id, string $name, integer $key )

Deletes a record from a given range in the serialized booking settings i.e. woocommerce_booking_settings in postmeta table.

Deletes a record from a given range in the serialized booking settings i.e. woocommerce_booking_settings in postmeta table.

Parameters

$product_id
  • Product ID
$name
  • contains the array key name
$key
  • Array key to be unset

Since

4.0.0
public
# delete_specific_date( integer $product_id, string $date )

Updates a specific date record to inactive status in booking history table for a given date.

Updates a specific date record to inactive status in booking history table for a given date.

Parameters

$product_id
  • Product ID
$date
  • j-n-Y Format

Since

4.0.0
public
# delete_special_price( integer $product_id, string $date )

Deletes the special price record from post meta for a given specific date.

Deletes the special price record from post meta for a given specific date.

Parameters

$product_id
  • Product ID
$date
  • Date for which the data needs to be removed.

Since

4.0.0
public static
# bkap_delete_date_time( )

Deletes the Date/Day and Time Slot from the Date & Time table in the Availability settings

Deletes the Date/Day and Time Slot from the Date & Time table in the Availability settings

Called via ajax

Since

4.0.0
public
# delete_serialized_time_settings( integer $product_id, string $day_value, string $from_time, string $to_time )

Deletes the time slot from the serialized post meta record i.e. woocommerce_booking_settings in postmeta table.

Deletes the time slot from the serialized post meta record i.e. woocommerce_booking_settings in postmeta table.

Parameters

$product_id
  • Product ID
$day_value
  • Weekday/Date
$from_time
  • H:i
$to_time
  • H:i

Since

4.0.0
public
# delete_individual_time_settings( integer $product_id, string $day_value, string $from_time, string $to_time )

Deletes the time slot from the _bkap_time_settings post meta record in postmeta table.

Deletes the time slot from the _bkap_time_settings post meta record in postmeta table.

Parameters

$product_id
  • Product ID
$day_value
  • Weekday/Date
$from_time
  • H:i
$to_time
  • H:i

Since

4.0.0
public array
# unset_time_array( array $existing_settings, string $day_value, string $from_time, string $to_time )

Unsets the time slots record which needs to be removed from the list of time slots present for the product.

Unsets the time slots record which needs to be removed from the list of time slots present for the product.

Parameters

$existing_settings
  • Existing Time Slots for the Product
$day_value
  • Weekday/Date
$from_time
  • H:i
$to_time
  • H:i

Returns

array
$existing_settings - updated array with the desired slot removed.

Since

4.0.0
public
# delete_booking_history( integer $product_id, string $day_value, string $from_time = '', string $to_time = '' )

Updates the Booking History table. Removes/Inactivates the desired records for the deleted time slot.

Updates the Booking History table. Removes/Inactivates the desired records for the deleted time slot.

Parameters

$product_id
  • Product ID
$day_value
  • Weekday/Date
$from_time
  • H:i
$to_time
  • H:i

Since

4.0.0
API documentation generated by ApiGen