Created
November 24, 2020 10:29
-
-
Save Thisura98/68a53feaf21d27735906fc5362614d49 to your computer and use it in GitHub Desktop.
Change the PayHere Logo in the PayHere WooCommerce Plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'woocommerce_gateway_icon', 'modify_payhere_ico', 10, 2 ); | |
| function modify_payhere_ico($ico_html, $payment_gateway_id){ | |
| if ( $payment_gateway_id != 'payhere' ){ | |
| return $ico_html; | |
| } | |
| $current_image_url = '/(.+)(https:\/\/www.payhere.lk\/downloads\/images\/payhere_long_banner.png)(.+)/'; | |
| $new_image_url = 'https://bit.ly/3pijjpk'; // replace this | |
| $new_image_url_pattern = '$1' . $new_image_url . '$3'; | |
| $ico_html = preg_replace( $current_image_url, $new_image_url_pattern, $ico_html ); | |
| return $ico_html; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment