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_approve_booking
  • bkap_booking_confirmation
  • BKAP_Payment_Gateway

Class bkap_booking_confirmation

Class for handling Reuires Confirmation feature

Package: BKAP\Booking-Confirmation
Author: Tyche Softwares
Class: bkap_booking_confirmation
Located at booking-confirmation.php

Methods summary

public
# __construct( )

Default constructor

Default constructor

Since

2.5
public
# bkap_confirmations_ajax( )

Ajax Calls for the Confirmation feature.

Ajax Calls for the Confirmation feature.

Since

2.5

Hook

admin_init
public
# confirmation_checkbox( integer $product_id )

Add a Requires Confirmation checkbox in the Booking meta box

Add a Requires Confirmation checkbox in the Booking meta box

Parameters

$product_id
  • Product ID

Since

2.5

Hook

bkap_after_purchase_wo_date
public array
# save_product_settings( array $booking_settings, integer $product_id )

Save the Requires Confirmation setting in Booking meta box

Save the Requires Confirmation setting in Booking meta box

Parameters

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

Returns

array
$booking_settings - Updated settings

Since

2.5

Hook

bkap_save_product_settings
public
# change_button_text( string $var )

Modify the Add to cart button text for products that require confirmations

Modify the Add to cart button text for products that require confirmations

Parameters

$var
  • Text for the button

Since

2.5

Hook

woocommerce_product_single_add_to_cart_text
public boolean
# bkap_cart_requires_confirmation( boolean $needs_payment, WC()->cart $cart )

Return true if the cart contains a product that requires confirmation. In this scenario no payment is taken at Checkout

Return true if the cart contains a product that requires confirmation. In this scenario no payment is taken at Checkout

Parameters

$needs_payment
$cart

Returns

boolean

Since

2.5

Hook

woocommerce_cart_needs_payment
public array
# bkap_remove_payment_methods( array $available_gateways )

Modify Payment Gateways

Modify Payment Gateways

Remove the existing payment gateways and add the Bookign payment gateway when the Cart contains a product that requires confirmation.

Parameters

$available_gateways
  • Array containing all the Payment Gateways

Returns

array
$available_gateways - Array containing the Payment Gateways

Since

2.5

Hook

woocommerce_available_payment_gateways
public boolean
# bkap_prevent_cancel( boolean $return, WC_Order $order )

Prevent Order Cancellation

Prevent Order Cancellation

Prevent WooCommerce from cancelling an order if the order contains an item that is awaiting booking confirmation once Hold Stock limit is reached.

Parameters

$return
$order

Returns

boolean
$return

Since

2.5

Hook

woocommerce_cancel_unpaid_order
public array
# bkap_my_orders_actions( array $actions, WC_Order $order )

Hide the Pay button in My Accounts

Hide the Pay button in My Accounts

Hide the Pay button in My Accounts for orders that contain an item that's still awaiting booking confirmation.

Parameters

$actions
  • List of Actions for an order on My Account page
$order

Returns

array
$actions - List of Actions for an order on My Account page

Since

2.5
public
# bkap_link_header( )

Create a column in WooCommerce->Orders->Edit Orders page for each item

Create a column in WooCommerce->Orders->Edit Orders page for each item

Since

2.5

Hook

woocommerce_admin_order_item_headers
public
# bkap_link( WC_Product $_product, WC_Product_Item $item, integer $item_id )

Display View Booking Link

Display View Booking Link

Add the View Booking Link for a given item in WooCommerce->orders Edit Orders

Parameters

$_product
  • Product Details
$item
  • Item Details
$item_id
  • Item ID

Since

2.5

Hook

woocommerce_admin_order_item_values
public static
# bkap_save_booking_status( integer $item_id, string $_status )

Update Item status

Update Item status

This function updates the item booking status. It is called from the Edit Booking page Save button click

Parameters

$item_id
  • Item ID
$_status
  • New Booking Status

Since

2.5
public
# update_booking_tables( string $_status, integer $order_id, integer $item_id, WC_Product_Item $item_value, WC_Order $order )

Update the plugin tables and GCal for booking status for each Item ID passed

Update the plugin tables and GCal for booking status for each Item ID passed

Parameters

$_status
  • New Booking Status
$order_id
  • Order ID
$item_id
  • Item ID
$item_value
$item_value - Item Details
$order
  • Order Details

Since

3.5
public string
# bkap_validate_conflicting_products( array $POST, integer $product_id )

Validate bookable products

Validate bookable products

This function displays a notice and empties the cart if the cart contains any products that conflict with the new product being added.

Parameters

$POST
$_POST
$product_id
  • Product ID

Returns

string

Since

2.5

Hook

bkap_validate_cart_products
public
# bkap_update_booking_status( integer $order_id )

Update Booking status to paid

Update Booking status to paid

Updates the Booking status to paid to ensure they do not remain in the Unpaid section in Booking->View Bookings

Parameters

$order_id

Since

2.5

Hook

woocommerce_order_status_processing woocommerce_order_status_on-hold woocommerce_order_status_completed


public
# bkap_remove_cancelled_booking( integer $item_id )

Remove an item from the order if the booking is not approved/rejected/cancelled by the admin

Remove an item from the order if the booking is not approved/rejected/cancelled by the admin

Parameters

$item_id
  • Item ID

Since

2.5
API documentation generated by ApiGen