Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,
    we hope you’re doing well!

    1. You must change that from WooCommerce > Settings > Emails.
    2. You can configure the introductory text from WooCommerce > Settings > Emails > YITH Gift Cards – Gift Card Delivery.
    3. In order to achieve that, add the following code in the functions.php file of your active theme:
    if ( ! function_exists( 'yith_wcgc_template_product_name_text_custom' ) ) {
        function yith_wcgc_template_product_name_text_custom( $text, $object, $context, $product_id ) {
            $product = wc_get_product( $product_id );
    		$product_name_text = is_object( $product ) && $product instanceof WC_Product_Gift_Card ? $product->get_name() : esc_html__( 'Gift card', 'yith-woocommerce-gift-cards' );
            return $product_name_text;
        }
        add_filter( 'yith_wcgc_template_product_name_text', 'yith_wcgc_template_product_name_text_custom', 99, 4 );
    }

    4. Add this code too:

    if ( ! function_exists( 'yith_ywgc_email_description_text_custom' ) ) {
        function yith_ywgc_email_description_text_custom() {
            return esc_html__( 'Your custom text', 'yith-woocommerce-gift-cards' );
        }
        add_filter( 'yith_ywgc_email_description_text', 'yith_ywgc_email_description_text_custom', 99 );
    }

    Regarding the button, you can change the text from the settings of our plugin in Settings > General > Email settings > Button label.

    5. Equal to 1.

    Check it out and tell us if it works well for you, please.

    Best regards.

    Thread Starter thepeppycurator

    (@thepeppycurator)

    Thanks!! They works perfect! Can I check if there’s any chance to change the colour of the Gift Card Amount as well as the button colour too?

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    Try with this code please:

    if (!function_exists('yith_css_to_gift_card_email')) {
      add_filter('woocommerce_email_styles', 'yith_css_to_gift_card_email', 9999, 2);
      function yith_css_to_gift_card_email($css, $email)
      {
          if ($email->id == 'ywgc-email-send-gift-card') {
              $css .= '
            .ywgc-card-amount {
              color: red !important;
             }
             .ywgc-discount-link {
              background-color: red !important;
             }
         ';
          }
          return $css;
      }
    }

    Let us know any news.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customizing Emails’ is closed to new replies.