Map not showing on single event

Home Forums Calendar Products Events Calendar PRO Map not showing on single event

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1248923
    Tristan
    Participant

    I can’t find the bug that’s causing the Google map not to display here: http://77.104.130.185/~permades/little-kitchen.co.uk/event/thai-street-food-evening-4

    Does anyone have any ideas? I’m using Event Tickets Plus, and I’ll be buying The Event Calendar Pro and the Filtering plugin later today, in case that helps boost this thread’s importance!

    Thanks very much.

    #1249347
    Cliff
    Member

    Hi, Tristan.

    Thanks for your business, but potential future purchases doesn’t change the timing of when we reply to threads; they’re first-come-first-serve as best we can.

    There could be several reasons for this event’s map not to display.

    Could you please provide me a screenshot or video screen capture of this event’s wp-admin edit screen (to see if the appropriate Google Maps box is checked)? Same for this event’s venue wp-admin edit screen and the Map Settings section from wp-admin > Events > Settings > General tab.

    Then we’ll go from there…

    Thank you.

    #1249759
    Tristan
    Participant

    Hi Cliff,

    Thanks very much for that. Attached are the three admin screens. I’ve also tried deactivating other plugins as well as commenting out the enqueuing of other JS files on the site.

    Thanks for your help!

    Tristan

    #1250167
    Cliff
    Member

    Thanks, Tristan. All those settings look good, and I see the map area on your event page (although not loaded correctly).

    I saw many console errors at your site. (If needed, you may reference our KB article Using Google Chrome Developer Tools.) Please resolve those.

    #1250381
    Tristan
    Participant

    On my local copy of the site I have fixed all of the console errors, and have figured out that the following code in my functions.php is causing extra text to be added to the Google Map div’s class, which is causing it to stop working. The Google Map div’s class is now “tribe-events-gmap-Pay by card or PayPal”. When I comment out this function the map appears.

    // change ‘proceed to PayPal’ text on checkout button
    add_filter( ‘gettext’, ‘custom_paypal_button_text’, 20, 3 );
    function custom_paypal_button_text( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
    case ‘Proceed to PayPal’ :
    $translated_text = __( ‘Pay by card or PayPal’, ‘woocommerce’ );
    break;
    }
    return $translated_text;
    }

    I still need this in my functions.php though, as the client needs the PayPal button text changed and this shouldn’t be affecting the Tribe Events map. I will upload my local copy of the site now so that you can see.

    Thanks for your help with this!

    #1250676
    Cliff
    Member

    Thanks for figuring this out.

    Your gettext filtering should probably be tightened a bit. You should have logic in there to only apply to specific text domains, like “if ‘xyz’ === $domain, then do this string replacement”

    Also, by having this:

    __( 'Pay by card or PayPal', 'woocommerce' )

    you are double-running the gettext (like a circular reference).

    You should remove the __( and the , ‘woocommerce’ parts.

    If you can’t get things working just right, please post your new full code snippet and a link to see where it’s in effect on your site.

    #1251005
    Tristan
    Participant

    Hi Cliff,

    Thanks very much for that, that’s very helpful. It was just a code snippet I found on Stack Overflow, but I’ve changed the part in your second suggestion and I’m not sure where to start with your first suggestion; if you have any advice on documentation I could look at then that would be very much appreciated! I’ve tried to have that function run only on the checkout page (so that it doesn’t affect the class of the Google map) but to no avail.

    Thanks again,

    Tristan

    #1251304
    Cliff
    Member

    I’m glad we’re making progress.

    You could reference the snippet at the bottom of https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/

    You could also add something like this at the top of your own snippet to short circuit if not on the WooCommerce checkout page:

    if ( ! is_checkout() ) {
    return $translation;
    }

    If you don’t get things working just right, please provide your new full code snippet and I’ll take another look.

    #1251765
    Tristan
    Participant

    Thank you so much, I’ve managed it!

    Here’s the code that worked:

    // rename various WooCommerce fields
    function woocommerce_rename_fields( $translated_text, $text, $text_domain ) {
    // bail if not modifying frontend woocommerce text
    if ( is_admin() || ‘woocommerce’ !== $text_domain ) {
    return $translated_text;
    }
    if ( ‘Apply Coupon’ === $text ) {
    $translated_text = ‘Apply Code’;
    }
    if ( ‘Coupon:’ === $text ) {
    $translated_text = ‘Gift Token or Voucher Code:’;
    }
    if ( ‘Proceed to PayPal’ === $text ) {
    $translated_text = ‘Pay by card or PayPal’;
    }
    return $translated_text;
    }
    add_filter( ‘gettext’, ‘woocommerce_rename_fields’, 10, 3 );

    #1252015
    Cliff
    Member

    Excellent! Thanks for sharing for the benefit of others if it might help them too.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Map not showing on single event’ is closed to new replies.