Forum Replies Created
-
AuthorPosts
-
February 4, 2015 at 8:16 am in reply to: Remove iCal and Google Calendar links on single event if the event has passed #939976prydonianParticipant
That worked. thanks.
prydonianParticipantThis is the single-event.php code.
<?php
/**
* Single Event Template
* A single event. This displays the event title, description, meta, and
* optionally, the Google map for the event.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php
*
* @package TribeEventsCalendar
*
*/if ( ! defined( ‘ABSPATH’ ) ) {
die( ‘-1’ );
}$event_id = get_the_ID();
?>
<div id=”tribe-events-content” class=”tribe-events-single vevent hentry”>
<p class=”tribe-events-back”>
“> <?php _e( ‘« All Events’, ‘tribe-events-calendar’ ) ?>
</p><!– Notices –>
<?php tribe_events_the_notices() ?>
<h3 class=”tribe-events-single-section-title aligncenter”><?php echo tribe_get_organizer() ?> presents: </h3>
<?php the_title( ‘<h2 class=”tribe-events-single-event-title summary entry-title”>’, ‘</h2>’ ); ?><div class=”tribe-events-schedule updated published tribe-clearfix”>
<?php echo tribe_events_event_schedule_details( $event_id, ‘<h3>’, ‘</h3>’ ); ?>
<?php if ( tribe_get_cost() ) : ?>
<span class=”tribe-events-divider”>|</span>
<span class=”tribe-events-cost”><?php echo tribe_get_cost( null, true ) ?></span>
<?php endif; ?>
</div><!– Event header –>
<div id=”tribe-events-header” <?php tribe_events_the_header_attributes() ?>>
<!– Navigation –>
<h3 class=”tribe-events-visuallyhidden”><?php _e( ‘Event Navigation’, ‘tribe-events-calendar’ ) ?></h3>
<ul class=”tribe-events-sub-nav”>
<li class=”tribe-events-nav-previous”><?php tribe_the_prev_event_link( ‘<span>«</span> %title%’ ) ?>
<li class=”tribe-events-nav-next”><?php tribe_the_next_event_link( ‘%title% <span>»</span>’ ) ?><!– .tribe-events-sub-nav –>
</div>
<!– #tribe-events-header –><?php while ( have_posts() ) : the_post(); ?>
<div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<!– Event featured image, but exclude link –>
<?php echo tribe_event_featured_image( $event_id, ‘speaker’, false ); ?><!– Event content –>
<?php do_action( ‘tribe_events_single_event_before_the_content’ ) ?>
<div class=”tribe-events-single-event-description tribe-events-content entry-content description”>
<?php
$website = tribe_get_event_website_button();
if ( ! empty( $website ) ):
?>
<div class=”medium primary btn”><?php echo $website ?></div></dd>
<?php endif ?><?php the_content(); ?>
<?php
$website = tribe_get_event_website_button();
if ( ! empty( $website ) ):
?>
<div class=”medium primary btn”><?php echo $website ?></div></dd>
<?php endif ?>
</div>
<!– .tribe-events-single-event-description –>
<?php do_action( ‘tribe_events_single_event_after_the_content’ ) ?><!– Event meta –>
<?php do_action( ‘tribe_events_single_event_before_the_meta’ ) ?>
<?php
/**
* The tribe_events_single_event_meta() function has been deprecated and has been
* left in place only to help customers with existing meta factory customizations
* to transition: if you are one of those users, please review the new meta templates
* and make the switch!
*/
if ( ! apply_filters( ‘tribe_events_single_event_meta_legacy_mode’, false ) ) {
tribe_get_template_part( ‘modules/meta’ );
} else {
echo tribe_events_single_event_meta();
}
?>
<?php do_action( ‘tribe_events_single_event_after_the_meta’ ) ?>
</div> <!– #post-x –>
<?php if ( get_post_type() == TribeEvents::POSTTYPE && tribe_get_option( ‘showComments’, false ) ) comments_template() ?>
<?php endwhile; ?><!– Event footer –>
<div id=”tribe-events-footer”>
<!– Navigation –>
<!– Navigation –>
<h3 class=”tribe-events-visuallyhidden”><?php _e( ‘Event Navigation’, ‘tribe-events-calendar’ ) ?></h3>
<ul class=”tribe-events-sub-nav”>
<li class=”tribe-events-nav-previous”><?php tribe_the_prev_event_link( ‘<span>«</span> %title%’ ) ?>
<li class=”tribe-events-nav-next”><?php tribe_the_next_event_link( ‘%title% <span>»</span>’ ) ?><!– .tribe-events-sub-nav –>
</div>
<!– #tribe-events-footer –></div><!– #tribe-events-content –>
What is happening is that the snippets that I’ve been given so far have enabled me to post events to Eventbrite in the correct currency and to have £ instead of $ in the
<div class=”tribe-events-event-cost”>
<span><?php echo tribe_get_cost( null, true ); ?></span>
</div>box in the list/single-event.php template and the
<span class=”tribe-events-cost”><?php echo tribe_get_cost( null, true ) ?></span>
in the single-event.php template.
However, now in both of those bits of code, if an event has free tickets, the word “Free” doesn’t appear.
If I remove the snippets I was given, it does. But then the old problems about either no £ symbol or $ being posted to Eventbrite reoccurs.
prydonianParticipantThat appears to have worked. Thanks!
prydonianParticipantThis is what I’m seeing:
It only happens with the WC events, not the EB events. The 12 in each case should be £12.
prydonianParticipantDefault currency is set to £ (GBP)
That didn’t help.
prydonianParticipantThanks.
Might it have something to do with https://theeventscalendar.com/support/forums/topic/change-default-currency/ ?
prydonianParticipantFantastic, worked like a charm.
Many thanks.
prydonianParticipantThis reply is private.
prydonianParticipantIt does. thanks for your help.
The automatic timezone alteration feature does sound appealing.
I think the only thing that would’ve probably helped is a “this is a dev site” checkbox, which stops the plugin from overwriting anything live whilst events are being imported and edited (to add venue details, etc).
prydonianParticipantHow odd, it doesn’t seem to like me posting a link to the gist I used.
add_action( ‘tribe_eb_after_event_creation’, ‘my_change_tribe_eventbrite_currency’, 10, 4 );
function my_change_tribe_eventbrite_currency( $eventbrite_id, $venue_id, $organizer_id, $post_id ) {
$currency_acro = ‘EUR’;
$parameters = ‘id=’ . $eventbrite_id . ‘¤cy=’ . $currency_acro;
$success = Event_Tickets_PRO::sendEventBriteRequest( ‘event_update’, $parameters, $post_id, true, true, false );
if ( !$success ) {
add_filter( ‘tribe_eb_error_message’, ‘my_change_tribe_eventbrite_currency_failed’ );
}
}
function my_change_tribe_eventbrite_currency_failed() {
return ‘Failed to update the currency.’;
}prydonianParticipantI tried https://gist.github.com/PaulHughes01/4678437 but it ends up with a blank screen on publish and no ticket is generated
prydonianParticipantFrom what I’ve seen with some more investigating, it looks like the events are being edited after import to add venue & organiser details. This is probably what’s triggering the Eventbrite update. It happens when all other plugins are disabled & a default theme is used.
The time jump is always 1 hour, so it may be a GMT issue. From what I can see, WordPress, when set to London time, will automatically adjust from GMT to DST on the correct dates, but Eventbrite sets the time when an event is created (is that correct?). This suggests to me that events that were created before the UK switched back to GMT would have been altered.
Since I’m not the person who originally set the events up in Eventbrite, I can’t say for certain what timezone they were set to at the time of creation.
I’ve attached the timezone settings for both sites (the Eventbrite one is for their latest added event).
prydonianParticipantThe only puzzling thing is the time change. Since the dev site is set to GMT, as is Eventbrite, an event update shouldn’t change the time, but it apparently does.
prydonianParticipantThanks for your patience with this.
I suspect that the sporadic nature of the changes suggest that when the events are imported, they may be going in to edit them (adding organiser & venue details, etc) which is triggering the Eventbrite update.
Until the dev site goes live, I may disable the methods you posted, so that any edits don’t mess with the live events and then re enable them on launch.
prydonianParticipantWell, as far as I’m aware it hasn’t altered the time on that particular event, but it didn’t alter all of them even when the other plugins and theme were in place either. It only did it to some and not others, which is why the problem was so hard to pin down.
I would categorise the adding of the event organiser details as part of the same issue – the plugin is overwriting the event details. Normally, there is Organiser Name and links to Facebook & Twitter. The plugin is adding the contents of the Organiser from TEC to this in a new block on Eventbrite (the same as if you click “Add new” under Organiser name).
Is there a section of code that I could comment out in the plugin that would stop it updating the events whilst the dev site is still being built and content added (so it doesn’t add the extra details) and then uncomment when the site goes live?
-
AuthorPosts