我想覆盖 PrestaShop 中的 Controller
<?php
class ProductController extends ProductControllerCore{
public function initContent()
{
parent::initContent();
}
public function init()
{
parent::init();
echo "datbase";
die;
}
}
?>
包含我的覆盖的文件位于:
项目名称/override/controllers/front/ProductController.php
但是我的覆盖不起作用。
最佳答案
更新了 PrestaShop 1.7.x 的答案
在 PrestaShop 1.7.x 版本中,class_index.php 文件现在位于 /var/cache/prod
中:
如果您刚刚添加了新的覆盖,请不要忘记删除此文件,否则它将无法工作。
希望这会有所帮助!
关于php - PrestaShop - 覆盖 Controller 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31855867/