tags:

views:

28

answers:

1

I was having a problem with my Magento checkout whereby the browser was reporting that the page wasn't fully encrypted. I had a look and realised that one of the images was using http://

This is the code I was using to display the image: getSkinUrl('images/search_button.png') ?>

As a temporary solution I have hard coded the full path to the image ie: https://mysite.com/skin/frontend/default/mytheme/images/search_button.png

Does anyone how I can call the image dynamically but have it use https on the checkout and other secure pages?

+1  A: 

Have you set your admin config settings to "use secure" (I can't remember the exact wording) for the frontend? If so, have you set your secure URLs to be HTTPS?

Magento generates image and link URLs via those secure/unsecure URLs you specify. If you haven't properly specified those as https://, you will have this problem. Otherwise, Magento is actually very good about outputting only secure content.


I haven't tested this for skin URLs, but for regular URLs you can do the following to force secure URLs. This is from the deep bowels of the URL code:

// Get the URL for another action on our current controller
// and force it to https
$path = "*/*/submit";
$url = Mage::getUrl($path, array('_forced_secure' => true));

There's probably some way to specify those extra arguments in getSkinUrl...

Joseph Mastey
yes, I have specified the correct settings in the config. Everything else on the page is coming across with https. It is just this one image which I had problems with.
a1anm
See above for more suggestions.
Joseph Mastey