Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1287053
    Rue Nel
    Moderator

    Hello There,

    Thanks for providing the information. I made some changes in your child theme’s functions.php file yet nothing seems to take effect. I do not see my changes after I reload either. I would recommend that edit your contents and make use of this code:

    <?php
    
    // =============================================================================
    // FUNCTIONS.PHP
    // -----------------------------------------------------------------------------
    // Overwrite or add your own custom functions to X in this file.
    // =============================================================================
    
    // =============================================================================
    // TABLE OF CONTENTS
    // -----------------------------------------------------------------------------
    //   01. Enqueue Parent Stylesheet
    //   02. Additional Functions
    // =============================================================================
    
    // Enqueue Parent Stylesheet
    // =============================================================================
    
    add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
    
    // Additional Functions
    // =============================================================================
    add_filter('ngettext', 'x_translate_text' , 20, 3);function x_translate_text ( $translated_text, $single, $plural ) { $translation = array( '%d Item' => '%d', '%d Items' => '%d' ); if( isset( $translation[$single] ) ) { return $translation[$single]; } if( isset( $translation[$plural] ) ) { return $translation[$plural]; } return $translated_text;}
    function my_text_strings( $translated_text, $text, $domain ) {
      switch ( $translated_text ) {
        case 'Return To Shop' :
          $translated_text = __( 'العودة للمتجر', 'woocommerce' );
          break;
        case 'Your cart is currently empty.' :
          $translated_text = __( 'سلة مشترياتك فارغة حاليًا.', 'woocommerce' );
          break;
      }
      return $translated_text;
    }
    add_filter( 'gettext', 'my_text_strings', 20, 3 );
    // Add a second password field to the checkout page.
    add_action( 'woocommerce_checkout_init', 'wc_add_confirm_password_checkout', 10, 1 );
    function wc_add_confirm_password_checkout( $checkout ) {
      if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) {
        $checkout->checkout_fields['account']['account_password2'] = array(
          'type' => 'password',
          'label' => __( 'تاكيد الرقم السري', 'woocommerce' ),
          'required' => true,
          'placeholder' => _x( 'تاكيد الرقم السري', 'placeholder', 'woocommerce' )
        );
      }
    }
    
    // Check the password and confirm password fields match before allow checkout to proceed.
    add_action( 'woocommerce_after_checkout_validation', 'wc_check_confirm_password_matches_checkout', 10, 2 );
    function wc_check_confirm_password_matches_checkout( $posted ) {
      $checkout = WC()->checkout;
      if ( ! is_user_logged_in() && ( $checkout->must_create_account || ! empty( $posted['createaccount'] ) ) ) {
        if ( strcmp( $posted['account_password'], $posted['account_password2'] ) !== 0 ) {
          wc_add_notice( __( 'Passwords do not match.', 'woocommerce' ), 'error' );
        }
      }
    }
    
    // WP Login Errors
    // =============================================================================
    add_filter( 'wp_login_errors', 'override_incorrect_password_msg', 10, 2 );
    function override_incorrect_password_msg( $errors, $redirect_to ) {
        if( isset( $errors->errors['incorrect_password'] ) ) {
            $errors->errors['incorrect_password'][0] = 'Your new translated message';
        }
    
        return $errors;
    }
    
    add_filter( 'wp_login_errors', 'override_incorrect_username_message', 10, 2 );
    function override_incorrect_username_message( $errors, $redirect_to ) {
        if( isset( $errors->errors['invalid_username'] ) ) {
            $errors->errors['invalid_username'][0] = 'Your new translated message';
        }
    
        return $errors;
     }
     // =============================================================================

    If this nothing works, please check out this solution:
    http://www.sutanaryan.com/how-to-filter-or-change-wordpress-admin-error-message/

    Hope this helps.

    #1287370
    maghrabi42
    Participant

    Hello,
    can you update please sap
    thank you so much for support

    #1287485
    maghrabi42
    Participant

    Hello i fixed the issue 🙂
    thank a lot for your information is was very helpful
    thanks for all support in xtheme

    #1287812
    Rad
    Moderator

    You’re so much welcome!

  • <script> jQuery(function($){ $("#no-reply-1284167 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>