Home › Forums › Calendar Products › Events Calendar PRO › Add prices to photo view
- This topic has 8 replies, 2 voices, and was last updated 11 years, 10 months ago by
Casey.
-
AuthorPosts
-
June 13, 2014 at 9:08 pm #224604
indrakubicek
ParticipantHow can I add the price field to the photo view? Thanks!
June 16, 2014 at 7:21 am #229387Casey
Participantindrakubicek,
Thanks for getting in touch! In order to customize the Photo view, you’d need to perform a template override and customize the view to add the price. Take a look at our themer’s guide, which will show you how to properly override template files.After overriding the photo view template file (views/pro/photo/single-event.php), you’d use the tribe_get_cost() function in order to display the cost.
Hopefully that gets you pointed in the right direction. Thanks! 🙂
-Casey-
June 16, 2014 at 9:16 am #229584indrakubicek
ParticipantThanks Casey,
I’d got as far as knowing that I needed to override the photo template(s) but wasn’t sure which ones to override and how.I just tried pasting in the follow line to /tribe-events/pro/photo/single-event.php :
<?php echo tribe_get_cost() ?>
This kinda works, but doesn’t display it nicely like it is displayed in the list view (i.e. with the currency symbol and with a nice little grey box around it).
I then tried copy/ pasting the relevant code as used in the list view i.e.<?php if ( tribe_get_cost() ) : ?>
<div class="tribe-events-event-cost">
<span><?php echo tribe_get_cost( null, true ); ?></span>
</div>
<?php endif; ?>
but then the price no longer displayed at all…Any additional help on exactly what code to place in /tribe-events/pro/photo/single-event.php in order to make it display nicely very warmly received.
Thanks
June 16, 2014 at 11:38 am #229799Casey
Participantindrakubicek,
Unfortunately, due to our limited support resources, we’re unable to help with site-specific customizations like this. We can generally point you in the right direction with regards to getting started with a customization (like I did above), but from there you’ll have to troubleshoot things on your own.Again, sorry I can’t be of further help here, but good luck and thanks! 🙂
-Casey-
June 18, 2014 at 7:52 am #233220indrakubicek
ParticipantHi Casey,
Thanks for the initial pointer but I’m really struggling to get this working.
Displaying the prices is a pretty basic/ key bit of functionality so I don’t really get why it is not displayed on the photo view (whereas it is displayed pretty much everywhere else).
Again, any additional help to simply get the price showing on the photo view very warmly received. At the very least I need the relevant currency symbol to be displayed.
Thanks!
June 18, 2014 at 8:15 am #233254indrakubicek
ParticipantAha, upon further experimentation I tried the following:
<?php echo tribe_get_cost( null, true ); ?>And now the currency symbol is displayed! (shows how much I know about how functions work! i.e. very little! 😛 )
Also managed to style in the end too 😀
(funny how often getting desperate and asking a question somehow helps to answer it oneself).For some reason trying to use the tribe-events-event-cost css class used elsewhere didn’t seem to work (just made the price disappear), so I created tribe-events-event-cost-photo and used that instead.
Now I have the following in my tribe-events-pro.css file and all seems to work fine 😀 :
/* Styling price on photo page ----------------------------------------- */ div.tribe-events-event-cost-photo { border: 1px solid #ddd; float: right; text-align: center; padding: 5px 10px; font-weight: bold; background: white; }June 18, 2014 at 8:21 am #233257indrakubicek
ParticipantJust to add so this can be a complete solution to anyone else who wants to achieve the same thing, I put this code:
‘
<!– Add event cost –>
<div class=”tribe-events-event-cost-photo”>
<?php echo tribe_get_cost( null, true ); ?>
</div>In my /theme-folder/tribe-events/pro/photo/single-event.php file (I've got it after the line ending <!-- .tribe-events-event-meta --> which seems to work OK for me, but I guess you could experiment with putting it in other places too) I've then got the following css in my /theme-folder/tribe-events/pro/tribe-events-pro.css file: ' /* Styling price on photo page ----------------------------------------- */ div.tribe-events-event-cost-photo { border: 1px solid #ddd; float: right; text-align: center; padding: 5px 10px; font-weight: bold; background: white; }June 18, 2014 at 8:22 am #233265indrakubicek
Participantdamn, formatting wrong on the above post and not possible to edit, hopefully you get the picture :-/
June 19, 2014 at 5:37 am #235213Casey
ParticipantGreat! Glad to see that you were able to figure this out! Since it looks like you’re all set, I’m going to mark this thread “Answered” and close it out.
By the way, if you have a minute or two, we would love it if you’d write a few words for us here: http://m.tri.be/lo
Thanks in advance. 🙂
Cheers,
Casey -
AuthorPosts
- The topic ‘Add prices to photo view’ is closed to new replies.
