我已经得到了条款和条件链接,并添加了Fancybox,但是当你点击链接时,它会显示整个网页,而不仅仅是花哨的盒子容器中的内容。
链接的格式为site/online-store/au/content/3-terms-and-conditions-of-use?content_only=1
然而,content_only=1似乎没有做任何事情?
发布于 2013-09-18 18:38:13
问题是此链接正在从https页面加载非https内容。
要修复它,请编辑控制器/front/ParentOrderController.php
$this->link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite, false);并将最后一个参数更改为true以强制使用https
$this->link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite, true);发布于 2016-09-01 15:10:46
这个问题是因为您加载的CMS没有必需的参数。因此,中的条件
/controllers/front/CmsController.php
if (Configuration::get('PS_SSL_ENABLED') && Tools::getValue('content_only') && $id_cms && Validate::isLoadedObject($this->cms) && in_array($id_cms, array((int)Configuration::get('PS_CONDITIONS_CMS_ID'), (int)Configuration::get('LEGAL_CMS_ID_REVOCATION'))))
{
$this->ssl = true;
}返回false。只需将其替换为
$this->ssl = true;多田..。
发布于 2019-06-04 09:32:50
这将适用于PrestaShop 1.6.x/1.7.x,并将在Fancybox中打开ToS
在您的控制器中:
$cms = new CMS(Configuration::get('PS_CONDITIONS_CMS_ID'), $this->context->language->id);
$conditions_link = $this->context->link->getCMSLink($cms, $cms->link_rewrite).'?content_only=1';
$this->addJqueryPlugin(array('fancybox'));
$this->context->smarty->assign(['conditions_link' => $conditions_link]);然后,在您的.tpl文件中:
<a class="fancybox-tos" href="{$conditions_link}">{l s='Terms of service' d='Shop.Theme.Checkout'}</a>最后,在.js文件中:
$(document).ready(function() {
$('.fancybox-tos').fancybox({
type: 'iframe',
autoDimensions: false,
autoSize: false,
width: 600,
height: 'auto',
helpers: {
overlay: {
locked: false
}
}
});
});我希望这能帮到你!
https://stackoverflow.com/questions/13888321
复制相似问题