我正在开发 opencart版本 1.5.1.3。在一个阶段,我想在管理端控制器文件中使用前端模型功能。
谁能帮帮我吗。?将不胜感激。
有谁知道如何让我的 Notepad++ 读取 Opencart 的 tpl 文件。我已经进入设置/样式配置并将 .tpl 扩展名添加到 html 和 PHP,它们都不起作用。
有什么建议
我对 opencart 完全陌生,并且没有技术经验。我已经在我知道的任何地方寻找答案。我已经在我的本地机器上安装了 Opencart2 并且想要使用 Exstension 安装程序。系统使用FTP,所以我使用Filezilla Server创建了一个本地FTP。没问题。然后我使用 FTP 凭据设置 Opencart 系统 FTP 设置。FTP 根设置为 localhost/mydomain 在运行扩展安装程序时,我收到以下错误:“语法错误:JSON.parse:JSON 数据的第 1 行第 1 列出现意外字符 OK <警告:ftp_chdir():CWD 失败。” /:/localhost/mydomain": 目录未找到。在C:\xampp\htdocs\mydomain\admin\controller\extension\installer.php第228行{"error":"
我尝试了 FTP 根文件夹的各种组合,即 Localhost, ,但似乎没有任何东西可以摆脱错误。如果有人能指导我,我将不胜感激。
谢谢
我正在对订单总数进行OpenCart修改.这是代码的片段:
<?php
foreach ($data['totals'] as $total) {
if (
$this->db->escape($total['code'])=="sub_total" ||
$this->db->escape($total['title'])="Sub-Total"
) {
$this->db->query("INSERT INTO " . DB_PREFIX . "order_total SET order_id = '" . (int)$order_id . "', code = '" . $this->db->escape($total['code']) . "', title = '" . $this->db->escape($total['title']) . "', text = '" . $this->db->escape($total['text']) . "', `value` = '" . (float)$data['total'] . "', sort_order = '" . (int)$total['sort_order'] . "'");
} else {
$this->db->query("INSERT INTO " . DB_PREFIX . "order_total SET order_id = '" . (int)$order_id …
Run Code Online (Sandbox Code Playgroud) if($this->request->get['product_id'] == (53 || 52 || 43)){
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product2.tpl')) {
$this->template = $this->config->get('config_template') . '/template/product/product2.tpl';
} else {
$this->template = 'default/template/product/product2.tpl';
}
} else{
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
$this->template = $this->config->get('config_template') . '/template/product/product.tpl';
} else {
$this->template = 'default/template/product/product.tpl';
}
}
Run Code Online (Sandbox Code Playgroud)
我想实现它,如果产品ID是53
或50
或43
然后......同样的事情..但我不确定它是这样的正确
如何在OpenCart上禁用或删除添加到购物车和结帐功能?
我有一个网站,它就像一个商店目录.我的意思是,它不是一个在线商店,所以我不需要这些功能,并希望禁用它,所以人们可以看到价格,但他们无法在线购买.
使用vqmod我在header.tpl中注入此代码.
<?php if ($this->customer->isLogged()){ if($this->customer->getCustomerGroupId()!=1) { ?>
//show something
<?php } ?>
Run Code Online (Sandbox Code Playgroud)
它在opencart 1.5.6.1中运行良好但是现在我更新到2.0.3.1并且我收到此错误:
Notice: Undefined property: Loader::$customer in C:\UniServerZ\www\opencart-2.0.3.1\upload\vqmod\vqcache\vq2-catalog_view_theme_default_template_common_header.tpl
Run Code Online (Sandbox Code Playgroud)
有没有办法从2.0.3.1中的.tpl文件中引用$ this?
当客户注册新帐户时,我们必须向他们发送确认电子邮件,我的问题是我需要发送每个客户确认电子邮件并附上他们刚刚创建的登录电子邮件地址和密码...所以我怎样才能获得他们的密码从我的customer
桌子到现场password
.. ?? 我只想password
回复这个我想要的客户验证电子邮件页面....
<?php echo $password; ?>
Run Code Online (Sandbox Code Playgroud)
任何的想法.?谢谢...
这听起来很愚蠢,但我不是100%肯定.
我有这个代码:
$query = $this->db->query("MY QUERY");
Run Code Online (Sandbox Code Playgroud)
查询将导致一行,我基本上想从该行获取名为"id"的列,因此我可以回显类似$ query-> db-> row-> id的内容.
我该怎么做呢?