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_block_booking

Class bkap_block_booking

Class for handling Fixed Blocks and Price Ranges

Package: BKAP\Block-Pricing
Author: Tyche Softwares
Class: bkap_block_booking class
Located at block-pricing.php

Methods summary

public
# __construct( )

Default constructor

Default constructor

Since

4.1.0
public
# bkap_load_ajax_block_pricing( )

This function is used to load ajax functions required for Fixed Blocks & Price Ranges

This function is used to load ajax functions required for Fixed Blocks & Price Ranges

Since

4.1.0
public
# bkap_delete_block( )

This function is used to delete existing Fixed blocks from the table in the Booking meta box

This function is used to delete existing Fixed blocks from the table in the Booking meta box

Since

4.1.0
public
# bkap_delete_range( )

This function is used to delete existing Price Ranges from the table in the Booking meta box.

This function is used to delete existing Price Ranges from the table in the Booking meta box.

Since

4.1.0
public
# bkap_delete_all_blocks( )

This function is used to delete all the Fixed Blocks present for a product.

This function is used to delete all the Fixed Blocks present for a product.

Since

4.1.0
public
# bkap_delete_all_ranges( )

This function are used to delete all the Price Ranges present for a product.

This function are used to delete all the Price Ranges present for a product.

Since

4.1.0
public
# bkap_block_pricing_options( )

This function are used to clear block pricing option radio button selection in the Booking meta box.

This function are used to clear block pricing option radio button selection in the Booking meta box.

Since

4.1.0
public
# block_pricing_tab( $product_id )

This function will add the Block Pricing tab in the Booking meta box.

This function will add the Block Pricing tab in the Booking meta box.

Since

4.1.0

Hook

bkap_add_tabs
public
# bkap_block_pricing_show_field_settings( integer $product_id )

This function add the content for the Booking meta box->Block Pricing tab.

This function add the content for the Booking meta box->Block Pricing tab.

Parameters

$product_id
Product ID

Since

4.1.0

Hook

bkap_after_listing_enabled
public static array
# bkap_updating_fixed_block_data_in_db( $product_id, object $clean_fixed_block_data )

Create and return an array of Fixed Blocks data. Executed when settings are saved using either from the Booking meta box or the product is saved/updated.

Create and return an array of Fixed Blocks data. Executed when settings are saved using either from the Booking meta box or the product is saved/updated.

Parameters

$product_id
ID
$clean_fixed_block_data

Returns

array
$array_of_all_fixed_block_data

Since

4.1.0
public static array
# bkap_updating_price_range_data_in_db( $product_id, object $clean_price_range_data )

Create and return an array of Price Ranges data. Executed when settings are saved using either from the Booking meta box or the product is saved/updated.

Create and return an array of Price Ranges data. Executed when settings are saved using either from the Booking meta box or the product is saved/updated.

Parameters

$product_id
ID
$clean_price_range_data

Returns

array
$array_of_all_price_range_data

Since

4.1.0
public
# bkap_fixed_block_booking_after_add_to_cart( $product_id )

This function add the fixed block dropdown on the frontend product page as per the settings selected when Enable Fixed Block Booking is enabled.

This function add the fixed block dropdown on the frontend product page as per the settings selected when Enable Fixed Block Booking is enabled.

Parameters

$product_id
Product ID

Since

4.1.0

Hook

bkap_before_booking_form
public
# bkap_fixed_block_display_price( integer $product_id )

This function adds the price div to display the Booking Price on the Product page.

This function adds the price div to display the Booking Price on the Product page.

Parameters

$product_id
  • Product ID

Since

4.1.0

Hook

bkap_display_price_div
public
# bkap_enable_price_by_range_or_fixed_block_booking( integer $duplicate_of )

This function is to display Block Pricing radio button settings in Booking meta box->Block Pricing tab.

This function is to display Block Pricing radio button settings in Booking meta box->Block Pricing tab.

Parameters

$duplicate_of
  • Product ID

Since

4.1.0
public static
# bkap_price_range_booking_table( $product_id, array $booking_settings )

Price By Range Of Days table in Booking meta box->Block Pricing.

Price By Range Of Days table in Booking meta box->Block Pricing.

Parameters

$product_id
Product ID
$booking_settings
  • Booking Settings for the product.

Since

4.1.0
public static
# bkap_get_price_range_booking_heading( integer $product_id, array $booking_settings )

Echoes the Column Headers for the Price Ranges table in Booking meta box->Block Pricing

Echoes the Column Headers for the Price Ranges table in Booking meta box->Block Pricing

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings for the product.

Since

4.1.0
public static
# bkap_fixed_block_booking_table( integer $product_id, array $booking_settings )

Fixed Blocks table in Booking meta box->Block Pricing.

Fixed Blocks table in Booking meta box->Block Pricing.

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings for the product.

Since

4.1.0
public static
# bkap_get_fixed_block_booking_heading( integer $product_id, array $booking_settings )

Echoes the Column Headers for the Fixed Blocks table in Booking meta box->Block Pricing

Echoes the Column Headers for the Fixed Blocks table in Booking meta box->Block Pricing

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings for the product.

