• Resolved dhelvaci

    (@dhelvaci)


    Hi,

    It seems that currently when reviewing orders and in the emails going out to customers, the payment method shown is the name of the payment gateway ie. the name of the plugin.

    Is there a way to change this to be the actual payment provider (eg. MasterCard or the name of the customer’s bank)?

    I would really appreciate any help on this as it is very misleading to a customer to see something else than the payment provider as the payment method.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author loueranta

    (@loueranta)

    Hi and sorry for the delayed reply,

    This is a good idea and I’ll add it to the plugin’s development roadmap.


    Joonas Loueranta
    Development Manager
    OP Financial Group

    Thread Starter dhelvaci

    (@dhelvaci)

    Hi @loueranta,

    Thank you for your reply.

    Looking forward to putting this feature to use. ??

    Thanks again!

    Plugin Contributor henrykhelskygeniem

    (@henrykhelskygeniem)

    Hello @dhelvaci

    You can hook up to the email templating via the ‘woocommerce_email_order_meta_fields’ hook for example. The provider name is stored in the WooCommerce session.

    Please see the example below.

    
    add_filter( 'woocommerce_email_order_meta_fields', 'custom_woocommerce_email_order_meta_fields', 10, 3 );
    
    function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {
    
        if (WC()->session) {
            $provider = WC()->session->get('payment_provider');
            if ($provider) {
                $order->set_payment_method_title($order->get_payment_method_title() .  ': ' . ucfirst($provider->getName()));
            }
        }
    
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Selected Payment Provider to Order Details’ is closed to new replies.