Prestashop 在 fancybox iframe 弹出窗口上加载登录和注册的正确方法

Prestashop proper way to load login and signup on fancybox iframe pop-up

我想在没有页眉和页脚的 fancybox iframe 上加载 authentication.tpl

我知道附加到 url content_only=1 在某些页面上有效

(例如在 CMS 页面上)

我试过了:

A - blockuserinfo模块nav.tpl模板文件

        <a class="login" href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Log in to your customer account' mod='blockuserinfo'}">
        {l s='Sign in' mod='blockuserinfo'}
        </a>

然后在 global.js 我有函数调用 fancybox

// Login Box
$(document).on('click', '.login', function(e){
    e.preventDefault();
    var url = this.href;
    if (!!$.prototype.fancybox)
        $.fancybox({
            'padding':  0,
            'width':    1087,
            'height':   610,
            'type':     'iframe',
            'href':     url + 'content_only=1'
        });
});

控制台中的 url var 输出符合预期

http://localhost/myprestshop/my-account?content_only=1

B - 我也尝试在 AuthController.php

中设置
$this->content_only = true;

但在 我的账户 页面中,smarty 变量 content_only 仍然设置为 0

在 prestashop 上完成该任务的正确方法是什么?

在没有页眉和页脚的 fancybox iframe 中显示登录弹出窗口

只需调用 authentication 而不是 my-account

    <a class="login" href="{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Log in to your customer account' mod='blockuserinfo'}">
        {l s='Sign in' mod='blockuserinfo'}
    </a>

然后使用 javascript 函数将点击处理程序附加到它,就像我在 OP 上所做的那样。