Class bkap_block_booking
Class for handling Fixed Blocks and Price Ranges
Author: Tyche Softwares
Class: bkap_block_booking class
Located at block-pricing.php
Methods summary
public
|
|
public
|
#
bkap_load_ajax_block_pricing( )
This function is used to load ajax functions required for Fixed Blocks & Price Ranges |
public
|
#
bkap_delete_block( )
This function is used to delete existing Fixed blocks from the table in the Booking meta box |
public
|
#
bkap_delete_range( )
This function is used to delete existing Price Ranges from the table in the Booking meta box. |
public
|
#
bkap_delete_all_blocks( )
This function is used to delete all the Fixed Blocks present for a product. |
public
|
#
bkap_delete_all_ranges( )
This function are used to delete all the Price Ranges present for a product. |
public
|
#
bkap_block_pricing_options( )
This function are used to clear block pricing option radio button selection in the Booking meta box. |
public
|
#
block_pricing_tab( $product_id )
This function will add the Block Pricing tab in the Booking meta box. |
public
|
#
bkap_block_pricing_show_field_settings( integer $product_id )
This function add the content for the Booking meta box->Block Pricing tab. |
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. |
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. |
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. |
public
|
#
bkap_fixed_block_display_price( integer $product_id )
This function adds the price div to display the Booking Price on the Product page. |
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. |
public static
|
#
bkap_price_range_booking_table( $product_id, array $booking_settings )
Price By Range Of Days table in Booking meta box->Block Pricing. |
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 |
public static
|
#
bkap_fixed_block_booking_table( integer $product_id, array $booking_settings )
Fixed Blocks table in Booking meta box->Block Pricing. |
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 |
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. |
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. |
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. |
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. |
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 |
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. |
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. |
public static
integer
|
#
bkap_get_fixed_blocks_count( integer $post_id )
This function return the count of Fixed Blocks present for a product. |
public static
array
|
|
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. |
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. |
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. |