Magento Checkout - 不安全的图像

时间:2010-08-11 12:23:24

标签: magento

我的Magento结帐出现问题,浏览器报告该页面未完全加密。我看了一眼,发现其中一张图片使用的是http://

这是我用来显示图片的代码:

getSkinUrl('images / search_button.png')?>

作为临时解决方案,我已经硬编码了图像的完整路径,即: https://mysite.com/skin/frontend/default/mytheme/images/search_button.png

是否有人可以动态调用图像,但是在结帐和其他安全页面上使用https?

2 个答案:

答案 0 :(得分:4)

这应该通过使用'_secure'参数来解决。

$this->getSkinUrl('images/search_button.png', array('_secure' => true));

答案 1 :(得分:1)

您是否已将管理员配置设置设为“使用安全”(我记不清确切的措辞)?如果是这样,您是否将安全URL设置为HTTPS?

Magento通过您指定的安全/不安全URL生成图像和链接URL。如果您没有正确指定为https://,则会出现此问题。否则,Magento实际上非常善于输出安全内容。


我没有针对皮肤网址对此进行测试,但对于常规网址,您可以执行以下操作来强制使用安全网址。这是来自URL代码的深层内容:

// 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));

可能有一些方法可以在getSkinUrl ...

中指定那些额外的参数
相关问题