mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Use get_icon
to display credit card gateway icons
This commit is contained in:
parent
78fa4a5437
commit
a123a63afe
1 changed files with 6 additions and 10 deletions
|
@ -236,21 +236,16 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the title of the gateway.
|
* Returns the icons of the gateway.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function get_title() {
|
public function get_icon() {
|
||||||
|
$icon = parent::get_icon();
|
||||||
|
|
||||||
//phpcs:disable WordPress.Security.NonceVerification.Recommended
|
|
||||||
if ( ! is_checkout() || ( is_ajax() && isset( $_GET['wc-ajax'] ) && 'update_order_review' !== $_GET['wc-ajax'] ) ) {
|
|
||||||
return parent::get_title();
|
|
||||||
}
|
|
||||||
//phpcs:enable WordPress.Security.NonceVerification.Recommended
|
|
||||||
$title = parent::get_title();
|
|
||||||
$icons = $this->config->has( 'card_icons' ) ? (array) $this->config->get( 'card_icons' ) : array();
|
$icons = $this->config->has( 'card_icons' ) ? (array) $this->config->get( 'card_icons' ) : array();
|
||||||
if ( empty( $icons ) ) {
|
if ( empty( $icons ) ) {
|
||||||
return $title;
|
return $icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
$title_options = $this->card_labels();
|
$title_options = $this->card_labels();
|
||||||
|
@ -264,7 +259,8 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
|
||||||
},
|
},
|
||||||
$icons
|
$icons
|
||||||
);
|
);
|
||||||
return $title . implode( '', $images );
|
|
||||||
|
return implode( '', $images );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue