View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'after_wcfm_products_manage', function( $product_id ) { | |
?> | |
<script type="text/javascript"> | |
jQuery( document ).ready( function( $ ) { | |
function bkap_hide_booking_metabox() { | |
let product_type = $( '#product_type' ).val(); | |
let allowed_type = [ 'simple'/* , 'variable', 'subscription','variable-subscription' */ ]; | |
if ( jQuery.inArray( product_type, allowed_type ) == -1 ) { |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Adding Column on View Bookings */ | |
function bkap_view_booking_columns( $columns ) { | |
$additional_columns = array( 'bkap_customer_email' => __( 'Email Address', 'woocommerce-booking' ) ); | |
// Adding column after Booked by hence 5. | |
$columns = array_slice( $columns, 0, 5, true ) + $additional_columns + array_slice( $columns, 5, count( $columns ) - 5, true ); |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function will add the note information to its respective timeslots. | |
* | |
* @param array $time_drop_down_array Array of timeslots and its lockout. Key will be timeslot and it contains array with has lockout information. | |
* @param array $extra_information Additional Informations. | |
* @since 1.0 | |
*/ | |
function bkap_time_slot_filter( $time_drop_down_array, $extra_information ) { |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adding Special Price to Variable Price. | |
* | |
* @param string $time_slot_price Booking Price. | |
* @param string $product_id Product ID. | |
* @param string $variation_id Variable ID. | |
* @param string $product_type Product type. | |
* |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function bkap_load_defaults(){ | |
?> | |
<script> | |
jQuery( document ).ready( function ( $ ) { | |
if ( jQuery('#bkap-booking-type' ).length > 0 ) { | |
// Enable Booking. | |
jQuery( '#booking_enable_date' ).prop( 'checked', true ); |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function bkap_booking_default_settings() { | |
?> | |
<script> | |
jQuery( document ).ready( function ( $ ) { | |
if ( jQuery('#bkap-booking-type' ).length > 0 ) { | |
// Enable Booking. | |
jQuery('#booking_enable_date').prop( 'checked', true ); |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function limit_booking_types( $booking_types ) { | |
if ( is_admin() ) { | |
return $booking_types; | |
} | |
$booking_types = array(); // Clear previous contents of variable. | |
$group_only_days = 'Only Days'; |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Display Fields | |
function woocommerce_product_base_cost_fields() { | |
global $woocommerce, $post; | |
echo '<div class="product_custom_field">'; | |
// Custom Product Number Field. | |
woocommerce_wp_text_input( |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function bkap_appending_additional_information_to_price( $display_price, $data ) { | |
if ( isset( $data['total_price_calculated'] ) ) { | |
$label = __( 'Full Payment: ', 'woocommerce-booking' ); | |
$full_price = $label . wc_price( $data['total_price_calculated'] ) . '</br>'; | |
$display_price = $full_price . $display_price; | |
} |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enabling the required option for new product. | |
function bkap_enable_option_for_new_product( $booking_checked, $duplicate_of, $booking_settings ) { | |
if ( '' === $booking_settings ) { // enable booking option for new product. | |
$booking_checked = 'checked'; | |
} | |
return $booking_checked; |
NewerOlder