Posted: July 18, 2014 at 11:22 am
|
hi team basically i want to enable check only for selective events pls help to reply soon ..thanks |
currently you can’t do that in EE4. That feature has been requested previously and we do have plans to implement it, although there is no current estimated delivery date. It might be possible if you’re willing to tweak some of the single page checkout code. Basically you would just see what event the user has registered for, and then hide the check gateway if it’s no in the list of allowed events. Would you like some tips on how to do that? |
|
|
Dear Micheal pls suggest what i need to do thanks |
|
im waiting for your response |
|
Hi, I’ve sent Mike a message regarding this, he will be in touch as soon as possible. |
|
ok thanks Dean |
|
No problem, sorry for the delay. |
sorry I was hoping the developer who deals more with single page checkout would be able to comment in, but he’s pretty swamped. in ee4, early on in the page loading process all the gateways are constructed and add a callback on the ‘AHEE__display_payment_gateways’ action, so that when that action is fired (ie ‘do_action’) in the modules/single_page_checkout/templates/registration_page_payment_options.template.php, each active gateway’s espresso_display_payment_gateways() method is called, which echoes out the HTML to add the gateway as an option. So on an earlier than ‘AHEE__display_payment_gateways’, like ‘AHEE__registration_page_payment_options__payment_info_table_amount_owing_row_end’ (which is also in the same template file, just a few lines earlier), you could run some code like the following:
This code could be inserted into your theme’s functions.php file. If users have registered for an event with ID 9 or 23, it will hide the Check gateway. So if you wanted it to include different events you’d have to manually change that array of IDs, or if you wanted to hide different gateways you’d have to change the array used in espresso_dont_show_certain_gateways() too. You might want to add more logic about how those arrays are chosen. For example, you could get the list of events using a database query, searching for events with a particular postmeta value (it would probably be easiest to use get_posts() for this)
|
|
The support post ‘how can i enable/disable payment methods for different event in EE4’ 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.