Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我尝试在 OPENCART product.tpl 文件中回显 php 变量并且它没有出现在网站上,我错过了在哪里添加一行代码?
注意:数据库中有一个字段。我可以从管理面板保存到这个字段(我在那里添加了一个自定义字段)。
您是否还编辑了产品控制器以加载变量并将其传递给模板?我猜不是...在调用之前编辑catalog/controller/product/product.php和添加$this->data['MYVARIABLE'] = $product_info['MYVARIABLE'];某处。$this->render()
catalog/controller/product/product.php
$this->data['MYVARIABLE'] = $product_info['MYVARIABLE'];
$this->render()