Support » Plugin: Hyyan WooCommerce Polylang Integration » enable ifthenpay gateway instructions on order emails

  • Resolved tiagorestivo

    (@tiagorestivo)


    Dear Support,

    I’ve found that Gateways.php is removing gateway instructions within removeGatewayActions() function, on line 138. I’m using ifthenpay gateway plugin for electronic payment in Portugal and i am not able to send payment instructions through email with the current Gateways.php configuration. Is it possible to include a specific gateway filter so the instructions are not removed by this function? If i comment the line 138 on Gateways.php everything seems to work fine (i’m able to automatically send the instructions by email). Is there any problem with that workaround?

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi

    If you are using in addition to ifthenpay gateway any of the default woocommerce gateways, commenting out that line will duplicate the email instructions.

    ifthenpay gateway has support for Polylang but the woocommerce default extentions don’t, so this is required.

    So a better solution than just commenting out the line is to replace the entire function with this one

        public function removeGatewayActions()
        {
            $default_gateways = array('bacs', 'cheque', 'cod');
            
            foreach ($this->enabledGateways as $gateway) {
                if (in_array($gateway->id, $default_gateways)) {
                    remove_action('woocommerce_email_before_order_table', array($gateway, 'email_instructions'));
                    remove_action('woocommerce_thankyou_'.$gateway->id, array($gateway, 'thankyou_page'));
                    //remove_action( 'woocommerce_update_options_payment_gateways_' . $gateway->id, array( $gateway, 'process_admin_options' ) );
                }
                if ('bacs' == $gateway->id) {
                    remove_action('woocommerce_update_options_payment_gateways_'.$gateway->id, array($gateway, 'save_account_details'));
                }
            }
        }

    Untested but should work. I will prepare a patch for Hyyan to publish when he has time.

    In case you don’t want to play around with code, just download the new release candidate (0.29) not released yet from github.

    https://github.com/hyyan/woo-poly-integration/archive/new_release.zip

    It contain a few more fixes:
    * Fixed PHP notice due to Polylang deprecated functions
    * Fixed WordPress database error in reports page
    * Fixed missing argument warning in order detailspage and emails
    * Fixed strpos() empty needle warning for empty endpoints
    * Fix removing email instructions from 3rd party payment gateways

    Thread Starter tiagorestivo

    (@tiagorestivo)

    Hi,
    Problem solved, thank you for your help.
    Ifthenpay already released fix for this too.
    Congrats for your great work.
    Regards.

    I’m happy to hear that you got it to work. Thanks for the feedback. Please don’t forget to mark the thread as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘enable ifthenpay gateway instructions on order emails’ is closed to new replies.