• Resolved awideman

    (@awideman)


    Hi Marcel,

    Thanks for the helpful plugin!

    I have Featured Image From URL Premium installed and the external images have been working in categories up until recently (just checked today). Not sure why they stopped working. The external images still show up on product pages.

    I am using images from Amazon’s product API as the external images.

    Viewing the source of a product page, the src of the image is linked as follows:
    https://images-na.ssl-images-amazon.com/images/I/41pQ4mX37oL.AA500.jpg – works

    View post on imgur.com

    However, viewing the source of a category page, the src of the image is linked as follows
    //images-na.ssl-images-amazon.com/images/I/41pQ4mX37oL.AA500.jpg – doesn’t work.

    View post on imgur.com

    Sorry the images are a bit small. You can click them to enlarge.

    Please advise on how the links in the woocommerce loop for the category pages can be changed to specify “https://”

    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Marcel

    (@marceljm)

    Hi, @awideman.

    In the setting you can get the email for support. It’s faster.

    Anyway, the problem problem happened because you updated WooCommerce.

    WooCommerce is causing that once it’s replacing “https://” by “//” on shop.

    It shouldn’t be a problem. However your images are very specific because they can be accessed using “https” but not “http”.

    So I’ll give you two solutions:

    Solution 1:

    1) open
    woocommerce/includes/wc-core-functions.php

    2) replace the line 1910
    $wp_base = str_replace( array( ‘https://’, ‘https://’ ), ‘//’, get_home_url( null, ‘/’, ‘http’ ) );
    by
    $wp_base = strpos($url, ‘fifu’) !== false ? $url : str_replace( array( ‘https://’, ‘https://’ ), ‘//’, $url );

    3) Save the file.

    PS.: WooCommerce updates can overwrite this change.

    Solution 2:

    Allow your images be accessed with “http” also.

    And that’s all. If it solves your issue, please consider to give the plugin a 5-star rating =)

    Thread Starter awideman

    (@awideman)

    Solution 1 worked perfectly. Thanks Marcel!

    Hi,
    I am having exactly the same problem.
    I tired to to do solution 1 since I could not figure out how to do 2nd but I get this error;
    Parse error: syntax error, unexpected ‘:’, expecting ‘)’ in /home/projeksi/public_html/lambapro/wp-content/plugins/woocommerce/includes/wc-core-functions.php on line 1911

    And below is the code on wp-core-functions.php after edit;
    function wc_is_external_resource( $url ) {

    $wp_base = strpos($url, ‘fifu’) !== false ? $url : str_replace( array( ‘https://’, ‘https://’ ), ‘//’, $url );
    }

    I just copy and paste. Not sure what is the problem.
    Any help will be appreciated.

    Plugin Author Marcel

    (@marceljm)

    Hi, @bkntl.

    What’s your WordPress, WooCommerce and FIFU version?

    Hi Marcel,

    Wordpress 4.9.1-tr_TR
    Woocommerce 3.2.6
    FIFU 1.7.2

    Hi @awideman,

    I get an php error for the same code that worked for you. Could you please let me know if you made any changes to make it work?
    Thanks,

    Thread Starter awideman

    (@awideman)

    Hey bkntl,

    I couldn't just copy and paste since the ’ character isn't the same as the ' character. Try replacing all the single quotes with '

    If that doesn’t work, here is the exact php I have – you could type it out:

    View post on imgur.com

    Let me know if it works!

    • This reply was modified 6 years, 10 months ago by awideman.
    • This reply was modified 6 years, 10 months ago by awideman.
    Plugin Author Marcel

    (@marceljm)

    Hi, @bknt.

    Your error shows something is wrong with the code you copied and pasted.

    Please try what @awideman suggestion.

    Hi @awideman,

    Thanks for the input. That resolved the code error.

    But unfortunately the solution is not working for me. http sources are still rewritten as https or made relative //.

    I am going hopeless on the issue. I loved the plugin. It works great on non-SSL site but I guess wont be good for me unless it adds a solid SSL support.

    Thanks again.
    Best,

    Plugin Author Marcel

    (@marceljm)

    Hey, @bkntl.

    Do you have a link to your problem? I want to take a look on that to know why that didn’t work for you.

    Wideman is using the Premium version.

    Hi @marcelljm

    You can have a look at from https://www.lambapro.com/urun/epson-eb-1750-original-lamba/

    I am using free version, but I dont know that makes a difference since you did not mention any configuration change at the back end of plugin.
    Thanks,

    Plugin Author Marcel

    (@marceljm)

    Hi, @bkntl.

    I got this error on your site:

    GET https://www.justlamps.net/getlampimage.php?id=1487&account=POLAR net::ERR_CONNECTION_REFUSED

    Because your image is http only. So that’s not the same case of Wideman.

    If your are using https for that image, adjust for http.
    But if you already are using http, try to find what is forcing https usage. Another plugin?

    Here, I have tested
    https://www.justlamps.net/getlampimage.php?id=1476&account=POLAR
    with free FIFU version, without any change in WooCommerce files,
    and that works fine.

    Hi @marceljm,

    Images are on http and Fifu was working fine on my side as well before switching to SSL.
    Now something is rewriting the http to https. I thought it is woocommerce and your fix could fix it.
    Anyway I will check other plugins for error.
    Thanks for your time.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Link to Image is https:// on Product Page but //externalsite.com in Category’ is closed to new replies.