Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Credit card only for only two events | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Credit card only for only two events

Credit card only for only two events

Posted: November 14, 2013 at 8:50 pm

Viewing 2 reply threads


bwilcox

November 14, 2013 at 8:50 pm

Hi There,

We currently accespt both credit card through the stripe gateway as well as check and money order. For two of our upcoming events we need to change to accepting just stripe for those events only. I came accross this in your support forum https://staging.eventespresso.com/topic/different-payment-gateways-for-different-events-2/ which pointed me to adding the following to my theme’s functions.php

[code language=”php”]
function htrappfae_remove_check_from_event($payment_data) {
extract( $payment_data );

if ( $event_id==74 OR $event_id==60) { //check to see if this is the event with the ID of #74
echo “Event Espresso ID: $event_id”;
remove_action( ‘action_hook_espresso_display_offline_payment_gateway’,’espresso_display_check’,9 );
}
}

add_action ( ‘action_hook_espresso_display_offline_payment_gateway’, ‘htrappfae_remove_check_from_event’,9 );
[/code]

I am able to tell that the function is working somewhat as it echos the Event ID for the two events we would like to change but the check/money order payment option is still showing up. Any help you can provide would be greatly appreciated.

  • This topic was modified 11 years, 2 months ago by bwilcox.
  • This topic was modified 11 years, 2 months ago by bwilcox.
  • This topic was modified 11 years, 1 month ago by bwilcox.


bwilcox

November 14, 2013 at 8:53 pm

[code language=”php”]
function htrappfae_remove_check_from_event($payment_data) {
extract( $payment_data );

if ( $event_id==74 OR $event_id==60) { //check to see if this is the event with the ID of #74
echo “Event Espresso ID: $event_id”;
remove_action( ‘action_hook_espresso_display_offline_payment_gateway’,’espresso_display_check’,9 );
}
}

add_action ( ‘action_hook_espresso_display_offline_payment_gateway’, ‘htrappfae_remove_check_from_event’,9 );
[/code]


Dean

  • Support Staff

November 15, 2013 at 12:56 am

Hi,

The gateway code has changed slightly since that point. The code would now look like this:

function htrappfae_remove_check_from_event($payment_data) {
  extract( $payment_data );
    if ( $event_id==8) { //check to see if this is the event with the ID of #74
        //echo "Event Espresso ID: $event_id";
        remove_action('action_hook_espresso_display_offline_payment_gateway_2','espresso_display_check' );
        remove_action('action_hook_espresso_display_offline_payment_gateway_2', 'espresso_display_purchase_order');
    }
}

add_action ( ‘action_hook_espresso_display_offline_payment_gateway’, ‘htrappfae_remove_check_from_event’,9 );

Please note that if you want to do this with other gateways, you will need to check the action hook in each gateway as they may well be slightly different (e.g. invoice doesn’t currently have the _2 at the end).

Viewing 2 reply threads

The support post ‘Credit card only for only two events’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso - Staging Server