Title: Change Button Text
Last modified: November 25, 2020

---

# Change Button Text

 *  Resolved [outcold](https://wordpress.org/support/users/outcold/)
 * (@outcold)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/change-button-text-51/)
 * For some reason my theme want’s to make the button text for gift cards “READ 
   MORE” rather than “ADD TO BASKET”. An earlier blog post gave me the following
   code. The second function worked for me but not the first
 * [https://wordpress.org/support/topic/change-button-text-36/](https://wordpress.org/support/topic/change-button-text-36/)
 *     ```
       if ( ! function_exists('yith_woocommerce_gift_cards_add_to_cart_text_custom' ) ) {
       function yith_woocommerce_gift_cards_add_to_cart_text_custom( $button_text ){
       $button_text = 'ADD TO BASKET'; return $button_text;
       }
       }
   
       function yith_ywgc_add_to_cart_button_text( $text, $product) {
           if ($product->get_type() == 'gift-card') {
               $text = __( 'ADD TO BASKET', 'yith-woocommerce-gift-cards' );
           }
           return $text;
       }
       add_filter( 'woocommerce_product_single_add_to_cart_text', 'yith_ywgc_add_to_cart_button_text', 10, 2 );
       ```
   
    -  This topic was modified 5 years, 5 months ago by [outcold](https://wordpress.org/support/users/outcold/).
    -  This topic was modified 5 years, 5 months ago by [outcold](https://wordpress.org/support/users/outcold/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fchange-button-text-51%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * (@yithemes)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/change-button-text-51/#post-13713128)
 * Hello there,
 * hope you are doing well 🙂
 * In this case, you only need to use the second code. We send you on this topic
   the needed code to change the button text:
 *     ```
       function yith_ywgc_add_to_cart_button_text( $text, $product) {
           if ($product->get_type() == 'gift-card') {
               $text = __( 'Add to basket', 'yith-woocommerce-gift-cards' );
           }
           return $text;
       }
       add_filter( 'woocommerce_product_single_add_to_cart_text', 'yith_ywgc_add_to_cart_button_text', 10, 2 );
       ```
   
 * Let us know any news, please.
 * Have a nice day!
 *  Plugin Author [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * (@yithemes)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/change-button-text-51/#post-13931918)
 * Hi there,
 * Due to inactivity, we will mark the topic as solved but feel free to open a new
   one if you have any other issues.
 * If you enjoy our support, we will really appreciate if you can leave us a review
   and a five stars rating -> [https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/reviews/](https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/reviews/)
 * Many thanks and have a nice day!

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

The topic ‘Change Button Text’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-gift-cards/assets/icon-256x256.gif?rev=
   3227932)
 * [YITH WooCommerce Gift Cards](https://wordpress.org/plugins/yith-woocommerce-gift-cards/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-gift-cards/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/reviews/)

## Tags

 * [Button text](https://wordpress.org/support/topic-tag/button-text/)

 * 2 replies
 * 2 participants
 * Last reply from: [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/change-button-text-51/#post-13931918)
 * Status: resolved