我想更新paypal图标:
下面是他们如何放置信用卡图标:
/**
* Returns the gateway icon markup
*
* @since 1.0.0
* @see WC_Payment_Gateway::get_icon()
* @return string icon markup
*/
public function get_icon() {
$icon = \'\';
// specific icon
if ( $this->icon ) {
// use icon provided by filter
$icon = sprintf( \'<img src="%s" alt="%s" class="sv-wc-payment-gateway-icon wc-%s-payment-gateway-icon" />\', esc_url( \\WC_HTTPS::force_https_url( $this->icon ) ), esc_attr( $this->get_title() ), esc_attr( $this->get_id_dasherized() ) );
}
// credit card images
if ( ! $icon && $this->supports_card_types() && $this->get_card_types() ) {
// display icons for the selected card types
foreach ( $this->get_card_types() as $card_type ) {
$card_type = SV_WC_Payment_Gateway_Helper::normalize_card_type( $card_type );
if ( $url = $this->get_payment_method_image_url( $card_type ) ) {
$icon .= sprintf( \'<img src="%s" alt="%s" class="sv-wc-payment-gateway-icon wc-%s-payment-gateway-icon" width="40" height="25" style="width: 40px; height: 25px;" />\', esc_url( $url ), esc_attr( $card_type ), esc_attr( $this->get_id_dasherized() ) );
}
}
}
// echeck image
if ( ! $icon && $this->is_echeck_gateway() ) {
if ( $url = $this->get_payment_method_image_url( \'echeck\' ) ) {
$icon .= sprintf( \'<img src="%s" alt="%s" class="sv-wc-payment-gateway-icon wc-%s-payment-gateway-icon" width="40" height="25" style="width: 40px; height: 25px;" />\', esc_url( $url ), esc_attr( \'echeck\' ), esc_attr( $this->get_id_dasherized() ) );
}
}
/* This filter is documented in WC core */
return apply_filters( \'woocommerce_gateway_icon\', $icon, $this->get_id() );
}
下面是他们如何放置贝宝图标:
public function get_icon() {
// from https://www.paypal.com/webapps/mpp/logos-buttons
$icon_html = \'<img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/PP_logo_h_100x26.png" alt="PayPal" />\';
return apply_filters( \'woocommerce_gateway_icon\', $icon_html, $this->get_id() );
}
希望这更清楚。谢谢