通过此功能,我可以更改支付按钮上的文本。我想插入一个小图像。
add_filter( 'woocommerce_available_payment_gateways', 'woocommerce_available_payment_gateways' );
function woocommerce_available_payment_gateways( $available_gateways ) {
if (! is_checkout() ) return $available_gateways; // stop doing anything if we're not on checkout page.
if (array_key_exists('paypal_express',$available_gateways)) {
// Gateway ID for Paypal is 'paypal'.
$available_gateways['paypal_express']->order_button_text = __( 'PAY', 'woocommerce' );
}
return $available_gateways;
}
提前感谢您的帮助!
大话西游666