Feature Request: Event Cost Button

Home Forums Calendar Products Events Calendar PRO Feature Request: Event Cost Button

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #533593
    Jeff
    Participant

    It would be nice if there was a setting to automatically link the event cost button to the event website. In my case, we sell tickets on a separate website, and the event cost button would make a natural link to that “register here” web site.

    #534354
    Barry
    Member

    Hi!

    You could definitely override one of our templates – depending on where you want to implement this – and make use of some of our template tag functions such as:

    Which button exactly are you thinking of changing? Is it the one that appears in list view?

    #605669
    Jeff
    Participant

    Yes, the event cost icon in both List and Event views. It would be nice to create that icon as a button that would take the user to the sign-up/ticket purchase page, whatever system that might be (Eventbrite, another web page, etc.).
    Is the /tribe-events/ folder inside the Advocator theme not created with the install of Events Calendar Pro, but rather from the developers of the Advocator theme?

    #605785
    Barry
    Member

    If you’ve got a pre-existing tribe-events directory within your theme and you didn’t create it then yes – it quite likely shipped with the theme and was the work of the theme authors.

    Thinking of the default list/single-event.php template, the basis of this sort of change could be as easy as finding:

    <span><?php echo tribe_get_cost( null, true ); ?></span>

    Then adapting this to:

    <span>
    	<a href="<?php the_permalink() ?>">
    		<?php echo tribe_get_cost( null, true ) ?>
    	</a>
    </span>

    That will make it link to the relevant single event page where (if you were using something like our WooCommerce Tickets addon they could buy tickets) … of course you could introduce your own logic to take them to some other location.

    I hope that helps – and good luck 🙂

    #718616
    Jeff
    Participant

    Hello, where do I find the “tribe-events-event-url” call in the template php file? I want to replace the “<?php the_permalink() ?>” line with the Event’s Website URL instead.
    Thanks!

    #719197
    Barry
    Member

    OK – so just replace the_permalink() with echo tribe_get_event_website_url() … does that work for you?

    #719878
    Jeff
    Participant
    #719954
    Barry
    Member

    No, it seems to return the same value as the <?php the_permalink() ?> echo.

    It certainly shouldn’t do 😉

    Is it possible something else is interfering? Might you have originally edited a core template or even the correct template override using the_permalink() – and then continued to make a further change in a different place/the wrong place?

    I’m afraid that, try as I may, I just can’t replicate what you are describing. If a website URL is set, then tribe_get_event_website_url() returns it.

    #722615
    Jeff
    Participant

    Found the error in my code. You are correct! Thank you!

    #722923
    Barry
    Member

    Awesome, glad everything panned out 🙂

    I’ll go ahead and close this thread – of course if you need help with anything else please don’t hesitate to open new threads as needed and one of the team will be only too happy to assist.

    Last but not least, if you have a moment to spare and would like to leave a review over on our plugin review page we’d love to hear your thoughts on The Events Calendar. Thanks again!

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Feature Request: Event Cost Button’ is closed to new replies.