• Resolved pervasiveconcierge

    (@pervasiveconcierge)


    Hello, I’m trying to render the calendar editor on the frontend. I’ve successfully rendered the form lists and booking appointments on the frontend but I’m having issues with the calendar editor which I believe is due to JS & CSS. Part of the template displays but the calendar editor does not nor does the icons have the click ability. However, the select dropdown works and if I change the style display to block the calendar field options display like input title. Can you please assist me?

    Here’s how it appears on the frontend: https://prntscr.com/10t30rn

    To successfully render the other admin files I copied them to my theme using the same template path, edited the classes then shortcoded the templates.

    Here’s my code:

    function load_view_calendar_editor_template() {
      ob_start();
       get_template_part( '/booking-activities/view/view-templates' );
       wp_enqueue_style ( 'bookacti-css-fullcalendar',				plugins_url( 'lib/fullcalendar/fullcalendar.min.css', __FILE__ ),		array(), BOOKACTI_VERSION );
       wp_enqueue_style ( 'bookacti-css-fullcalendar-print',		plugins_url( 'lib/fullcalendar/fullcalendar.print.min.css', __FILE__ ),	array( 'bookacti-css-fullcalendar' ), BOOKACTI_VERSION, 'print' );
      return ob_get_clean();
    }
    add_shortcode( 'view_bookings_activities_calendar_editor', 'load_view_calendar_editor_template' );

    For anyone else that wants to render these files:

    Create Folder called “booking-activities’, copy booking activities folders “class” & “view’

    in /example.com/wp-content/themes/your-current-theme/booking-activities/view/view-bookings.php

    replace the code with `<?php
    //This is a copy
    /**
    * Booking list page
    * @version 1.9.2
    */

    // Exit if accessed directly
    if ( ! defined( ‘ABSPATH’ ) ) { exit; }
    ?>

    <?php
    /* This is a my edit */

    if( ! class_exists( ‘Bookings_List_Tabless’ ) ) {
    require_once( trailingslashit( get_template_directory() ). ‘/booking-activities/class/class-bookings-list.php’ );
    }
    ?>

    <div class=’wrap’>
    <h1 class=’wp-heading-inline’><?php esc_html_e( ‘Bookings’, ‘booking-activities’ ); ?></h1>
    <?php do_action( ‘bookacti_booking_list_page_header’ ); ?>
    <hr class=’wp-header-end’>

    <?php
    $templates = bookacti_fetch_templates();
    if( ! $templates ) {
    $editor_path = ‘admin.php?page=bookacti_calendars’;
    $editor_url = admin_url( $editor_path );
    ?>
    <div id=’bookacti-first-template-container’ >
    <h2>
    <?php
    /* translators: %1$s and %2$s delimit the link to Calendar Editor page. */
    echo sprintf( esc_html__( ‘Welcome! It seems you don\’t have any calendar yet. Go to %1$sCalendar Editor%2$s to create your first calendar.’, ‘booking-activities’ ), ‘<a href=”‘ . esc_url( $editor_url ) . ‘” >’, ‘</a>’ );
    ?>
    </h2>
    </div>
    </div><!– end of wp wrap –>
    <?php
    exit;
    }

    // Format templates from URL
    $available_template_ids = array_map( ‘intval’, array_keys( $templates ) );
    $desired_templates = isset( $_REQUEST[ ‘templates’ ] ) && is_array( $_REQUEST[ ‘templates’ ] ) ? array_filter( array_map( ‘intval’, $_REQUEST[ ‘templates’ ] ) ) : array();

    $had_templates = ! empty( $desired_templates );
    $bypass_template_managers_check = apply_filters( ‘bookacti_bypass_template_managers_check’, false );
    $all_templates = $bypass_template_managers_check || is_super_admin();
    $allowed_templates = ! $all_templates ? array_values( array_intersect( $desired_templates, $available_template_ids ) ) : $desired_templates;
    $selected_templates = ! empty( $allowed_templates ) ? $allowed_templates : ( ! $had_templates && $available_template_ids ? $available_template_ids : array( ‘none’ ) );

    $templates_select_options = array();
    foreach( $templates as $template_id => $template ) {
    $templates_select_options[ $template_id ] = esc_html( $template[ ‘title’ ] );
    }
    ?>

    <div id=’bookacti-bookings-container’ >
    <div id=’bookacti-bookings-filters-container’ >
    <form id=’bookacti-booking-list-filters-form’ action=”>
    <input type=’hidden’ name=’page’ value=’bookacti_bookings’/>
    <?php
    // Display sorting data
    if( ! empty( $_GET[ ‘orderby’ ] ) || ! empty( $_GET[ ‘order_by’ ] ) ) {
    $order_by = ! empty( $_GET[ ‘order_by’ ] ) ? $_GET[ ‘order_by’ ] : $_GET[ ‘orderby’ ];
    if( ! is_array( $order_by ) ) {
    $order_by = array( $order_by );
    }
    $i=0;
    foreach( $order_by as $column_name ) {
    if( $i === 0 ) {
    echo ‘<input type=”hidden” name=”orderby” value=”‘ . esc_attr( $column_name ) . ‘” />’;
    }
    echo ‘<input type=”hidden” name=”order_by[‘ . $i . ‘]” value=”‘ . esc_attr( $column_name ) . ‘” />’;
    ++$i;
    }
    }
    if( ! empty( $_GET[ ‘order’ ] ) ) {
    echo ‘<input type=”hidden” name=”order” value=”‘ . esc_attr( $_GET[ ‘order’ ] ) . ‘” />’;
    }
    if( ! empty( $_GET[ ‘group_by’ ] ) ) {
    echo ‘<input type=”hidden” name=”group_by” value=”‘ . esc_attr( $_GET[ ‘group_by’ ] ) . ‘” />’;
    }

    // Display nonce field
    wp_nonce_field( ‘bookacti_get_booking_list’, ‘nonce_get_booking_list’, false );

    do_action( ‘bookacti_before_booking_filters’ );
    ?>
    <div id=’bookacti-templates-filter-container’ class=’bookacti-filter-container’ style='<?php if( count( $templates_select_options ) < 2 ) { echo ‘display:none;’; } ?>’>
    <div id=’bookacti-templates-filter-title’ class=’bookacti-filter-title’>
    <?php esc_html_e( ‘Calendars’, ‘booking-activities’ ); ?>
    </div>
    <div id=’bookacti-templates-filter-content’ class=’bookacti-filter-content’>
    <?php
    $args = array(
    ‘type’ => ‘select’,
    ‘name’ => ‘templates’,
    ‘id’ => ‘bookacti-booking-filter-templates’,
    ‘options’ => $templates_select_options,
    ‘value’ => $all_templates ? array() : $selected_templates,
    ‘multiple’ => true
    );
    bookacti_display_field( $args );
    ?>
    </div>
    </div>
    <div id=’bookacti-activities-filter-container’ class=’bookacti-filter-container’>
    <div class=’bookacti-filter-title’ >
    <?php esc_html_e( ‘Activities’, ‘booking-activities’ ); ?>
    </div>
    <div class=’bookacti-filter-content’>
    <?php
    // Format activities from URL
    $activities = bookacti_fetch_activities_with_templates_association( $available_template_ids );
    $activities_select_options = array();
    foreach ( $activities as $activity_id => $activity ) {
    $activities_select_options[ $activity_id ] = esc_html( apply_filters( ‘bookacti_translate_text’, $activity[ ‘title’ ] ) );
    }
    $selected_activities = isset( $_REQUEST[ ‘activities’ ] ) ? $_REQUEST[ ‘activities’ ] : array();
    $args = array(
    ‘type’ => ‘select’,
    ‘name’ => ‘activities’,
    ‘id’ => ‘bookacti-booking-filter-activities’,
    ‘options’ => $activities_select_options,
    ‘value’ => array_map( ‘intval’, $selected_activities ),
    ‘multiple’ => true
    );
    bookacti_display_field( $args );
    ?>
    </div>
    </div>
    <div id=’bookacti-status-filter-container’ class=’bookacti-filter-container’ >
    <div class=’bookacti-filter-title’ >
    <?php echo esc_html_x( ‘Status’, ‘Booking status’, ‘booking-activities’ ); ?>
    </div>
    <div class=’bookacti-filter-content’>
    <?php
    // Format status from URL
    $default_status = get_user_meta( get_current_user_id(), ‘bookacti_status_filter’, true );
    $default_status = is_array( $default_status ) ? $default_status : array( ‘delivered’, ‘booked’, ‘pending’, ‘cancelled’, ‘refunded’, ‘refund_requested’ );
    $statuses = bookacti_get_booking_state_labels();
    $status_select_options = array();
    foreach ( $statuses as $status_id => $status ) {
    $status_select_options[ $status_id ] = esc_html( $status[ ‘label’ ] );
    }
    $selected_status = isset( $_REQUEST[ ‘status’ ] ) ? $_REQUEST[ ‘status’ ] : $default_status;
    $selected_status = is_array( $selected_status ) ? $selected_status : array( $selected_status );
    $args = array(
    ‘type’ => ‘select’,
    ‘name’ => ‘status’,
    ‘id’ => ‘bookacti-booking-filter-status’,
    ‘options’ => $status_select_options,
    ‘value’ => $selected_status,
    ‘multiple’ => true
    );
    bookacti_display_field( $args );

    // Update user default status filter
    if( $selected_status != $default_status && empty( $_REQUEST[ ‘keep_default_status’ ] ) ) {
    update_user_meta( get_current_user_id(), ‘bookacti_status_filter’, $selected_status );
    }
    ?>
    </div>
    </div>
    <div id=’bookacti-dates-filter-container’ class=’bookacti-filter-container’ >
    <div class=’bookacti-filter-title’ >
    <?php esc_html_e( ‘Date’, ‘booking-activities’ ); ?>
    </div>
    <div class=’bookacti-filter-content’ >
    <?php
    $from = isset( $_REQUEST[ ‘from’ ] ) ? bookacti_sanitize_date( $_REQUEST[ ‘from’ ] ) : ”;
    $to = isset( $_REQUEST[ ‘to’ ] ) ? bookacti_sanitize_date( $_REQUEST[ ‘to’ ] ) : ”;
    if( ! $from ) { $from = isset( $_REQUEST[ ‘from’ ] ) ? substr( bookacti_sanitize_datetime( $_REQUEST[ ‘from’ ] ), 0, 10 ) : ”; }
    if( ! $to ) { $to = isset( $_REQUEST[ ‘to’ ] ) ? substr( bookacti_sanitize_datetime( $_REQUEST[ ‘to’ ] ), 0, 10 ) : ”; }
    ?>
    <div><label for=’bookacti-booking-filter-dates-from’><?php /* translators: Followed by a date. E.g.: From 04/02/2021. */ echo esc_html_x( ‘From’, ‘date’, ‘booking-activities’ ) . ‘ ‘; ?></label><input type=’date’ name=’from’ id=’bookacti-booking-filter-dates-from’ value='<?php echo $from; ?>’ ></div>
    <div><label for=’bookacti-booking-filter-dates-to’><?php /* translators: Followed by a date. E.g.: To 04/02/2021. */ echo esc_html_x( ‘To’, ‘date’, ‘booking-activities’ ) . ‘ ‘; ?></label><input type=’date’ name=’to’ id=’bookacti-booking-filter-dates-to’ value='<?php echo $to; ?>’ ></div>
    </div>
    </div>
    <div id=’bookacti-customer-filter-container’ class=’bookacti-filter-container’ >
    <div class=’bookacti-filter-title’ >
    <?php esc_html_e( ‘Customer’, ‘booking-activities’ ); ?>
    </div>
    <div class=’bookacti-filter-content’ >
    <?php
    $selected_user = isset( $_REQUEST[ ‘user_id’ ] ) ? esc_attr( $_REQUEST[ ‘user_id’ ] ) : ”;
    $args = apply_filters( ‘bookacti_booking_list_user_selectbox_args’, array(
    ‘name’ => ‘user_id’,
    ‘id’ => ‘bookacti-booking-filter-customer’,
    ‘show_option_all’ => esc_html__( ‘All’, ‘booking-activities’ ),
    ‘option_label’ => array( ‘first_name’, ‘ ‘, ‘last_name’, ‘ (‘, ‘user_login’, ‘ / ‘, ‘user_email’, ‘)’ ),
    ‘selected’ => $selected_user,
    ‘allow_clear’ => 1,
    ‘allow_tags’ => 1,
    ‘echo’ => 1
    ));
    bookacti_display_user_selectbox( $args );
    ?>
    </div>
    </div>
    <?php
    do_action( ‘bookacti_after_booking_filters’ );
    $user_calendar_settings = bookacti_format_bookings_calendar_settings( get_user_meta( get_current_user_id(), ‘bookacti_bookings_calendar_settings’, true ) );
    ?>
    <div id=’bookacti-actions-filter-container’ class=’bookacti-filter-container’>
    <div class=’bookacti-filter-title’ >
    <?php esc_html_e( ‘Actions’, ‘booking-activities’ ); ?>
    </div>
    <div class=’bookacti-filter-content’ >
    <input type=’submit’ class=’button button-primary button-large’ id=’bookacti-submit-filter-button’ value='<?php esc_html_e( ‘Filter the list’, ‘booking-activities’ ); ?>’ title='<?php esc_html_e( ‘Filter the list’, ‘booking-activities’ ); ?>’ data-ajax='<?php echo $user_calendar_settings[ ‘ajax’ ] ? 1 : 0; ?>’/>
    <input type=’button’ class=’button button-primary button-large bookacti-export-bookings-button’ value='<?php esc_html_e( ‘Export bookings’, ‘booking-activities’ ); ?>’ title='<?php esc_html_e( ‘Export bookings’, ‘booking-activities’ ); ?>’/>
    </div>
    </div>
    <div id=’bookacti-event-filter-container’>
    <div class=’bookacti-filter-title’>
    <span><?php esc_html_e( ‘Booking calendar’, ‘booking-activities’ ); ?></span>
    <span id=’bookacti-bookings-calendar-settings’ class=’dashicons dashicons-admin-generic’></span>
    </div>
    <div class=’bookacti-filter-content’>
    <?php
    // Get selected (group of) event(s) data (if any)
    $picked_events = ! empty( $_REQUEST[ ‘selected_events’ ] ) ? bookacti_format_picked_events( $_REQUEST[ ‘selected_events’ ] ) : array();

    $calendar_button_label_show = esc_html__( ‘Show calendar’, ‘booking-activities’ );
    $calendar_button_label_hide = esc_html__( ‘Hide calendar’, ‘booking-activities’ );
    $calendar_button_label = $picked_events || $user_calendar_settings[ ‘show’ ] ? $calendar_button_label_hide : $calendar_button_label_show;
    ?>
    <a class=’button’ id=’bookacti-pick-event-filter’ title='<?php echo $calendar_button_label; ?>’ data-label-hide='<?php echo $calendar_button_label_hide; ?>’ data-label-show='<?php echo $calendar_button_label_show; ?>’>
    <?php echo $calendar_button_label; ?>
    </a>
    <span id=’bookacti-pick-event-filter-instruction’ <?php if( $picked_events || ! $user_calendar_settings[ ‘show’ ] ) { echo ‘style=”display:none;”‘; } ?>>
    <?php esc_html_e( ‘Pick an event to filter the booking list.’, ‘booking-activities’ ); ?>
    </span>
    <a class=’button’ id=’bookacti-unpick-events-filter’ title='<?php esc_html_e( ‘Unpick events’, ‘booking-activities’ ); ?>’ <?php if( ! $picked_events ) { echo ‘style=”display:none;”‘; } ?>>
    <?php esc_html_e( ‘Unpick events’, ‘booking-activities’ ); ?>
    </a>
    <span id=’bookacti-picked-events-actions-container’ <?php if( ! $picked_events ) { echo ‘style=”display:none;”‘; } ?>>
    <input type=’submit’ class=’button button-primary button-large’ value='<?php esc_html_e( ‘Filter the list’, ‘booking-activities’ ); ?>’ title='<?php esc_html_e( ‘Filter the list’, ‘booking-activities’ ); ?>’/>
    <input type=’button’ class=’button button-primary button-large bookacti-export-bookings-button’ value='<?php esc_html_e( ‘Export bookings’, ‘booking-activities’ ); ?>’ title='<?php esc_html_e( ‘Export bookings’, ‘booking-activities’ ); ?>’/>
    </span>
    </div>
    </div>
    <div id=’bookacti-booking-system-filter-container’ <?php if( ! $picked_events && ! $user_calendar_settings[ ‘show’ ] ) { echo ‘style=”display:none;”‘; } ?>>
    <?php
    // Display data
    $display_data = array();
    $default_display_data = bookacti_get_booking_system_default_display_data();
    foreach( $default_display_data as $name => $default_value ) {
    $display_data[ $name ] = ! empty( $user_calendar_settings[ $name ] ) ? $user_calendar_settings[ $name ] : $default_value;
    }

    // Display the booking system
    $atts = apply_filters( ‘bookacti_bookings_booking_system_attributes’, array(
    ‘bookings_only’ => 1,
    ‘calendars’ => $selected_templates,
    ‘status’ => $selected_status,
    ‘user_id’ => $selected_user,
    ‘group_categories’ => array(),
    ‘groups_only’ => 0,
    ‘groups_single_events’ => 1,
    ‘method’ => ‘calendar’,
    ‘id’ => ‘bookacti-booking-system-bookings-page’,
    ‘start’ => ! empty( $_REQUEST[ ‘from’ ] ) ? bookacti_sanitize_date( $_REQUEST[ ‘from’ ] ) : ”,
    ‘end’ => ! empty( $_REQUEST[ ‘to’ ] ) ? bookacti_sanitize_date( $_REQUEST[ ‘to’ ] ) : ”,
    ‘trim’ => 1,
    ‘past_events’ => 1,
    ‘past_events_bookable’ => 1,
    ‘check_roles’ => 0,
    ‘auto_load’ => 0, // Prevent to load on page load to save some performance
    ‘picked_events’ => $picked_events,
    ‘tooltip_booking_list’ => $user_calendar_settings[ ‘tooltip_booking_list’ ],
    ‘tooltip_booking_list_columns’ => $user_calendar_settings[ ‘tooltip_booking_list_columns’ ],
    ‘display_data’ => $display_data
    ), $user_calendar_settings );

    // Format booking system attributes
    $atts = bookacti_format_booking_system_attributes( $atts );

    echo bookacti_get_booking_system( $atts );
    ?>
    <script>
    bookacti.booking_system[ ‘bookacti-booking-system-bookings-page’ ][ ‘templates_per_activities’ ] = <?php echo json_encode( $activities ); ?>;
    </script>
    </div>
    </form>
    </div>

    <div id=’bookacti-booking-list-containerss’>
    <?php do_action( ‘bookacti_before_booking_list’ ); ?>
    <div id=’bookacti-booking-list’>
    <?php
    $filters = array( ‘templates’ => $selected_templates, ‘status’ => $selected_status, ‘fetch_meta’ => true, ‘merge_url_parameters’ => true );
    $bookings_list_tabless = new Bookings_List_Tabless();
    $bookings_list_tabless->prepare_items( $filters );
    $bookings_list_tabless->display();
    ?>
    </div>
    <?php do_action( ‘bookacti_after_booking_list’ ); ?>
    </div>

    <div class=’bookacti-sosss’>
    <strong><?php /* translators: %s = [bookingactivities_list] */ echo sprintf( esc_html__( ‘Your customers can see their booking list too thanks to the %s shortcode!’, ‘booking-activities’ ), ‘<code>[bookingactivities_list]</code>’ ); ?> (<a href=’https://booking-activities.fr/en/docs/user-documentation/get-started-with-booking-activities/display-customers-bookings-list-on-the-frontend/&#8217; target=’_blank’><?php esc_html_e( ‘documentation’, ‘booking-activities’ ); ?></a>)</strong>
    <span class=’dashicons dashicons-sos’ data-label='<?php echo esc_html_x( ‘Help’, ‘button label’, ‘booking-activities’ ); ?>’></span>
    <span>
    <ul class=’bookacti-help-list’>
    <li><?php esc_html_e( ‘The customers will need to be logged in to see their booking list, so it is recommended to display a login form on the same page’, ‘booking-activities’ ); ?> (<a href=’https://booking-activities.fr/en/docs/user-documentation/get-started-with-booking-activities/display-a-login-registration-form/&#8217; target=’_blank’><?php esc_html_e( ‘documentation’, ‘booking-activities’ ); ?></a>)
    <li><?php esc_html_e( ‘The customers will be able to cancel, reschedule or request a refund from their booking list.’, ‘booking-activities’ ); ?> (<a href='<?php echo esc_url( admin_url( ‘admin.php?page=bookacti_settings&tab=cancellation’ ) ); ?>’><?php esc_html_e( ‘Settings’, ‘booking-activities’ ); ?></a>)
    <li><?php esc_html_e( ‘You can display your customers\’ calendar of bookings too: create a booking form, remove all fields, configure the “Calendar” field to display events booked by the current user only, and past events. Then display it thanks to the booking form shortcode.’, ‘booking-activities’ ); ?>
    <?php do_action( ‘bookacti_admin_booking_list_help_after’ ); ?>
    </ul>
    </span>
    </div>
    </div>
    </div><!– end of wp wrap –>

    <?php
    // Include dialogs
    include_once( ‘view-backend-bookings-dialogs.php’ );
    include_once( ‘view-bookings-dialogs.php’ );`

    In the /example.com/wp-content/themes/your-current-theme/booking-activities/class/class-bookings-list.php

    Rename in 2 places Bookings_List_Table with Bookings_List_Tabless

    // I renamed the call and added a extra ss
    if( ! class_exists( 'Bookings_List_Tabless' ) ) { 
    	
    	/**
    	 * Bookings WP_List_Table
    	 * @version 1.9.0
    	 */
    	class Bookings_List_Tabless extends WP_List_Table {

    Add shortcode to your functions.php file or code snippet plugin

    <?php
     function view_bookings_template() {
      ob_start();
       get_template_part( '/booking-activities/view/view-bookings' );
      return ob_get_clean();
    }
    add_shortcode( 'view_bookings', 'view_bookings_template' ); 
    ?> 

    Shortcode: [view_bookings]

    Here’s how it appears on storefront theme: https://prnt.sc/10t411k

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter pervasiveconcierge

    (@pervasiveconcierge)

    Hello, so I’ve partially figured it out. However, I’m getting an ajax error and the activities will not display and if I try to add a calendar/activity from the frontend it gives an ajax error.

    Here’s a screenshot of how it appears in the frontend & the console error messages: https://prntscr.com/10wmqum

    Here the current code:

    function load_view_calendar_editor_templates() {
      ob_start();
       get_template_part( '/booking-activities/view/view-templates' );
    	
    		// Include global var on WC products and orders screens
    	if( bookacti_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
    		if( bookacti_is_wc_screen( array( 'product', 'product_variation', 'shop_order' ) ) ) {
    			wp_enqueue_script( 'bookacti-js-global-var', get_template_directory_uri() . '/booking-activities/js/global-var.min.js',  array( 'jquery' ), BOOKACTI_VERSION, false ); // Load in header
    		}
    	}
    	
    	// On backend, only include these scripts on Booking Activities pages
    	if( is_admin() && ! bookacti_is_booking_activities_screen() ) { return; }
    	
    	// INCLUDE LIBRARIES
    	$moment_version = '2.25.3';
    	if( ! wp_script_is( 'moment', 'registered' ) )	{ wp_register_script( 'moment',  get_template_directory_uri() . '/booking-activities/lib/fullcalendar/moment.min.js',  array( 'jquery' ), $moment_version, true ); }
    	if( ! wp_script_is( 'moment', 'enqueued' ) )	{ wp_enqueue_script( 'moment' ); }
    	
    	// Fullcalendar: The max suported version is 3.10.2
    	$fullcalendar_version	= '3.10.2';
    	$registered_fc			= wp_scripts()->query( 'fullcalendar', 'registered' );
    	$registered_fc_version	= $registered_fc && ! empty( $registered_fc->ver ) ? $registered_fc->ver : '';
    	if( ! $registered_fc || ( $registered_fc_version && version_compare( $registered_fc_version, $fullcalendar_version, '>' ) ) ) { wp_register_script( 'fullcalendar',  get_template_directory_uri() . '/booking-activities/lib/fullcalendar/fullcalendar.min.js',  array( 'jquery', 'moment' ), $fullcalendar_version, true ); }
    	if( ! wp_script_is( 'fullcalendar', 'enqueued' ) ) { wp_enqueue_script( 'fullcalendar' ); }
    	wp_enqueue_script( 'bookacti-js-fullcalendar-locale-all',  get_template_directory_uri() . '/booking-activities/lib/fullcalendar/locale-all.js',  array( 'jquery', 'fullcalendar' ), $fullcalendar_version, true );
    	
    	// INCLUDE STYLESHEETS
    	wp_enqueue_style ( 'bookacti-css-fullcalendar',				 get_template_directory_uri() . '/booking-activities/lib/fullcalendar/fullcalendar.min.css', 		array(), BOOKACTI_VERSION );
    	wp_enqueue_style ( 'bookacti-css-fullcalendar-print',		 get_template_directory_uri() . '/booking-activities/lib/fullcalendar/fullcalendar.print.min.css', 	array( 'bookacti-css-fullcalendar' ), BOOKACTI_VERSION, 'print' );
    	
    	// INCLUDE JAVASCRIPT FILES
    	wp_enqueue_script( 'bookacti-js-global-var',				 get_template_directory_uri() . '/booking-activities/js/global-var.min.js',				array( 'jquery' ), BOOKACTI_VERSION, false ); // Load in header
    	wp_enqueue_script( 'bookacti-js-global-functions',			 get_template_directory_uri() . '/booking-activities/js/global-functions.min.js', 			array( 'jquery', 'jquery-ui-tooltip', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-booking-system-functions',	 get_template_directory_uri() . '/booking-activities/js/booking-system-functions.min.js', 	array( 'jquery', 'fullcalendar', 'jquery-effects-highlight', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	
    	
    	
    		// Include WooCommerce scripts
    	if( bookacti_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
    		if( bookacti_is_wc_screen( array( 'product', 'product_variation', 'shop_order' ) ) || bookacti_is_booking_activities_screen() ) {
    			wp_enqueue_script( 'bookacti-js-woocommerce-backend', get_template_directory_uri() . '/booking-activities/js/woocommerce-backend.min.js',  array( 'jquery' ), BOOKACTI_VERSION, true );
    		}
    	}
    	
    	
    		// Include WooCommerce style and scripts
    	if( bookacti_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
    		if( ! is_admin() || bookacti_is_wc_screen( array( 'product', 'product_variation', 'shop_order' ) ) ) {
    			wp_enqueue_style ( 'bookacti-css-woocommerce',	get_template_directory_uri() . '/booking-activities/css/woocommerce.min.css',  array(), BOOKACTI_VERSION );
    		}
    		if( ! is_admin() ) {
    			wp_enqueue_script( 'bookacti-js-woocommerce-frontend', get_template_directory_uri() . '/booking-activities/js/woocommerce-frontend.min.js',  array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions', 'bookacti-js-booking-method-calendar' ), BOOKACTI_VERSION, true );
    		}
    		wp_enqueue_script( 'bookacti-js-woocommerce-global', get_template_directory_uri() . '/booking-activities/js/woocommerce-global.min.js',  array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	}
    	
    	// Register Booking Activities' jquery-ui theme, so it is ready to be enqueued / dequeued if needed
    	global $wp_version;
    	$jquery_ui_css_filename = version_compare( $wp_version, '5.6', '<' ) ? 'jquery-ui-1.11.4.min.css' : 'jquery-ui.min.css';
    	wp_register_style( 'bookacti-css-jquery-ui', get_template_directory_uri() . '/booking-activities/lib/jquery-ui/themes/booking-activities/' . $jquery_ui_css_filename,  array(), BOOKACTI_VERSION );
    	
    	// On backend, only include these scripts on Booking Activities pages
    	if( is_admin() && ! bookacti_is_booking_activities_screen() ) { return; }
    	
    
    	// INCLUDE STYLESHEETS
    	wp_enqueue_style ( 'bookacti-css-backend',	 get_template_directory_uri() . '/booking-activities/css/backend.min.css');
    	wp_enqueue_style ( 'bookacti-css-templates',  get_template_directory_uri() . '/booking-activities/css/templates.min.css');
    	wp_enqueue_style ( 'bookacti-css-landing',	 get_template_directory_uri() . '/booking-activities/css/landing.min.css');
    	
    		// INCLUDE STYLESHEETS
    	wp_enqueue_style( 'bookacti-css-global',	 get_template_directory_uri() . '/booking-activities/css/global.min.css');
    	wp_enqueue_style( 'bookacti-css-fonts',		 get_template_directory_uri() . '/booking-activities/css/fonts.min.css');
    	wp_enqueue_style( 'bookacti-css-bookings',	 get_template_directory_uri() . '/booking-activities/css/bookings.min.css');
    	wp_enqueue_style( 'bookacti-css-forms',		 get_template_directory_uri() . '/booking-activities/css/forms.min.css');
    	wp_enqueue_style( 'bookacti-css-jquery-ui' );
    	
    	
    		// INCLUDE JAVASCRIPT FILES
    	wp_enqueue_script( 'bookacti-js-booking-system',			get_template_directory_uri() . '/booking-activities/js/booking-system.min.js', 			array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-booking-system-dialogs',	get_template_directory_uri() . '/booking-activities/js/booking-system-dialogs.min.js',	array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-booking-method-calendar',	get_template_directory_uri() . '/booking-activities/js/booking-method-calendar.min.js', 	array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-bookings-functions',		get_template_directory_uri() . '/booking-activities/js/bookings-functions.min.js',		array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions', ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-bookings-dialogs',			get_template_directory_uri() . '/booking-activities/js/bookings-dialogs.min.js',			array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-forms',						get_template_directory_uri() . '/booking-activities/js/forms.min.js',						array( 'jquery', 'jquery-ui-dialog', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	
    		// INCLUDE JAVASCRIPT FILES
    	wp_enqueue_script( 'bookacti-js-templates-forms-control',	get_template_directory_uri() . '/booking-activities/js/templates-forms-control.min.js',  	array( 'jquery', 'moment', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-templates-functions',		get_template_directory_uri() . '/booking-activities/js/templates-functions.min.js',	array( 'jquery', 'fullcalendar', 'jquery-touch-punch', 'jquery-effects-highlight', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-templates-dialogs',			get_template_directory_uri() . '/booking-activities/js/templates-dialogs.min.js', 			array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var', 'bookacti-js-global-functions', 'bookacti-js-backend-functions', 'bookacti-js-templates-forms-control' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-templates',					get_template_directory_uri() . '/booking-activities/js/templates.min.js',					array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions', 'bookacti-js-templates-functions', 'bookacti-js-templates-dialogs' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-settings',					get_template_directory_uri() . '/booking-activities/js/settings.min.js', 					array( 'jquery' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-form-editor-dialogs',		get_template_directory_uri() . '/booking-activities/js/form-editor-dialogs.min.js',		array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var', 'bookacti-js-backend-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-form-editor',				get_template_directory_uri() . '/booking-activities/js/form-editor.min.js',			array( 'jquery', 'jquery-touch-punch', 'jquery-ui-sortable', 'bookacti-js-global-var', 'bookacti-js-booking-system-functions', 'bookacti-js-forms', 'bookacti-js-form-editor-dialogs' ), BOOKACTI_VERSION, true );
    	
    		// INCLUDE LIBRARIES
    	$select2_version = '4.0.13';
    	if( ! wp_script_is( 'select2', 'registered' ) )	{ wp_register_script( 'select2', get_template_directory_uri() . '/booking-activities/lib/select2/select2.min.js', array( 'jquery' ), $select2_version, true ); }
    	if( ! wp_script_is( 'select2', 'enqueued' ) )	{ wp_enqueue_script( 'select2' ); }
    	wp_enqueue_style( 'select2', get_template_directory_uri() . '/booking-activities/lib/select2/select2.min.css', array(), $select2_version );
    	
    	// INCLUDE JAVASCRIPT FILES
    	wp_enqueue_script( 'bookacti-js-backend-functions',	get_template_directory_uri() . '/booking-activities/js/backend-functions.min.js', 	array( 'jquery', 'jquery-ui-dialog', 'jquery-ui-tabs', 'jquery-ui-tooltip', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-bookings',			get_template_directory_uri() . '/booking-activities/js/bookings.min.js', 			array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions', 'bookacti-js-backend-functions' ), BOOKACTI_VERSION, true );
    	
    	// INCLUDE JAVASCRIPT FILES
    	wp_enqueue_script('jquery'); 
    	
    
      return ob_get_clean();
    }
    
    ?>
    	<script>
    		var bookacti_localized = <?php echo json_encode( bookacti_get_js_variables() ); ?>;
    </script>
    
    <?php add_action('wp_head', 'define_ajaxurl');
    
    function define_ajaxurl() { ?>
    <script type="text/javascript">
    var ajaxurl = "' . admin_url('admin-ajax.php') . '";
    </script>
    <?php } ?>
    
    <?php add_shortcode( 'view_bookings_activities_calendar_editors', 'load_view_calendar_editor_templates' );
    Thread Starter pervasiveconcierge

    (@pervasiveconcierge)

    So I think I gotten it figured out. Please let me know what you think, if you can. Here’s how it appears in the frontend: https://prntscr.com/10xam81

    Here’s my code:

    function load_view_calendar_editor_templates() {
      ob_start();
       get_template_part( '/booking-activities/view/view-templates' ); // copied booking-activities folder to theme
    	
    		// Include global var on WC products and orders screens
    	if( bookacti_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
    		if( bookacti_is_wc_screen( array( 'product', 'product_variation', 'shop_order' ) ) ) {
    			wp_enqueue_script( 'bookacti-js-global-var', get_template_directory_uri() . '/booking-activities/js/global-var.min.js',  array( 'jquery' ), BOOKACTI_VERSION, false ); // Load in header
    		}
    	}
    	
    	// On backend, only include these scripts on Booking Activities pages
    	if( is_admin() && ! bookacti_is_booking_activities_screen() ) { return; }
    	
    	// INCLUDE LIBRARIES
    	$moment_version = '2.25.3';
    	if( ! wp_script_is( 'moment', 'registered' ) )	{ wp_register_script( 'moment',  get_template_directory_uri() . '/booking-activities/lib/fullcalendar/moment.min.js',  array( 'jquery' ), $moment_version, true ); }
    	if( ! wp_script_is( 'moment', 'enqueued' ) )	{ wp_enqueue_script( 'moment' ); }
    	
    	// Fullcalendar: The max suported version is 3.10.2
    	$fullcalendar_version	= '3.10.2';
    	$registered_fc			= wp_scripts()->query( 'fullcalendar', 'registered' );
    	$registered_fc_version	= $registered_fc && ! empty( $registered_fc->ver ) ? $registered_fc->ver : '';
    	if( ! $registered_fc || ( $registered_fc_version && version_compare( $registered_fc_version, $fullcalendar_version, '>' ) ) ) { wp_register_script( 'fullcalendar',  get_template_directory_uri() . '/booking-activities/lib/fullcalendar/fullcalendar.min.js',  array( 'jquery', 'moment' ), $fullcalendar_version, true ); }
    	if( ! wp_script_is( 'fullcalendar', 'enqueued' ) ) { wp_enqueue_script( 'fullcalendar' ); }
    	wp_enqueue_script( 'bookacti-js-fullcalendar-locale-all',  get_template_directory_uri() . '/booking-activities/lib/fullcalendar/locale-all.js',  array( 'jquery', 'fullcalendar' ), $fullcalendar_version, true );
    	
    	// INCLUDE STYLESHEETS
    	wp_enqueue_style ( 'bookacti-css-fullcalendar',				 get_template_directory_uri() . '/booking-activities/lib/fullcalendar/fullcalendar.min.css', 		array(), BOOKACTI_VERSION );
    	wp_enqueue_style ( 'bookacti-css-fullcalendar-print',		 get_template_directory_uri() . '/booking-activities/lib/fullcalendar/fullcalendar.print.min.css', 	array( 'bookacti-css-fullcalendar' ), BOOKACTI_VERSION, 'print' );
    	
    	// INCLUDE JAVASCRIPT FILES
    	wp_enqueue_script( 'bookacti-js-global-var',				 get_template_directory_uri() . '/booking-activities/js/global-var.min.js',				array( 'jquery' ), BOOKACTI_VERSION, false ); // Load in header
    	wp_enqueue_script( 'bookacti-js-global-functions',			 get_template_directory_uri() . '/booking-activities/js/global-functions.min.js', 			array( 'jquery', 'jquery-ui-tooltip', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-booking-system-functions',	 get_template_directory_uri() . '/booking-activities/js/booking-system-functions.min.js', 	array( 'jquery', 'fullcalendar', 'jquery-effects-highlight', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	
    	
    	
    		// Include WooCommerce scripts
    	if( bookacti_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
    		if( bookacti_is_wc_screen( array( 'product', 'product_variation', 'shop_order' ) ) || bookacti_is_booking_activities_screen() ) {
    			wp_enqueue_script( 'bookacti-js-woocommerce-backend', get_template_directory_uri() . '/booking-activities/js/woocommerce-backend.min.js',  array( 'jquery' ), BOOKACTI_VERSION, true );
    		}
    	}
    	
    	
    		// Include WooCommerce style and scripts
    	if( bookacti_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
    		if( ! is_admin() || bookacti_is_wc_screen( array( 'product', 'product_variation', 'shop_order' ) ) ) {
    			wp_enqueue_style ( 'bookacti-css-woocommerce',	get_template_directory_uri() . '/booking-activities/css/woocommerce.min.css',  array(), BOOKACTI_VERSION );
    		}
    		if( ! is_admin() ) {
    			wp_enqueue_script( 'bookacti-js-woocommerce-frontend', get_template_directory_uri() . '/booking-activities/js/woocommerce-frontend.min.js',  array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions', 'bookacti-js-booking-method-calendar' ), BOOKACTI_VERSION, true );
    		}
    		wp_enqueue_script( 'bookacti-js-woocommerce-global', get_template_directory_uri() . '/booking-activities/js/woocommerce-global.min.js',  array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	}
    	
    	// Register Booking Activities' jquery-ui theme, so it is ready to be enqueued / dequeued if needed
    	global $wp_version;
    	$jquery_ui_css_filename = version_compare( $wp_version, '5.6', '<' ) ? 'jquery-ui-1.11.4.min.css' : 'jquery-ui.min.css';
    	wp_register_style( 'bookacti-css-jquery-ui', get_template_directory_uri() . '/booking-activities/lib/jquery-ui/themes/booking-activities/' . $jquery_ui_css_filename,  array(), BOOKACTI_VERSION );
    	
    	// On backend, only include these scripts on Booking Activities pages
    	if( is_admin() && ! bookacti_is_booking_activities_screen() ) { return; }
    	
    
    	// INCLUDE STYLESHEETS
    	wp_enqueue_style ( 'bookacti-css-backend',	 get_template_directory_uri() . '/booking-activities/css/backend.min.css');
    	wp_enqueue_style ( 'bookacti-css-templates',  get_template_directory_uri() . '/booking-activities/css/templates.min.css');
    	wp_enqueue_style ( 'bookacti-css-landing',	 get_template_directory_uri() . '/booking-activities/css/landing.min.css');
    	
    		// INCLUDE STYLESHEETS
    	wp_enqueue_style( 'bookacti-css-global',	 get_template_directory_uri() . '/booking-activities/css/global.min.css');
    	wp_enqueue_style( 'bookacti-css-fonts',		 get_template_directory_uri() . '/booking-activities/css/fonts.min.css');
    	wp_enqueue_style( 'bookacti-css-bookings',	 get_template_directory_uri() . '/booking-activities/css/bookings.min.css');
    	wp_enqueue_style( 'bookacti-css-forms',		 get_template_directory_uri() . '/booking-activities/css/forms.min.css');
    	wp_enqueue_style( 'bookacti-css-jquery-ui' );
    	
    	
    		// INCLUDE JAVASCRIPT FILES
    	wp_enqueue_script( 'bookacti-js-booking-system',			get_template_directory_uri() . '/booking-activities/js/booking-system.min.js', 			array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-booking-system-dialogs',	get_template_directory_uri() . '/booking-activities/js/booking-system-dialogs.min.js',	array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-booking-method-calendar',	get_template_directory_uri() . '/booking-activities/js/booking-method-calendar.min.js', 	array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-bookings-functions',		get_template_directory_uri() . '/booking-activities/js/bookings-functions.min.js',		array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions', ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-bookings-dialogs',			get_template_directory_uri() . '/booking-activities/js/bookings-dialogs.min.js',			array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-forms',						get_template_directory_uri() . '/booking-activities/js/forms.min.js',						array( 'jquery', 'jquery-ui-dialog', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	
    		// INCLUDE JAVASCRIPT FILES
    	wp_enqueue_script( 'bookacti-js-templates-forms-control',	get_template_directory_uri() . '/booking-activities/js/templates-forms-control.min.js',  	array( 'jquery', 'moment', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-templates-functions',		get_template_directory_uri() . '/booking-activities/js/templates-functions.min.js',	array( 'jquery', 'fullcalendar', 'jquery-touch-punch', 'jquery-effects-highlight', 'bookacti-js-global-var' ), BOOKACTI_VERSION, true );
    	
    	wp_enqueue_script( 'bookacti-js-templates-dialogs',			get_template_directory_uri() . '/booking-activities/js/templates-dialogs.min.js', 			array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var', 'bookacti-js-global-functions', 'bookacti-js-backend-functions', 'bookacti-js-templates-forms-control' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-templates',					get_template_directory_uri() . '/booking-activities/js/templates.min.js',					array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions', 'bookacti-js-templates-functions', 'bookacti-js-templates-dialogs' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-settings',					get_template_directory_uri() . '/booking-activities/js/settings.min.js', 					array( 'jquery' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-form-editor-dialogs',		get_template_directory_uri() . '/booking-activities/js/form-editor-dialogs.min.js',		array( 'jquery', 'moment', 'jquery-ui-dialog', 'bookacti-js-global-var', 'bookacti-js-backend-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-form-editor',				get_template_directory_uri() . '/booking-activities/js/form-editor.min.js',			array( 'jquery', 'jquery-touch-punch', 'jquery-ui-sortable', 'bookacti-js-global-var', 'bookacti-js-booking-system-functions', 'bookacti-js-forms', 'bookacti-js-form-editor-dialogs' ), BOOKACTI_VERSION, true );
    	
    		// INCLUDE LIBRARIES
    	$select2_version = '4.0.13';
    	if( ! wp_script_is( 'select2', 'registered' ) )	{ wp_register_script( 'select2', get_template_directory_uri() . '/booking-activities/lib/select2/select2.min.js', array( 'jquery' ), $select2_version, true ); }
    	if( ! wp_script_is( 'select2', 'enqueued' ) )	{ wp_enqueue_script( 'select2' ); }
    	wp_enqueue_style( 'select2', get_template_directory_uri() . '/booking-activities/lib/select2/select2.min.css', array(), $select2_version );
    	
    	// INCLUDE JAVASCRIPT FILES
    	wp_enqueue_script( 'bookacti-js-backend-functions',	get_template_directory_uri() . '/booking-activities/js/backend-functions.min.js', 	array( 'jquery', 'jquery-ui-dialog', 'jquery-ui-tabs', 'jquery-ui-tooltip', 'bookacti-js-global-var', 'bookacti-js-global-functions' ), BOOKACTI_VERSION, true );
    	wp_enqueue_script( 'bookacti-js-bookings',			get_template_directory_uri() . '/booking-activities/js/bookings.min.js', 			array( 'jquery', 'fullcalendar', 'bookacti-js-global-var', 'bookacti-js-global-functions', 'bookacti-js-backend-functions' ), BOOKACTI_VERSION, true );
    	
      return ob_get_clean();
    } ?>
    
    <?php add_shortcode( 'view_bookings_activities_calendar_editors', 'load_view_calendar_editor_templates' );

    Then I added the following code:

    add_action('wp_head', 'add_jquery');
    function add_jquery() { 
    global $post;
        if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'view_bookings_activities_calendar_editors') ) {?>
    <script type="text/javascript">
    addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(document).ready(func);else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    var ajaxurl = '/wp-admin/admin-ajax.php',
    	pagenow = 'booking-activities_page_bookacti_calendars',
    	typenow = '',
    	adminpage = 'booking-activities_page_bookacti_calendars',
    	thousandsSeparator = ',',
    	decimalPoint = '.',
    	isRtl = 0;
    </script>
    	<script>
    		var bookacti_localized = {"error":"An error occurred.","error_select_event":"You haven't selected any event. Please select an event.","error_corrupted_event":"There is an inconsistency in the selected events data, please select an event and try again.","error_less_avail_than_quantity":"You want to make %1$s bookings but only %2$s are available for the selected events. Please choose another event or decrease the quantity.","error_quantity_inf_to_0":"The amount of desired bookings is less than or equal to 0. Please increase the quantity.","error_not_allowed":"You are not allowed to do that.","error_user_not_logged_in":"You are not logged in. Please create an account and log in first.","error_password_not_strong_enough":"Your password is not strong enough.","loading":"Loading","one_person_per_booking":"for one person","n_people_per_booking":"for %1$s people","booking":"booking","bookings":"bookings","ajaxurl":"https:\/\/my.pervasiveconcierge.com\/wp-admin\/admin-ajax.php","nonce_query_select2_options":"70f91ee61d","fullcalendar_locale":"en","current_lang_code":"en","current_locale":"en_US","available_booking_methods":["calendar"],"event_tiny_height":30,"event_small_height":75,"event_narrow_width":70,"event_wide_width":250,"started_events_bookable":false,"started_groups_bookable":false,"event_load_interval":92,"default_view_threshold":640,"bookings_tooltip_mouseover_timeout":250,"date_format":"M, jS - g:i A","date_format_long":"l, F jS, Y g:i A","time_format":"g:i A","dates_separator":"&nbsp;&rarr;&nbsp;","date_time_separator":"&nbsp;&rarr;&nbsp;","single_event":"Single event","selected_event":"Selected event","selected_events":"Selected events","avail":"avail.","avails":"avail.","hide_availability_fixed":0,"dialog_button_ok":"OK","dialog_button_cancel":"Close","dialog_button_cancel_booking":"Cancel booking","dialog_button_reschedule":"Reschedule","dialog_button_refund":"Refund","plugin_path":"https:\/\/my.pervasiveconcierge.com\/wp-content\/plugins\/booking-activities","is_admin":true,"current_user_id":1,"current_time":"2021-03-27 16:36:34","calendar_localization":"default","wp_time_format":"g:i a","wp_start_of_week":"1","nonce_dismiss_5stars_rating_notice":"3f09d284de","admin_url":"https:\/\/my.pervasiveconcierge.com\/wp-admin\/","is_qtranslate":false,"utc_offset":0,"create_new":"Create new","edit_id":"id","dialog_button_generate_link":"Generate export link","dialog_button_reset":"Reset","dialog_button_delete":"Delete","error_time_format":"The time format should be HH:mm where &quot;HH&quot; represents hours and &quot;mm&quot; minutes.","error_availability_period":"The &quot;At the earliest&quot; delay must be higher than the &quot;At the latest&quot; delay.","error_closing_before_opening":"The &quot;Opening&quot; date must be prior to the &quot;Closing&quot; date.","nonce_get_booking_rows":"b2342e9aa2","dialog_button_create_activity":"Create Activity","dialog_button_import_activity":"Import Activity","dialog_button_unbind":"Unbind","dialog_button_move":"Move","error_end_before_start":"The &quot;Start&quot; date must be prior to the &quot;End&quot; date.","error_fill_field":"Please fill this field.","error_invalid_value":"Please select a valid value.","error_repeat_period_not_set":"The repetition period is not set.","error_repeat_end_before_begin":"The repetition period cannot end before it started.","error_repeat_start_before_template":"The repetition period should not start before the beginning date of the calendar.","error_repeat_end_after_template":"The repetition period should not end after the end date of the calendar.","error_days_sup_to_365":"The number of days should be between 0 and 365.","error_hours_sup_to_23":"The number of hours should be between 0 and 23.","error_minutes_sup_to_59":"The number of minutes should be between 0 and 59.","error_activity_duration_is_null":"The activity duration should not be null.","error_less_avail_than_bookings":"You can't set less available bookings than it has already on one of the occurrence of this event.","error_booked_events_out_of_period":"The repetition period must include all booked occurrences.","error_event_not_btw_from_and_to":"The selected event should be included in the period in which it will be repeated.","error_freq_not_allowed":"Error: The repetition frequency is not a valid value.","error_excep_not_btw_from_and_to":"Exception dates should be included in the repetition period.","error_excep_duplicated":"Exceptions should all have a different date.","error_set_excep_on_booked_occur":"Warning: this occurrence is booked.","error_no_templates_for_activity":"The activity must be bound to at least one calendar.","error_select_at_least_two_events":"You must select at least two events.","error_edit_locked_event":"This event is booked, you cannot move it nor change its duration.","error_no_template_selected":"You must select a calendar first.","expired":"expired","days":"days","day":"day","error_cart_expired":"Your cart has expired.","add_product_to_cart_button_text":"Add to cart","add_booking_to_cart_button_text":"Book","empty_product_price":"You must set a price for your product, otherwise the booking form won\u2019t appear on the product page."};
    	</script>
            <script>
                var ajaxurl = "https://example.com/wp-admin/admin-ajax.php"; //change to your own website
            </script><link rel='dns-prefetch' href='//stats.wp.com' />
    <link rel='dns-prefetch' href='//s.w.org' />
    <style>
    img.wp-smiley,
    img.emoji {
    	display: inline !important;
    	border: none !important;
    	box-shadow: none !important;
    	height: 1em !important;
    	width: 1em !important;
    	margin: 0 .07em !important;
    	vertical-align: -0.1em !important;
    	background: none !important;
    	padding: 0 !important;
    }
    </style>
    <?php }
    }
    Plugin Author yoancutillas

    (@yoancutillas)

    Hello,
    it looks like you did it! Congrats ?? Is it working properly?

    I cannot provide support for custom code unfortunately, I am glad you could figure it out, but I am not sure what kind of issues you may / will experience, sorry. You will need to test it thoroughly and to maintain it after each update.

    By the look of your code, you seem to have identified all the files and js variables needed to make it work, so you know how to debug and maintain the code in the future, I am really impressed and confident! Sorry I didn’t make it easier, the editor was not initially designed to be displayed on the frontend.

    Thread Starter pervasiveconcierge

    (@pervasiveconcierge)

    Hey, sorry for the late response. Yes I did get it working properly. Yeah I did run into some issues try to bring the metaboxes to the frontend. I did find some promising solutions but none seemed bring the right results. Thank you for the advice and compliments especially since I’ve not received any traditional schooling for this. No need to apologize, I’m thankful that you have a great plugin for me to use and well customize as well. Thank you again for you reply.

    Plugin Author yoancutillas

    (@yoancutillas)

    You are most welcome, thank you too!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Render JS on Frontend’ is closed to new replies.