Custom price field, need to move it's location in sidebar

Home Forums Calendar Products Community Events Custom price field, need to move it's location in sidebar

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1031868
    Karen
    Participant

    Hello!
    I need to create a custom field so I can include Early-Bird Pricing in the Cost area of the sidebar. I added the custom field, however, it displays way at the bottom of the sidebar, below the map (VERY far away from the other Cost attribute) and it’s under an “OTHER” subhead. Is there a way for me to add this custom “Early-Bird Pricing” item right below the standard Cost item in the sidebar, where it makes most sense, not in its own “OTHER” subsection?
    Thanks.
    Karen
    EventsCalendarPRO

    #1032275
    George
    Participant

    Hey Karen!

    Is there a way for me to add this custom “Early-Bird Pricing” item right below the standard Cost item in the sidebar, where it makes most sense, not in its own “OTHER” subsection?

    There is a way to do this, but not without some code customization. The process for making these sorts of code changes is described in full here → https://theeventscalendar.com/knowledgebase/themers-guide/

    Once you’re familiar with the general ideas there, we can proceed with the customization. There are two parts: first is to hide the original “other” custom fields section. Next is to add those fields back where desired.

    To hide the original fields, you’d need to add code like the following to your theme’s functions.php file:


    if ( class_exists( 'Tribe__Events__Pro__Single_Event_Meta' ) ) {

    add_action( 'init', 'tribe_1031870' );

    function tribe_1031870() {
    remove_action( 'tribe_events_single_event_meta_primary_section_end', array( Tribe__Events__Pro__Main::instance()->single_event_meta, 'additional_fields' ) );
    }
    }

    Once that’s in place and the default field placement is gone, you can add the field wherever else you want. You will need to take the reins on this and any other code customization, but in general you can just find the template file that suits you best [based on the Themer’s Guide I shared above!] and then place code like the following where you’d like the custom field values to appear:


    tribe_get_template_part( 'pro/modules/meta/additional-fields', null, array(
    'fields' => tribe_get_custom_fields(),
    ) );

    Best of luck with your custom coding!

    George

    #1075820
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Custom price field, need to move it's location in sidebar’ is closed to new replies.