• Resolved Marisa

    (@marisa2023)


    In a recent update to Woopayments, the name of the payment method is no longer being provided or at least is being provided in a different way that prevents my website fromr reading it.

    On my site I have the different payment methods of

    1. Woopayments (credit card / debit card)
    2. PayPal
    3. Advanced card processing – credit cards using PayPal

    Now for some reason the (2) and (3) payment methods provide their names of “PayPal” and “Advanced card processing – credit cards using PayPal” to my website plugins, but (1) Woopayments (credit card/debit card) does not. When the website user goes to pay, he/she sees the icon for the Woopayment payment method but not text saying “credit card/debit card”.

    This is only a recent problem, so you must have changed something.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Marisa

    (@marisa2023)

    $PG = new WC_Payment_Gateways();
    $lg = $PG->get_available_payment_gateways();

    The problem is the individual payment gatements are not returning ->title

    Plugin Support Moses M. (woo-hc)

    (@mosesmedh)

    Hi @marisa2023,

    I understand how confusing it can be when your site behaves this way. Could you share a link to your site so I can take a closer look?

    Thread Starter Marisa

    (@marisa2023)

    I don’t want to publicly share details here.

    Don’t you have a test website where you can test these things?

    My second post here should help you.

    $PG = new WC_Payment_Gateways();
    $lg = $PG->get_available_payment_gateways();

    The problem is the individual payment gatements are not returning ->title.

    The fact that the PayPal payment methods return a title and the WooPayment ones do not, mean the bug is in your code. Also this is a new bug as the WooPayment code never behaved this way. For over a year, the WooPayment code return a title. Now in the last few weeks it is broken. This is an introduced bug in the WooPayments code.

    Plugin Support Reynier (a11n)

    (@reynierc)

    Hi @marisa2023

    We see that you’re hesitant to share details like the URL of your site, and we respect that. However, sometimes, how your site is setup with different plugins or theme can cause inconsistencies. For example, a theme might not be fully updated to match a new plugin version. Can you confirm if your theme, plugins (especially the ones related to the checkout page), and WordPress core have been updated recently?

    Also to understand better, could you share a screenshot of how it looks on PayPal and Advanced Card Processing vs. on WooPayments? Please make sure to hide or blur any sensitive details (if any). Looking forward to your response.

    Thread Starter Marisa

    (@marisa2023)

    A screenshot is provided. To see it go to the link below.

    https://ibb.co/P6jNHfw

    I can confrim WordPress and all the plugins are up to date and the latest versions.

    • This reply was modified 1 month, 2 weeks ago by Marisa.
    • This reply was modified 1 month, 2 weeks ago by Marisa.
    Plugin Support Mahfuzur Rahman(woo-hc)

    (@mahfuzurwp)

    Hi @marisa2023,

    Thank you for the screenshot. You can actually access the payment method name by using the method_title property for each gateway. Here’s an example of how you can retrieve the payment method name:

    function list_payment_gateway_titles() {
    $PG = new WC_Payment_Gateways();
    $gateways = $PG->get_available_payment_gateways();

    foreach ( $gateways as $gateway_id => $gateway ) {
    // Use method_title as the title
    $title = isset( $gateway->method_title ) ? $gateway->method_title : 'Title not set';

    echo '<p><strong>Gateway ID:</strong> ' . esc_html( $gateway_id ) . '<br>';
    echo '<strong>Title:</strong> ' . esc_html( $title ) . '</p>';
    }
    }
    add_action( 'wp_footer', 'list_payment_gateway_titles' );

    *I'm echoing the information inside the footer just for testing purposes.

    This code will display the method_title of each available payment method, which corresponds to names like “Cash on delivery” or “WooPayments.”

    However, please note that code customization is something out of our support scope. So, I would recommend you consult a developer if you need further customization.

    I hope this helps, let us know if you have more questions.

    Thread Starter Marisa

    (@marisa2023)

    Thanks very much. I will try this soon.

    Thread Starter Marisa

    (@marisa2023)

    Your quick assistance has helped me resolve this matter. It is very much appreciated. Now I don’t have to worry about something like this not working.

    I used ->get_title() rather than ->method_title . It seems for my case ->get_title() works, but not ->title

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.