OpenCart 2.x. 如何管理维护界面
May 18, 2017
这是一个很好的做法,设置你的商店 maintenance mode 在进行升级或日常维护时. During this time, 您的网站的访问者将收到一条消息,说明它正在进行临时维护. 许多店主希望定制他们的消息,使其更具体到他们的任务, 这样他们的客户就能更好地了解情况. 但是,要做到这一点,您必须编辑一个内部文件. 加入我们,我们将指导您修改OpenCart 2的维护消息.x store.
前面,我们将存储设置为 maintenance mode 遵循本教程 OpenCart. 如何将网站置于维护模式.
-
首先,登录 cPanel dashboard.
-
这是通往主楼的路 cPanel area. 找到并打开 File Manager.
-
Inside the File Manager,导航到您的商店 root folder. 大多数商店使用main domain, so the root folder would be public_html. 如果您正在使用子文件夹(e.g. example.com . shop),而不是public_html/shop.
-
Click on the catalog folder, then the language folder. At this point, 下一个文件夹可以是不同的, 这取决于您在网站上使用的语言. 我们将采用默认文件夹并使用英文文件夹. Open english 文件夹,最后是 common folder.
-
Inside the common 文件夹中,您将看到三个文件. 找到那个 maintenance.php 然后打开它进行编辑.
-
Inside the editor,您将看到一些变量及其设置. 控制维护消息的代码行如下:
$_['text_message'] = '
We are currently performing some scheduled maintenance.
';
我们会尽快回来的. 请尽快回复. -
将代码中的文本更改为自定义消息. 看看下面的例子,看看我们是如何更改消息的.
$_['text_message'] = '
We are editing the theme and adding more great products..
';
我们会尽快回来的. 请尽快回复. -
新消息就位后,单击 Save Changes 点击屏幕右上角的按钮来激活它. 当你的商店在 maintenance mode,您的访问者现在将看到新消息. Refresh the website 要查看变化.
Please, note, 如果您以管理员身份登录到您的OpenCart 2商店,您将能够访问该商店 frontend. 要查看维护消息,请登出并刷新您的商店主页.
对于进一步的修改,如添加图像,样式和额外的文本到maintenance mode’ page, edit the 目录/视图/主题/ themeXXX /模板/共同/维护.tpl file.
您将注意到模板文件包含 $header and $footer variables. 它们用于显示您的OpenCart header and footer.
另一个变量是 $message,我们已经在语言文件中更改了:
添加所需的内容 html markup.
你需要更多的模板吗? 看看我们收藏的顶级产品吧 OpenCart themes.
请随时查看下面的详细视频教程:
OpenCart 2.x. 如何管理维护界面