大家好。我在Prestashop 1.6中自定义了一个主题,在某个时刻,在页面的页脚,创建了一些链接:
href="{$link->getCategoryLink($smarty.get.id_category, null, $lang.id_lang,null,null )}"
整个站点在SSL下运行,但是链接被返回为"http://....“。
有没有办法强制Prestashop只创建https链接?否则,smarty是否能够在该字符串中进行“搜索和替换”?我的意思是,如果我不能让它以适当的方式创建,我可以在创建后更改链接...
有什么想法吗?
发布于 2016-02-23 06:44:49
检查Link
类的getCategoryLink
方法,其中调用的protected function getBaseLink($id_shop = null, $ssl = null)
没有第二个参数。
在getBaseLink
中,您应该会看到:
if ($ssl === null)
{
if ($force_ssl === null)
$force_ssl = (Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE'));
$ssl = $force_ssl;
}
因此,要获取ssl链接,您需要在后台为整个商店启用SSL (有一个选项),默认情况下仅为购物车/订单流程启用SSL。或者手动构建url,或者覆盖getBaseLink方法并设置$ssl = true
https://stackoverflow.com/questions/35557855
复制相似问题