Answer the question
In order to leave comments, you need to log in
How to display a description for two or more payment methods?
This is how the description is displayed for two payment methods. And it works
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$title = ($gateway->id=='enot') ? 'Описание-1.' : 'Описание-2';
?>
<li id="position-center" class="wc_payment_method payment_method_<?php echo esc_attr( $gateway->id ); ?>">
<input id="payment_method_<?php echo esc_attr( $gateway->id ); ?>" type="radio" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php checked( $gateway->chosen, true ); ?> data-order_button_text="<?php echo esc_attr( $gateway->order_button_text ); ?>" />
<label for="payment_method_<?php echo esc_attr( $gateway->id ); ?>" class="bs-tooltip primary mb-3" title="<?php echo $title; ?>" data-toggle="tooltip">
<?php echo $gateway->get_icon(); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?>
</label>
</li>
Answer the question
In order to leave comments, you need to log in
$title = ($gateway->id=='enot') ? 'Описание-1.' : ( ($gateway->id=='Not enot') ? 'Описание-2' : 'Описание-3');
//
$title = ($gateway->id=='enot') ? 'Описание-1.' : ( ($gateway->id=='Not enot') ? 'Описание-2' : ( ($gateway->id=='Bla-Bla') ? 'Описание-3' : 'Описание-4' ) );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question