joneiseman
Forum Replies Created
-
It says invalid API key. Make sure that any security firewalls or “ModSecurity” settings on the server aren’t stripping the API key from outgoing requests or blocking the connection to maps.googleapis.com.
Go to Events > Settings and then click on the Bookings tab then in the Booking Chart section make sure both the Display on WP Dashboard and the Display on Frontend are set to No.
Did you fill in the Google Maps API Browser Key?
https://wp-events-plugin.com/documentation/google-maps/api-key/
I found the following workaround for the double booking issue on the Pro Support forum. Add the following code snippet:
function my_get_ticket_booked_spaces( $booked_spaces, $EM_Ticket ){
global $wpdb;
$table_name = $wpdb->prefix.'em_tickets_bookings';
$table_booking = $wpdb->prefix.'em_bookings';
$booked_spaces = $wpdb->get_var('
SELECT SUM(t.ticket_booking_spaces) AS booked_space
FROM '.$table_name.' t
LEFT JOIN '.$table_booking.' b ON t.booking_id = b.booking_id
WHERE
b.booking_status = 1 AND
t.ticket_id='. absint($EM_Ticket->ticket_id) .' GROUP BY t.ticket_id');
return $booked_spaces;
}
add_filter('em_ticket_get_booked_spaces', 'my_get_ticket_booked_spaces', 100, 2 );You can use the Code Snippets plugin to add this code snippet.
This forum is for support of the Events Manager plugin. Looks like you’re using the WP Event Manager plugin. You can find the support forum for that plugin here: https://ww.wp.xz.cn/support/plugin/wp-event-manager/
I found a workaround for this problem on the Pro Support forum. Just add the following code snippet:
/**
* Temporary fix for Events Manager calendar month display issue
* GTranslate / multilingual safe
*/
add_action( 'wp_footer', 'mf_fix_em_calendar_month_display', 999);
function mf_fix_em_calendar_month_display() {
?>
<script>
var added = false;
(function($) {
function getLocalizedMonthYear(year, month) {
try {
var locale = document.documentElement.lang || navigator.language || 'nl-NL';
var date = new Date(year, month - 1, 1);
return new Intl.DateTimeFormat(locale, {
month: 'short',
year: 'numeric'
}).format(date);
} catch (e) {
return year + '-' + month;
}
}
function forceFixCalendarMonth() {
try {
$('.em-calendar').each(function() {
var $cal = $(this);
var month = parseInt($cal.attr('data-month'), 10);
var year = parseInt($cal.attr('data-year'), 10);
if (!month || !year) return;
var monthPadded = (month < 10 ? '0' + month : month);
var correctValue = year + '-' + monthPadded;
var correctDisplay = getLocalizedMonthYear(year, month);
var $input = $cal.find('.em-month-picker');
if (!$input.length) return;
// Update input value & attribute
$input.val(correctValue);
$input.attr('data-month-value', correctDisplay);
// Sync Flatpickr if present
if ($input[0] && $input[0]._flatpickr) {
$input[0]._flatpickr.setDate(correctValue + '-01', false, "Y-m-d");
$input[0]._flatpickr.redraw();
}
// Visible month label
var $monthDiv = $cal.find('.month');
var $monthDisplay = $monthDiv.find('.month-display-text');
if ($monthDisplay.length === 0 ) {
$monthDiv.find('form').prepend( '<input type="text" class="em-month-picker flatpickr-input select-toggle active" value="'+correctDisplay.toUpperCase()+'" data-month-value="'+correctValue+'" style="width: 132.917px !important;" readonly="readonly">' );
//$monthDiv.find('form').prepend( '' + correctDisplay + '' );
// Hide original input
$input.css({
position: 'absolute',
opacity: 0,
width: 0,
height: 0
});
} else {
//$monthDisplay.text(correctDisplay);
}
});
} catch (e) {
console.log( "test " + e );
}
}
$(document).ready(function() {
//setTimeout(forceFixCalendarMonth, 150);
setTimeout(forceFixCalendarMonth, 600);
//setTimeout(forceFixCalendarMonth, 1200);
});
//Events Manager AJAX reloads
$(document).on('em_calendar_load em_calendar_loaded', forceFixCalendarMonth);
})(jQuery);
</script>
<?php
}You can use the Code Snippets plugin to add this code snippet.
Looks like this is not using the Events Manager calendar styling. Maybe you disabled styling in the Events > Settings?
The Calendar Search Parameter documentation can be found here: https://wp-events-plugin.com/documentation/event-search-attributes/#calendar-parameters
See the following thread for a workaround: https://ww.wp.xz.cn/support/topic/month-picker-error/
Here’s documentation on how to create your own custom event scope: https://wp-events-plugin.com/documentation/tutorials/create-your-own-event-scope/
You could use the following code snippet to create a scope called “upcoming” that will show all upcoming events including events that started today but already ended:
add_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2);
function my_em_scope_conditions($conditions, $args){
if( !empty($args['scope']) && $args['scope']=='upcoming' ){
$start_date = date('Y-m-d',current_time('timestamp'));
$conditions['scope'] = "(event_start_date >= CAST('$start_date' AS DATE))"; }
return $conditions;
}
add_filter( 'em_get_scopes','my_em_scopes',1,1);
function my_em_scopes($scopes){
$my_scopes = array( 'upcoming' => 'Today and Future' );
return $scopes + $my_scopes;
}Here’s the shortcode that uses this scope:
[events_list_grouped mode=monthly scope=upcoming orderby=event_start_date order=ASC] #_EVENTNAME, #_EVENTDATES{has_time}, #_EVENTTIMES{/has_time}[/events_list_grouped]You can use the Code Snippets plugin to add the above code snippet.
You could try the fix given in the following thread: https://ww.wp.xz.cn/support/topic/bug-report-booking-counts-broken-due-to-bugs-in-em_ticketget_status_spaces/
Try doing a Database Cleanup. Go to Events > Settings the in the General tab scroll down and click on the Admin Tools (Advanced) section and then scroll down until you see Database Cleanup in that section and then click on the Database Cleanup button.
I guess it’s the CSS added for the Events Manager on non Events Manager pages that is causing the problems on your divi builder pages. To prevent this from happening you can add the following code snippet:
add_action( 'wp_enqueue_scripts', 'dequeue_em_css_conditionally', 100 );
function dequeue_em_css_conditionally() {
// Check if we are NOT on an Events Manager page
// This covers events, locations, categories, tags, and the booking/calendar pages
if ( ! ( is_singular('event') || is_singular('location') || is_post_type_archive('event') || is_post_type_archive('location') || em_is_event_page() ) ) {
// Dequeue the main Events Manager CSS
wp_dequeue_style('events-manager');
}
}You can use the Code Snippets plugin to add this code snippet.
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Month picker errorThat thread is missing one step. After you modify events-manager/includes/js/events-manager.js you need to create a minified version and use this to replace events-manager/includes/js/events-manager.min.js
You can use this online js minifier to do the minification: https://minify-js.com/
I found the following code snippet on the Pro Support forum. You can try this and see if it works around the problem.
function my_get_ticket_booked_spaces( $booked_spaces, $EM_Ticket ){
global $wpdb;
$table_name = $wpdb->prefix.'em_tickets_bookings';
$table_booking = $wpdb->prefix.'em_bookings';
$booked_spaces = $wpdb->get_var('
SELECT SUM(t.ticket_booking_spaces) AS booked_space
FROM '.$table_name.' t
LEFT JOIN '.$table_booking.' b ON t.booking_id = b.booking_id
WHERE
b.booking_status = 1 AND
t.ticket_id='. absint($EM_Ticket->ticket_id) .' GROUP BY t.ticket_id');
return $booked_spaces;
}
add_filter('em_ticket_get_booked_spaces', 'my_get_ticket_booked_spaces', 100, 2 );You can use the Code Snippets plugin to add this code snippet.
Try this:
[events_list_grouped mode=monthly]#_EVENTEXCERPT{15,…}[/events_list]