Add prices to photo view

Home Forums Calendar Products Events Calendar PRO Add prices to photo view

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #224604
    indrakubicek
    Participant

    How can I add the price field to the photo view? Thanks!

    #229387
    Casey
    Participant

    indrakubicek,
    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-

    #229584
    indrakubicek
    Participant

    Thanks 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

    #229799
    Casey
    Participant

    indrakubicek,
    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-

    #233220
    indrakubicek
    Participant

    Hi 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!

    #233254
    indrakubicek
    Participant

    Aha, 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;
    }
    
    #233257
    indrakubicek
    Participant

    Just 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;
    }
    
    #233265
    indrakubicek
    Participant

    damn, formatting wrong on the above post and not possible to edit, hopefully you get the picture :-/

    #235213
    Casey
    Participant

    Great! 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

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Add prices to photo view’ is closed to new replies.