Event Organiser to Control Site Fees

Home Forums Ticket Products Community Tickets Event Organiser to Control Site Fees

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1118900
    Tac
    Participant

    Hi,

    I raised this questions once before as well in another form but couldn’t succeed. Here’s try 2.

    We are currently using Stripe payment gateway with WooCommerce. Assuming we have multiple event organisers who sell their event tickets through our website. I would like to give them an ability so that they can control if they wish to absorb the site fees or to pass on to the ticket buyers.I know currently, this option is available only with Paypal Adaptive being turned on

    1. I have reached to a point in Payment Option file and removed ‘IF’ condition where it checks if Paypal Adaptive option is turned on or not.
    2. Then I could remove/comment out Paypal the email option as well
    3. Now I have 2 radio buttons on Event Organiers Payment Option page
    4. When I try to save with any of the option, it doesn’t override to organisers choice of selection.

    Can you please point where I could be wrong? Happy to provide piece of code in Payment Option file which I tried to customise.

    Your help will be greatly appreciated.
    Thank you.

    #1119307
    Hunter
    Moderator

    Hi Tac,

    As much as I would love to help out here, this type of support request reaches beyond what we’re able to cover. I took a look at your post history and found the thread referenced in your initial post. My fellow team member Geoff B. nailed it on the head (as usual) on how the best way to go about achieving the customizations you need.

    Feel free to respond with the code you’ve got and if I see anything that jumps out, I’d be happy to help, but that’s unfortunately as far as I’m able to take it. Thank you for understanding and have a good rest of your day.

    #1120052
    Tac
    Participant

    Hi Hunter,

    Thanks for your response.

    I’ve attached Payment-Options.php file with the editions I have made. Can you please have a look and advise around what needs to be done to enable event organisers to select whether they want to absorb the fees or to pass on without having Paypal Adaptive option turned on.

    Thank you.

    ——————————————————————————————————————————————————————————————————–
    <?php
    /**
    * My Payment Options Template
    * The template for payment options.
    *
    * Override this template in your own theme by creating a file at
    * [your-theme]/tribe-events/community/payment-options.php
    *
    * @package Tribe__Events__Community__Community_Events_Tickets
    * @since 3.1
    * @author Modern Tribe Inc.
    *
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    die( ‘-1’ );
    }
    ?>
    <div id=”tribe-community-events”>
    <div class=”tribe-menu-wrapper”>
    ” class=”button”>
    <?php echo sprintf( __( ‘My %s’, ‘tribe-events-community’ ), tribe_get_event_label_plural() ); ?>

    <?php do_action( ‘tribe_ct_payment_options_nav’ ); ?>
    </div>

    <?php
    do_action( ‘tribe_ct_before_the_payment_options’ );
    $options = get_option( Tribe__Events__Community__Tickets__Main::OPTIONNAME, Tribe__Events__Community__Tickets__Main::instance()->option_defaults );
    ?>

    <form method=”post”>
    <?php wp_nonce_field( ‘tribe_ct_save_payment_options’, ‘payment_options_nonce’ ); ?>

    <?php echo esc_html__( ‘PayPal Optionsxxxxx’, ‘tribe-events-community-tickets’ ); ?>

    <div class=”tribe-section-container”>
    <p>
    <?php
    esc_html_e( ‘Please enter your PayPal email address; this is needed in order to take payment.’, ‘tribe-events-community-tickets’ );
    ?>
    </p>
    <table class=”tribe-community-tickets-payment-options” cellspacing=”0″ cellpadding=”0″>
    <tbody>
    <tr>
    <td>
    <?php tribe_community_events_field_label( ‘paypal_account_email’, __( ‘Email:’, ‘tribe-events-community-tickets’ ) ); ?>
    </td>
    <td>
    <input type=”email” id=”paypal_account_email” name=”paypal_account_email” value=”<?php echo esc_attr( $data[‘paypal_account_email’] ); ?>”/>
    <?php
    if ( Tribe__Events__Community__Tickets__Main::instance()->is_split_payments_enabled() ) {
    ?>
    <div class=”note”>
    <?php
    esc_html_e( ‘Tickets cannot be created without an email address that is associated with PayPal’, ‘tribe-events-community-tickets’ );
    ?>
    </div>
    <?php
    }
    ?>
    </td>
    </tr>
    </tbody>
    </table>
    </div>

    <?php
    $gateway = Tribe__Events__Community__Tickets__Main::instance()->gateway( ‘PayPal’ );

    $flat = $gateway->fee_flat;
    $percentage = $gateway->fee_percentage;

    if ( ‘flat’ === $options[‘site_fee_type’] || ‘flat-and-percentage’ === $options[‘site_fee_type’] ) {
    $flat += (float) $options[‘site_fee_flat’];
    }

    if ( ‘percentage’ === $options[‘site_fee_type’] || ‘flat-and-percentage’ === $options[‘site_fee_type’] ) {
    $percentage += (float) $options[‘site_fee_percentage’];
    }

    if ( $flat || $percentage ) {
    ?>

    <?php echo esc_html__( ‘Ticket Fees’, ‘tribe-events-community-tickets’ ); ?>

    <div class=”tribe-section-container”>
    <table class=”tribe-community-tickets-payment-options” cellspacing=”0″ cellpadding=”0″>
    <tbody>
    <tr>
    <td>
    <?php echo esc_html__( ‘Fee Structure:’, ‘tribe-events-community-tickets’ ); ?>
    </td>
    <td>
    <p>
    <?php
    if ( $flat && $percentage ) {
    echo sprintf(
    esc_html__(
    ‘Fees are %s%% per transaction plus a $%s flat fee per ticket.’,
    ‘tribe-events-community-tickets’
    ),
    number_format( $percentage, 1 ),
    number_format( $flat, 2 )
    );
    } elseif ( $flat ) {
    echo sprintf(
    esc_html__(
    ‘Fees are a flat fee of $%1$s per ticket.’,
    ‘tribe-events-community-tickets’
    ),
    number_format( $flat, 2 )
    );
    } else {
    echo sprintf(
    esc_html__(
    ‘Fees are %s%% per transaction.’,
    ‘tribe-events-community-tickets’
    ),
    number_format( $percentage, 1 )
    );
    }
    ?>
    </p>
    </td>
    </tr>
    <?php
    ( Tribe__Events__Community__Tickets__Main::instance())
    ?>
    <tr>
    <td>
    <?php echo esc_html__( ‘Options:’, ‘tribe-events-community-tickets’ ); ?>
    </td>
    <td>
    <input type=”radio” id=”payment_fee_setting_absorb” name=”payment_fee_setting” value=”absorb” <?php checked( ‘absorb’, $data[‘payment_fee_setting’] ); ?>/>
    <label for=”payment_fee_setting_absorb”><?php echo esc_html__( ‘Include fees in ticket price’, ‘tribe-events-community-tickets’ ); ?></label>
    <p class=”note”>
    <?php echo esc_html__( ‘Fees will be subtracted from the cost of the ticket’, ‘tribe-events-community-tickets’ ); ?>
    </p>
    <input type=”radio” id=”payment_fee_setting_pass” name=”payment_fee_setting” value=”pass” <?php checked( ‘pass’, $data[‘payment_fee_setting’] ); ?>/>
    <label for=”payment_fee_setting_pass”><?php echo esc_html__( ‘Display fees in addition to ticket price’, ‘tribe-events-community-tickets’ ); ?></label>
    <p class=”note”>
    <?php echo esc_html__( ‘Additional fees will be added to the total ticket price’, ‘tribe-events-community-tickets’ ); ?>
    </p>
    </td>
    </tr>
    <?php
    }
    ?>
    </tbody>
    </table>
    </div>
    <?php
    //end if
    ?>
    <div class=”tribe-events-community-footer”>
    <input type=”submit” class=”button submit events-community-submit” value=”<?php echo esc_attr__( ‘Save’, ‘tribe-events-community-tickets’ ); ?>”>
    </div>
    </form>
    </div>
    <?php
    do_action( ‘tribe_ct_before_the_payment_options’ );

    #1120431
    Hunter
    Moderator

    Welcome back,

    Hope you had a good weekend! I hate to be the bearer of bad news, but I don’t see anything obvious that I can assist with after looking at the provided code :-/

    One recommendation I have would be to check out this list of available developers for hire. Again, I wish I could have been able to help more and good luck with the customizations.

    #1126784
    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 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Event Organiser to Control Site Fees’ is closed to new replies.