banner



How Change Text Color Apply Coupon Button In Woocommerce

WooCommerce Change Apply Coupon Button TextAre you looking for a way to change the apply coupon button text on the cart and checkout page? Coupons are an excellent way of keeping customers in your store engaged. They encourage customers to complete the purchase so that they can get a coupon.

You can also use them as incentives to entice loyal customers.

However, you may want to change the apply button text on the cart and checkout page.

You should not worry, as it is not a complicated process to achieve this. But you need some coding skills to use this solution.

WooCommerce does not have a built-in option to achieve this. This is why we will use a custom PHP code snippet.

WooCommerce Change Apply Coupon Button Text

By the end of this post, you should be able to change the apply coupon button on the cart and checkout page.

However, we recommend that you use a child theme to make changes. This will ensure that your changes are not lost when an update occurs.

Let us look at how you can achieve this.

Steps to Change the Apply Coupon Button Text

This is how the Apply Coupon button is displayed on the cart and checkout page respectively:cart coupon checkout coupon

Here are the steps you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file where we will add the function that will change the apply coupon button on the cart and checkout page.
  3. Add the following code to the functions.php file:
            add_filter( 'gettext', 'bt_rename_coupon_field_on_cart', 10, 3 );  add_filter( 'woocommerce_coupon_error', 'bt_rename_coupon_label', 10, 3 );  add_filter( 'woocommerce_coupon_message', 'bt_rename_coupon_label', 10, 3 );  add_filter( 'woocommerce_cart_totals_coupon_label', 'bt_rename_coupon_label',10, 1 );  add_filter( 'woocommerce_checkout_coupon_message', 'bt_rename_coupon_message_on_checkout' );  /**   * WooCommerce  */  function njengah_rename_coupon_field_on_cart( $translated_text, $text, $text_domain ) {              // bail if not modifying frontend woocommerce text              if ( is_admin() || 'woocommerce' !== $text_domain ) {                          return $translated_text;              }              if ( 'Coupon:' === $text ) {                          $translated_text = 'Voucher Code:';              }              if ('Coupon has been removed.' === $text){                          $translated_text = 'Voucher code has been removed.';              }              if ( 'Apply coupon' === $text ) {                          $translated_text = 'Apply Voucher';              }              if ( 'Coupon code' === $text ) {                          $translated_text = 'Voucher Code';                          }                 return $translated_text;  }  // Rename the "Have a Coupon?" message on the checkout page  function njengah_rename_coupon_message_on_checkout() {              return 'Have a coupon code?' . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'woocommerce' ) . '';  }  function njengah_rename_coupon_label( $err, $err_code=null, $something=null ){              $err = str_ireplace("Coupon","Voucher Code ",$err);              return $err;  }
  1. This is the outcome on the cart and checkout page respectively:change cart voucher change Checkout voucher

Conclusion

In this post, we have shared a custom PHP snippet that allows you to change the coupon code button on the cart and checkout page.

If you are not comfortable with handling code, we recommend that you contact a qualified WordPress developer. This is because if you make any error in the functions.php file, it will break down your site.

Similar Articles

  1. How to Install WooCommerce Storefront Step By Step [Complete Guide]
  2. How to Put WooCommerce Cart and Checkout on One Page
  3. How to Create WooCommerce Custom Shop Page
  4. How to Disable Coupons In WooCommerce
  5. WooCommerce Storefront Theme Review
  6. How to Keep WooCommerce Description Tab Open by Default
  7. How to Add New Tab WooCommerce Product Page
  8. How to Create Coupon In WooCommerce
  9. How to Add Currency to WooCommerce [Custom Currency]
  10. How to Change Currency Symbol In WooCommerce
  11. How to Customize WooCommerce Currency [Code Snippets]
  12. How to Add Custom WooCommerce Payment Icons Checkout Page
  13. How to Change Add to Cart Text WooCommerce Guide with Examples
  14. How to Set Up Homepage in WooCommerce Storefront
  15. How to Create Custom Order Received Page WooCommerce
  16. How to Hide Product Prices Based on User Role Storefront

How Change Text Color Apply Coupon Button In Woocommerce

Source: https://njengah.com/woocommerce-change-apply-coupon-button-text/

Posted by: murraybrounrave.blogspot.com

0 Response to "How Change Text Color Apply Coupon Button In Woocommerce"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel