Removing "cost" row in event's detail section

Home Forums Calendar Products Events Calendar PRO Removing "cost" row in event's detail section

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #991811
    Luc
    Participant

    Dear support,

    I would like to remove the “Cost” line showing the price range of available tickets in the Events Calendar Pro. I refer to the screen visible when you select a single event from the month view as depicted in this thread: https://theeventscalendar.com/support/forums/topic/how-to-change-the-text-price-in-event-details/

    However, the “details.php” file which is refered to doesn’t exist in my Events Calendar Pro install.

    Next I thought I would need this file from the ‘old’ The Events Calendar plug-in, where I indeed found the file. I copied it to themes/enigma-premium/tribe-events/modules/details.php and disabled the beforementioned section of code:

    <?php
    // Event Cost
    if ( ! empty( $cost ) ) : ?>

    /** <dt> <?php esc_html_e( ‘Cost:’, ‘tribe-events-calendar’ ) ?> </dt>
    <dd class=”tribe-events-event-cost”> <?php esc_html_e( $cost ); ?> </dd> */
    <?php endif ?>

    Still, the costs are shown:
    http://www.panoramarail.nl/event/panorama-rail-restaurant-diner-151024/

    Could you indicate how to hide this line of text?

    Best,
    Luc

    #991817
    Luc
    Participant

    I’m sorry, I forgot a related question.

    The same holds for the information line directly below the event’s title:
    Diner
    24 oktober 2015 17:15 – 20:00 | € 249 – € 749

    Here I also want to remove the “|” and the costs.

    Would you please advise me on this aspect too?

    Best,
    Luc

    #991865
    George
    Participant

    Hey Luc,

    I’d recommend that you first remove all custom template file changes you’ve made so far in trying to achieve this. And ensure that the original details.php file is intact and just like it is when you first installed The Events Calendar.

    In other words, get rid off ALL PHP customizations you’ve made so far for this customization.

    The easiest way to do this is just with CSS.

    To hide the Cost and Divider, add the following CSS snippet to the bottom of your theme’s style.css file:


    .tribe-events-schedule .tribe-events-divider,
    .tribe-events-cost {
    display: none !important;
    }

    I hope that helps!

    Cheers,
    George

    #991880
    Luc
    Participant

    Dear George,

    Thank you. This worked like a charm. However, would you be so kind to also take a look at my first, main post. That is the actual issue – the issue you replied to was just a side note (I didn’t find the edit function then; now I did :-)).

    The actual price tags are removed by adding the tribe-events-event-cost tag to the css code you suggested before. Now only the “Cost: ” text, which seems to be hard coded, remains.

    Thanks.

    Luc

    • This reply was modified 10 years, 9 months ago by Luc.
    #992372
    George
    Participant

    Hey Luc,

    Sorry about that! A simple way to hide that “Cost” text would be to add the following code to your theme’s functions.php file:


    add_action( 'wp_footer', 'tribe991811_hide_cost_text', 45 );

    function tribe991811_hide_cost_text() {
    if ( ! wp_script_is( 'enqueued', 'jquery' ) ) {
    wp_enqueue_script( 'jquery' );
    }
    ?>
    <script>
    if ( jQuery( '.tribe-events-event-cost' ).length ) {
    jQuery( '.tribe-events-event-cost' ).prev('dt').hide();
    }
    </script>
    <?php
    }

    A bit of a “hack” method but it will work more reliable than trying to find that DT element with CSS and doesn’t require any template edits.

    I hope this helps!

    — George

    #996302
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Removing "cost" row in event's detail section’ is closed to new replies.