Posted: 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://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”] if ( $event_id==74 OR $event_id==60) { //check to see if this is the event with the ID of #74 add_action ( ‘action_hook_espresso_display_offline_payment_gateway’, ‘htrappfae_remove_check_from_event’,9 ); 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. |
|
[code language=”php”] if ( $event_id==74 OR $event_id==60) { //check to see if this is the event with the ID of #74 add_action ( ‘action_hook_espresso_display_offline_payment_gateway’, ‘htrappfae_remove_check_from_event’,9 ); |
|
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). |
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.