/** * Load Scripts * * Enqueues the required scripts. * * @since 1.3 * @global $post * @return void */ function mdjm_load_scripts() { $js_dir = MDJM_PLUGIN_URL . '/assets/js/'; wp_register_script('mdjm-ajax', $js_dir . 'mdjm-ajax.js', array('jquery'), MDJM_VERSION_NUM); wp_enqueue_script('mdjm-ajax'); wp_localize_script('mdjm-ajax', 'mdjm_vars', apply_filters('mdjm_script_vars', array('ajaxurl' => mdjm_get_ajax_url(), 'rest_url' => esc_url_raw(rest_url('mdjm/v1/')), 'ajax_loader' => MDJM_PLUGIN_URL . '/assets/images/loading.gif', 'required_date_message' => __('Please select a date', 'mobile-dj-manager'), 'availability_ajax' => mdjm_get_option('avail_ajax', false), 'available_redirect' => mdjm_get_option('availability_check_pass_page', 'text') != 'text' ? mdjm_get_formatted_url(mdjm_get_option('availability_check_pass_page')) : 'text', 'available_text' => mdjm_get_option('availability_check_pass_text', false), 'unavailable_redirect' => mdjm_get_option('availability_check_fail_page', 'text'), 'unavailable_text' => mdjm_get_option('availability_check_fail_text', false), 'is_payment' => mdjm_is_payment() ? '1' : '0', 'default_gateway' => mdjm_get_default_gateway(), 'payment_loading' => __('Please Wait...', 'mobile-dj-manager'), 'no_payment_amount' => __('Select Payment Amount', 'mobile-dj-manager'), 'no_card_name' => __('Enter the name printed on your card', 'mobile-dj-manager'), 'complete_payment' => mdjm_get_payment_button_text()))); wp_register_script('jquery-validation-plugin', '//ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js', array('jquery')); wp_enqueue_script('jquery-validation-plugin'); wp_enqueue_script('jquery-ui-datepicker', array('jquery')); }
<?php /** * This template is used when no alternative is provided. * * @version 1.0 * @author Mike Howard * @since 1.3.8 * @content_tag {client_*} * @content_tag {event_*} * @shortcodes Supported * * Do not customise this file! * If you wish to make changes, copy this file to your theme directory /theme/mdjm-templates/payments/payments-cc.php */ global $mdjm_event; $pay_now = mdjm_get_payment_button_text(); ?> <?php do_action('mdjm_pre_default_payments_form'); ?> <div class="mdjm-alert mdjm-alert-error mdjm-hidden"></div> <p class="mdjm-default-form-text"><?php _e("Once you have selected your Payment Amount, click {$pay_now} to checkout", 'mobile-dj-manager'); ?> </p> <?php do_action('mdjm_pre_default_payments_form');
/** * Renders the Payment Submit section * * @since 1.3.8 * @return void */ function mdjm_payment_submit() { if (!mdjm_has_gateway()) { return; } ob_start(); ?> <fieldset id="mdjm_payment_submit"> <?php do_action('mdjm_payment_form_before_submit'); ?> <?php mdjm_payment_hidden_fields(); ?> <div class="mdjm-alert mdjm-alert-error mdjm-hidden"></div> <input type="submit" name="mdjm_payment_submit" id="mdjm-payment-submit" value="<?php echo mdjm_get_payment_button_text(); ?> " /> <?php do_action('mdjm_payment_form_after_submit'); ?> </fieldset> <?php echo ob_get_clean(); }