Home › Forums › Calendar Products › Events Calendar PRO › Feature Request: Event Cost Button
- This topic has 9 replies, 2 voices, and was last updated 11 years, 8 months ago by
Barry.
-
AuthorPosts
-
July 29, 2014 at 10:56 am #533593
Jeff
ParticipantIt 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.
July 29, 2014 at 2:38 pm #534354Barry
MemberHi!
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?
August 7, 2014 at 10:26 am #605669Jeff
ParticipantYes, 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?August 7, 2014 at 10:47 am #605785Barry
MemberIf 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 🙂
September 3, 2014 at 12:06 am #718616Jeff
ParticipantHello, 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!September 3, 2014 at 6:25 am #719197Barry
MemberOK – so just replace the_permalink() with echo tribe_get_event_website_url() … does that work for you?
September 3, 2014 at 11:19 am #719878Jeff
ParticipantThanks for responding!
No, it seems to return the same value as the <?php the_permalink() ?> echo. The value I am trying to place in the tag for the event cost icon is the URL value found in:
[View Single Event->Edit Event->The Events Calendar Section: Event Website: URL]I have set the value for this URL to the online ticket purchase URL we use, which is separate from our domain. I want to echo that URL as the link for the Event Cost tag, but am unable to locate what the php variable name is for that value. Inspecting the element through my browser produced “tribe-events-event-url” which I don’t see in the single-event.php file. Hope my explanation is clear enough!
September 3, 2014 at 12:07 pm #719954Barry
MemberNo, 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.
September 4, 2014 at 2:07 pm #722615Jeff
ParticipantFound the error in my code. You are correct! Thank you!
September 4, 2014 at 4:33 pm #722923Barry
MemberAwesome, 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!
-
AuthorPosts
- The topic ‘Feature Request: Event Cost Button’ is closed to new replies.
