Okay
  Public Ticket #157017
SSL on woocommerece pages - LOGO image not https
Closed

Comments

  • Scott started the conversation
    Hi, I am setting up SSL and the LOGO image is not converting to https in the pages that are SSL. I've tried numerous things to resolve this... so not I am writing to you :) If I remove the logo image in saliant options then I get the full SSL lock.. without it get partial etc. Is it possible that the theme code is not calling the logo image correctly so that it can be https on SSL enabled pages? I am on version 3.5 of your theme. thanks Scott
  • Scott replied

    Hi,

    I found a method that fixes this issues finally :)

    it would be better of course if i didn't have to use this...

    i'm fairly sure it's the theme - i have one last test to run tomorrow. I'll add a note here when i'm done - i know it will push the ticket down the queue but that is ok.

    thanks Scott

    function filter_content_match_protocols( $content ) {
    	$search = $replace = get_bloginfo( 'home' );
    	
    	if ( ! preg_match( '|/$|', $search ) )
    		$search = $replace = "$search/";
    	
    	if ( is_ssl() ) {
    		$search = str_replace( 'https://', 'http://', $search );
    		$replace = str_replace( 'http://', 'https://', $replace );
    	}
    	else {
    		$search = str_replace( 'http://', 'https://', $search );
    		$replace = str_replace( 'https://', 'http://', $replace );
    	}
    	
    	$content = str_replace( $search, $replace, $content );
    	
    	return $content;
    }
    ob_start( 'filter_content_match_protocols' );
    
    function filter_content_match_protocols_end() {
    	ob_end_flush();
    }
    add_action( 'shutdown', 'filter_content_match_protocols_end', -10 );
    
    

     

  •  1,069
    ThemeNectar replied

    Hey Scott!

    Yes, the framework that is used to upload the image uses a direct URL instead of the img id which would could be used to process https. Your function does the job though and could be stored in a child theme functions.php so it can persist through updates :)

    I'll note to look into other permanent solutions though.

    Cheers!

  • Scott replied

    Cool - if there is a way to make this ticket public someone else may find it useful... in no way dimishes your awesome work !

  •  1,069
    ThemeNectar replied

    Just made it public :)

    Cheers!