I have a number of payment gateways (some custom) on my Woocommerce shop for different use scenarios. One of those is set to 'Pay Later', allowing clients to place the order, have an invoice sent to them so they can send the invoice to their accounts team for payment via EFT or a company CC. This has been working well for the last 8 years.
We are now integrating TillPayments as a payment solution to replace a number of others. When I installed the TillPayments plugin (https://github.com/tillpayments/woocommerce-plugin), the Customer Payment Page started only showing the payent gateway selected at checkout, that being 'Pay Later' for all customers who are visiting that page as those are the only orders that require payment. So when someone comes back to pay for their order after opting to 'Pay Later', 'Pay Later' is the only available option and they are stuck in a loop. For reference, I have tried this process with other payment gateways and whichever one selected at checkout is the one that is returned.
I assume the following section in till-payments-creditcard.php is the cause of this, but not being an expert I could be wrong:
public function hide_payment_gateways_on_pay_for_order_page($available_gateways)
{
if (is_checkout_pay_page()) {
global $wp;
$this->order = new WC_Order($wp->query_vars['order-pay']);
foreach ($available_gateways as $gateways_id => $gateways) {
if ($gateways_id !== $this->order->get_payment_method()) {
unset($available_gateways[$gateways_id]);
}
}
}
return $available_gateways;
}
Question: How do I display ALL the payment gatways available?
I've tried removing that block, changing if ($gateways_id !== $this->order->get_payment_method()) to if ($gateways_id == $this->order->get_payment_method()) but that has either returned no gateways or generated an error.