Prestashop加载登录和注册到fancybox iframe弹出窗口的正确方式


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

我想在没有页眉和页脚的fancybox iframe上加载身份验证.tpl

我知道添加到url content_only=1适用于某些页面

(例如CMS页面)

我试过了:

-blockuserinfo模块导航.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无功输出与预期一致

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

B-我还尝试在AuthController.php中设置

$this->content_only = true;

但在我的帐户页面中,智能变量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.

上所做的那样