• Resolved Corke420

    (@corke420)


    Hello,

    I would like to know how override the page : class-xoo-el-frontend.php

    I have tried in my child theme in folder templates like for others files but don’t work : /

    great plugins btw !

    Thanks

    • This topic was modified 5 years, 9 months ago by Corke420.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Corke420

    (@corke420)

    Still no solution ?

    Thanks

    Plugin Contributor xootixsupport

    (@xootixsupport)

    Hi @corke420

    class-xoo-el-frontend.php is not a template file.
    May I know what you’re trying to edit.

    Thread Starter Corke420

    (@corke420)

    Hi @xootixsupport

    Thanks to answer me,

    There is many reasons I have modify this file :

    1. I got a conflict with font-awesome, and have to rename the name of enqueu in the plugin :

    wp_enqueue_style(‘font-awesome-plugin’,’https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css’);

    2. I have change the language of text registration & login : function get_js_strings

    3. I needed to customize the “My account” button : $change_to_text = __('<i class="fa fa-user" aria-hidden="true"></i> Mon Compte','easy-login-woocommerce');

    4. Same for the login switch button :

    case 'login':
    	$class .= 'xoo-el-login-tgr';
    	$text  	= __('<i class="fa fa-user" aria-hidden="true"></i> S\'inscrire / se connecter à Jarl','easy-login-woocommerce');
    	break;

    Thanks!

    Plugin Contributor xootixsupport

    (@xootixsupport)

    Hi,

    It is surely not recommended to edit core files of the plugin.
    You can achieve the same through functions.php
    I’ve code this snippet for above 4 issues.
    Read the comments “//” you will understand.
    Last function xoo_cu_markup_shortcode is for the shortcode, you can edit the way you want,

    //Fix font awesome
    add_action('wp_enqueue_scripts',function(){
    
    	//Removes plugin font awesome script
    	wp_dequeue_style( 'font-awesome');
    
    	//Add again
    	wp_enqueue_style('font-awesome-plugin','https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
    },1000);
    
    //Remove default shortcode function from the plugin
    function xoo_cu_el_frontend_handler(){
    	if( is_admin() ) return;
    	$handler = new Xoo_El_Frontend();
    	add_shortcode( 'xoo_el_action', 'xoo_cu_markup_shortcode' );
    }
    add_action('init','xoo_cu_el_frontend_handler');
    
    //Editing Shortcode function
    function xoo_cu_markup_shortcode($user_atts){
    
    	$atts = shortcode_atts( array(
    		'action' 			=> 'login', // For version < 1.3
    		'type'				=> 'login',
    		'change_to' 		=> 'logout',
    	), $user_atts, 'xoo_el_action');
    
    	$class = 'xoo-el-action-sc ';
    
    	if( is_user_logged_in() ){
    
    		if( $atts['change_to'] === 'myaccount' ) {
    			$change_to_link = wc_get_page_permalink( 'myaccount' );
    			$change_to_text =  __('My account','easy-login-woocommerce');
    		}
    		else{
    			$gl_options  	= get_option('xoo-el-general-options');
    			$logout_link 	= !empty( $gl_options['m-logout-url'] ) ? $gl_options['m-logout-url'] : $_SERVER['REQUEST_URI'];
    			$change_to_link = wp_logout_url( $logout_link );
    			$change_to_text =  __('Logout','easy-login-woocommerce');
    		}
    
    		$html =  '<a href="'.$change_to_link.'" class="'.$class.'">'.$change_to_text.'</a>';
    	}
    	else{
    		$action_type = isset( $user_atts['action'] ) ? $user_atts['action'] : $atts['type'];
    		switch ( $action_type ) {
    			case 'login':
    				$class .= 'xoo-el-login-tgr';
    				$text  	= __('Login','easy-login-woocommerce');
    				break;
    
    			case 'register':
    				$class .= 'xoo-el-reg-tgr';
    				$text  	= __('Signup','easy-login-woocommerce');
    				break;
    
    			case 'lost-password':
    				$class .= 'xoo-el-lostpw-tgr';
    				$text 	= __('Lost Password','easy-login-woocommerce');
    				break;
    			
    			default:
    				$class .= 'xoo-el-login-tgr';
    				$text 	= __('Login','easy-login-woocommerce');
    				break;
    		}
    
    		$html = '<a class="'.$class.'">'.$text.'</a>';
    	}
    	return $html;
    }
    Thread Starter Corke420

    (@corke420)

    Hello !

    Perfect thanks for this fix!

    I forgot speak about the error message, how we can achive this without modifying the core file ?

    Best regards and Thanks ! Gonna for premium soon ??

    Plugin Contributor xootixsupport

    (@xootixsupport)

    Hello,

    Are you asking to change text?
    You need to translate the plugin for that, you can use any wp translation plugin or here is our way.
    https://docs.xootix.com/easy-login-for-woocommerce/#translation

    Thread Starter Corke420

    (@corke420)

    Ok I use Weglot don’t think he can translate this, I will try myself,

    Otherwise the script you send me cause lot of warning :

    https://gyazo.com/81e73ee39fc2c413252cc415cf8ba86d

    Any idae ?

    Best regards
    julien

    Thread Starter Corke420

    (@corke420)

    All is solved by using the translation system!

    Thanks gonna buy =)

    • This reply was modified 5 years, 8 months ago by Corke420.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to override : class-xoo-el-frontend.php’ is closed to new replies.