Since

4.1.0
public static
# bkap_get_fixed_block_booking_base_data( integer $product_id, array $booking_settings )

Adds a base table row for Booking meta box->Block Pricing->Fixed Blocks. Used when adding a new row to the table.

Adds a base table row for Booking meta box->Block Pricing->Fixed Blocks. Used when adding a new row to the table.

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings for the product.

Since

4.1.0
public static
# bkap_get_price_range_base_data( integer $product_id, array $booking_settings )

Adds a base table row for Booking meta box->Block Pricing->Price Ranges. Used when adding a new row to the table.

Adds a base table row for Booking meta box->Block Pricing->Price Ranges. Used when adding a new row to the table.

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings for the product.

Since

4.1.0
public static
# bkap_get_price_range_booking( integer $product_id, array $booking_settings )

Displays the existing Price Ranges in Booking meta box->Block Pricing->Price Ranges as per the saved data.

Displays the existing Price Ranges in Booking meta box->Block Pricing->Price Ranges as per the saved data.

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings for the product.

Since

4.1.0
public static
# bkap_get_fixed_block_booking( integer $product_id, array $booking_settings )

Displays the existing Fixed Blocks in Booking meta box->Block Pricing->Fixed Blocks as per the saved data.

Displays the existing Fixed Blocks in Booking meta box->Block Pricing->Fixed Blocks as per the saved data.

Parameters

$product_id
  • Product ID
$booking_settings
  • Booking Settings for the product.

Since

4.1.0
public
# bkap_fixed_block_show_updated_price( integer $product_id, string $product_type, integer $variation_id, string $checkin_date, string $checkout_date, string $currency_selected )

This function is used to clculate and show the booking price when Fixed Blocks are used

This function is used to clculate and show the booking price when Fixed Blocks are used

Parameters

$product_id
  • Product ID
$product_type
  • Product Type
$variation_id
  • Variation ID, 0 for simple products
$checkin_date
  • Booking start date
$checkout_date
  • Booking end date
$currency_selected
  • Currency such as USD, AUD etc.

Since

4.1.0

Hook

bkap_display_multiple_day_updated_price
public
# bkap_price_range_show_updated_price( integer $product_id, string $product_type, integer $variation_id_to_fetch, string $checkin_date, string $checkout_date, string $currency_selected )

This function is used to clculate and show the booking price when Price Ranges are used.

This function is used to clculate and show the booking price when Price Ranges are used.

Parameters

$product_id
  • Product ID
$product_type
  • Product Type
$variation_id_to_fetch
$variation_id - Variation ID, 0 for simple products
$checkin_date
  • Booking start date
$checkout_date
  • Booking end date
$currency_selected
  • Currency such as USD, AUD etc.

Since

4.1.0

Hook

bkap_display_multiple_day_updated_price
public static string
# price_range_calculate_price( $product_id, string $product_type, integer $variation_id, integer $number, array $variations_selected )

Returns the booking price applicable when Price Ranges is enabled.

Returns the booking price applicable when Price Ranges is enabled.

Parameters

$product_id
Product ID
$product_type
  • Product Type
$variation_id
  • Variation ID, 0 for simple products.
$number
  • Number of nights being booked
$variations_selected
  • Attributes selected and their values.

Returns

string
$price Price based on the price by range

Since

4.1.0
public static integer
# bkap_get_fixed_blocks_count( integer $post_id )

This function return the count of Fixed Blocks present for a product.

This function return the count of Fixed Blocks present for a product.

Parameters

$post_id
  • Product ID

Returns

integer
Count of Blocks present.

Since

4.1.0
public static array
# bkap_get_fixed_blocks( integer $post_id )

Returns the Fixed Blocks present for a product.

Returns the Fixed Blocks present for a product.

Parameters

$post_id
  • Product ID

Returns

array
Fixed Blocks for the product.

Since

4.1.0
public string
# bkap_get_translated_texts( string $get_translated_text, string $message, string $language )

This function will return translated string for the Fixed Block names.

This function will return translated string for the Fixed Block names.

Parameters

$get_translated_text
$message
  • Message being translated
$language
  • Language to be translated to

Returns

string
$translated - Translated Data

Since

4.1.0
public
# price_range_product_duplicate( integer $new_id, integer $old_id )

This function will ensure that when a new product is created as a duplicate of an existing one, then the Pricing Options (Fixed Blocks and Price Ranges) are also copied alongwith the other settings.

This function will ensure that when a new product is created as a duplicate of an existing one, then the Pricing Options (Fixed Blocks and Price Ranges) are also copied alongwith the other settings.

Parameters

$new_id
  • ID of the Product being created
$old_id
  • ID of the product being copied from.

Since

4.1.0

Hook

bkap_product_addon_duplicate
public
# bkap_price_range_booking_after_add_to_cart( $product_id )

This function adds hidden fields on the frontend product page if Price Ranges are enabled.

This function adds hidden fields on the frontend product page if Price Ranges are enabled.

Parameters

$product_id
Product ID

Since

4.1.0

Hook

bkap_before_booking_form
API documentation generated by ApiGen