Title: Extra text on cod payment option
Last modified: March 27, 2018

---

# Extra text on cod payment option

 *  Resolved [umar25](https://wordpress.org/support/users/umar25/)
 * (@umar25)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/extra-text-on-cod-payment-option/)
 * Hello,
 * I have extra text on the “cash on delivery” option, at the end written “”Array”
   how can i get rid of it?
 * [here is the pic](https://drive.google.com/file/d/1ymgOhFXFiFwc4Bxnj6sViDLNYCO8UfWI/view?usp=sharing)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [8 years, 1 month ago](https://wordpress.org/support/topic/extra-text-on-cod-payment-option/#post-10121796)
 * There is likely a plugin or theme conflict causing this. Temporarily disable 
   all other plugins except for WooCommerce, and switch to a default theme and test
   to see if this still happens. If it is solved at this point, start to enable 
   features until you see it happening again. More info: [https://docs.woocommerce.com/document/woocommerce-self-service-guide/#section-4](https://docs.woocommerce.com/document/woocommerce-self-service-guide/#section-4)
 *  Thread Starter [umar25](https://wordpress.org/support/users/umar25/)
 * (@umar25)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/extra-text-on-cod-payment-option/#post-10121824)
 * Thank you for your reply, i did tried.
 * i would like to add that when i added this:
 *     ```
       add_filter('woocommerce_cod_icon', 'change_my_icons');
       function change_my_icons( $icons ) {
       	$icons['cod'] = <img src="the image path " height="20" />;
   
         return $icons;
       }
       ```
   
 * to functions.php, i get rid of “Array”, however i get a broken image and the 
   alt text? (i do got the image png and svg, and the path is correct)
 * any ideas?
    -  This reply was modified 8 years, 1 month ago by [umar25](https://wordpress.org/support/users/umar25/).
    -  This reply was modified 8 years, 1 month ago by [umar25](https://wordpress.org/support/users/umar25/).
    -  This reply was modified 8 years, 1 month ago by [umar25](https://wordpress.org/support/users/umar25/).
    -  This reply was modified 8 years, 1 month ago by [umar25](https://wordpress.org/support/users/umar25/).
    -  This reply was modified 8 years, 1 month ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [8 years, 1 month ago](https://wordpress.org/support/topic/extra-text-on-cod-payment-option/#post-10125247)
 * The `array()` text showed up when only the WooCommerce plugin was active along
   with a default WordPress theme in use? That seems fairly unlikely as everybody
   else using this payment gateway isn’t seeing this error. Could you take a screenshot
   of this happening with the above conditions? (Only WC active and a default WP
   theme).
 * And then if it does still happen, have you made any code edits to the WooCommerce
   plugin itself, or do you have snippets like the above one anywhere else?
 * _______
 * As for the code snippet, that is incorrect use of the filter. Just need to return
   a string:
 *     ```
       add_filter( 'woocommerce_cod_icon', 'change_cod_gateway_icon' );
       function change_cod_gateway_icon() {
       	return '<img src="https://pathtoimage.com/image.png" height="20" />';
       }
       ```
   
 *  Thread Starter [umar25](https://wordpress.org/support/users/umar25/)
 * (@umar25)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/extra-text-on-cod-payment-option/#post-10125603)
 * thank you for getting back to me on this, and am sorry for the confusion, the
   plugin is working fine with the default theme, after installing custom theme 
   and translating it to arabic that text showed up.
 * this Array text shows up for: cod, bank transfer, and cheque options.
 * as for the code you gave me, the result is:
    [https://drive.google.com/open?id=1V0jEYxusiSxMP9r1TxNsR1a8UYqBaJLw](https://drive.google.com/open?id=1V0jEYxusiSxMP9r1TxNsR1a8UYqBaJLw)
 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [8 years, 1 month ago](https://wordpress.org/support/topic/extra-text-on-cod-payment-option/#post-10129188)
 * Oh, my bad. So you only want to return the image source with that filter:
 *     ```
       add_filter( 'woocommerce_cod_icon', 'change_cod_gateway_icon' );
       function change_cod_gateway_icon() {
       	return 'https://s.w.org/images/home/screen-themes.png?3';
       }
       ```
   
 * You would do all of the markup if using this filter: [https://github.com/woocommerce/woocommerce/blob/28a4e88811abd53280cc05f20067ce26e54826e4/includes/abstracts/abstract-wc-payment-gateway.php#L306](https://github.com/woocommerce/woocommerce/blob/28a4e88811abd53280cc05f20067ce26e54826e4/includes/abstracts/abstract-wc-payment-gateway.php#L306)
 *  Thread Starter [umar25](https://wordpress.org/support/users/umar25/)
 * (@umar25)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/extra-text-on-cod-payment-option/#post-10139416)
 * thank you very much,
 * problem solved, heros saved the day 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Extra text on cod payment option’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [umar25](https://wordpress.org/support/users/umar25/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/extra-text-on-cod-payment-option/#post-10139416)
 * Status: resolved