Home › Forums › Calendar Products › Events Calendar PRO › Removing "cost" row in event's detail section
- This topic has 5 replies, 3 voices, and was last updated 10 years, 8 months ago by
Support Droid.
-
AuthorPosts
-
July 30, 2015 at 9:03 am #991811
Luc
ParticipantDear 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,
LucJuly 30, 2015 at 9:10 am #991817Luc
ParticipantI’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 – € 749Here I also want to remove the “|” and the costs.
Would you please advise me on this aspect too?
Best,
LucJuly 30, 2015 at 10:40 am #991865George
ParticipantHey 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,
GeorgeJuly 30, 2015 at 11:45 am #991880Luc
ParticipantDear 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.
July 31, 2015 at 2:25 pm #992372George
ParticipantHey 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
August 15, 2015 at 7:05 am #996302Support Droid
KeymasterThis 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. -
This reply was modified 10 years, 9 months ago by
-
AuthorPosts
- The topic ‘Removing "cost" row in event's detail section’ is closed to new replies.
