Add tooltips for manual and auto refunds Closes #7117

This commit is contained in:
Mike Jolley 2015-01-19 14:49:28 +00:00
parent a9301323b5
commit 0d64e3854d
1 changed files with 7 additions and 4 deletions

View File

@ -279,10 +279,13 @@ if ( wc_tax_enabled() ) {
</table> </table>
<div class="clear"></div> <div class="clear"></div>
<div class="refund-actions"> <div class="refund-actions">
<?php if ( false !== $payment_gateway && $payment_gateway->supports( 'refunds' ) ) : ?> <?php
<button type="button" class="button button-primary do-api-refund"><?php printf( _x( 'Refund %s via %s', 'Refund $amount', 'woocommerce' ), '<span class="wc-order-refund-amount">' . wc_price( 0, array( 'currency' => $order->get_order_currency() ) ) . '</span>', ( ! empty( $payment_gateway->method_title ) ? $payment_gateway->method_title : $payment_gateway->get_title() ) ); ?></button> $refund_amount = '<span class="wc-order-refund-amount">' . wc_price( 0, array( 'currency' => $order->get_order_currency() ) ) . '</span>';
<?php endif; ?> $gateway_supports_refunds = false !== $payment_gateway && $payment_gateway->supports( 'refunds' );
<button type="button" class="button button-primary do-manual-refund"><?php _e( 'Refund manually', 'woocommerce' ); ?></button> $gateway_name = false !== $payment_gateway ? ( ! empty( $payment_gateway->method_title ) ? $payment_gateway->method_title : $payment_gateway->get_title() ) : __( 'Payment Gateway', 'woocommerce' );
?>
<button type="button" class="button <?php echo $gateway_supports_refunds ? 'button-primary do-api-refund' : 'tips disabled'; ?>" <?php echo $gateway_supports_refunds ? '' : 'data-tip="' . esc_attr__( 'The payment gateway used to place this order does not support automatic refunds.', 'woocommerce' ) . '"'; ?>><?php printf( _x( 'Refund %s via %s', 'Refund $amount', 'woocommerce' ), $refund_amount, $gateway_name ); ?></button>
<button type="button" class="button button-primary do-manual-refund tips" data-tip="<?php esc_attr_e( 'You will need to manually issue a refund through your payment gateway after using this.', 'woocommerce' ); ?>"><?php printf( _x( 'Refund %s manually', 'Refund $amount manually', 'woocommerce' ), $refund_amount ); ?></button>
<button type="button" class="button cancel-action"><?php _e( 'Cancel', 'woocommerce' ); ?></button> <button type="button" class="button cancel-action"><?php _e( 'Cancel', 'woocommerce' ); ?></button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>