Cost Field vanished after Event Ticket & Remove Word FREE

Home Forums Calendar Products Events Calendar PRO Cost Field vanished after Event Ticket & Remove Word FREE

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1156229
    kumar
    Participant

    as per Your instruction “https://theeventscalendar.com/knowledgebase/use-the-event-cost-field-with-tickets-installed/” we are able to restore the Cost Field in Admin Panel

    But Big Issue is that when we put cost Word Free is still appearing in Front of the event Cost.
    which we don’t want to vanish Completely. by one of yours solution on https://theeventscalendar.com/support/forums/topic/remove-price-from-events-page/

    Please HELP Us to remove the Word Free (appearing before price) and it should Display the Cost only.

    Note:- very soon we are planning to purchase Ticket Pro but by the time do help us with this solution.
    tnx & wating …

    #1156230
    kumar
    Participant

    This reply is private.

    #1156341
    Geoff
    Member

    Hey Kumar, thanks for getting in touch!

    Good question. Just to confirm, you only want to remove the word “Free” from the event price range. Is that correct?

    If so, please try using the snippet posted here:

    Custom Wording in the Calendar

    We can use that to replace “Free -” with nothing at all. Something like this:

    function tribe_custom_theme_text ( $translation, $text, $domain ) {
    
    // Put your custom text here in a key => value pair
    // Example: 'Text you want to change' => 'This is what it will be changed to'
    // The text you want to change is the key, and it is case-sensitive
    // The text you want to change it to is the value
    // You can freely add or remove key => values, but make sure to separate them with a comma
    // This example changes theย "Free -" to ""
    $custom_text = array(
    'Free -' => ''
    );
    
    // If this text domain starts with "tribe-", "the-events-", or "event-" and we have replacement text
    if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($translation, $custom_text) ) {
    $translation = $custom_text[$translation];
    }
    return $translation;
    }
    add_filter('gettext', 'tribe_custom_theme_text', 20, 3);

    That seemed to do the trick when I tested it out. Will that work for you as well? Please let me know. ๐Ÿ™‚

    Cheers!
    Geoff

    #1156589
    kumar
    Participant

    This reply is private.

    #1157048
    Geoff
    Member

    Hey Kumar, hope you had a great weekend!

    So sorry about the snippet — turns out that it will not accept dashes in the translation. This will work instead:

    function tribe_custom_theme_text ( $translation, $text, $domain ) {
    
    $custom_text = array(
    'Free' => ' ',
    );
    
    // If this text domain starts with "tribe-", "the-events-", or "event-" and we have replacement text
    if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($translation, $custom_text) ) {
    $translation = $custom_text[$translation];
    }
    return $translation;
    }
    add_filter('gettext', 'tribe_custom_theme_text', 20, 3);

    Does that work for you as well? Please let me know. ๐Ÿ™‚

    Cheers!
    Geoff

    #1166433
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Cost Field vanished after Event Ticket & Remove Word FREE’ is closed to new replies.