看到购物车页面时,Opencart强制登录? [英] Opencart Force login when see Cart Page?

查看:83
本文介绍了看到购物车页面时,Opencart强制登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有许多页面需要客户登录才能查看.对于购物车页面/index.php?route=checkout/cart

There are a number of pages that require a customer to log in to view them. How would I do this for the cart page /index.php?route=checkout/cart

推荐答案

我认为您的意思是,如果他们正确地进入购物车页面,则希望获得客户登录?如果是这样,这是您的操作方法.打开/catalog/controller/checkout/cart.php并找到此行

I think you mean you want to have a customer login if they go to the cart page correct? If so, here's how you do it. Open /catalog/controller/checkout/cart.php and find this line

public function index() {

在此行下面,添加以下代码

Below this line, add the following code

    if (!$this->customer->isLogged()) {
        $this->session->data['redirect'] = $this->url->link('checkout/cart', '', 'SSL');

        $this->redirect($this->url->link('account/login', '', 'SSL')); 
    }

这篇关于看到购物车页面时,Opencart强制登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