Question

I'm just wondering why this plugin seems to be requesting a resource through http on a site that is fully https forced.

enter image description here

I am fully baffled on how this is happening seeing that there is no reference to http within the plugins code as far as I can see.

Essentially, my question is if there is a way to redirect this request to https somehow through magento as the XMLHTTPRquest seems to try request an unsecure piece of content.

Was it helpful?

Solution

The reason you didn't found http reference in plugin code is because they might be set AJAX request URL using Mage::getBase() or anything relevant to that.

However, you can quick fix this using prototype onCreate event handler. Put below code in your theme footer.phtml file:

<script type="text/javascript">
    Ajax.Responders.register({
            onCreate: function(request) {
                if (location.protocol === 'https:') {
                    request.url = request.url.replace("http:", "https:");
                }
            }
        });
</script>

What it does? This will bind event and triggered when prototype AJAX object has been created. It will verify your site URL, if it is https: then replace your AJAX URL with https:.

Please not that this is quick fix for your issue and applied to all of your AJAX request which is initialize through prototype.

Let me know if you have any query regarding this solution.

OTHER TIPS

This come to form of Order Grid.
Essentialy check Magento -> Settings -> Web -> Secure. Check web Secure use in frontend to ENABLE. It's force all form to use https protocol. It's needed to enable, even if you force url in other places.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top