Opencart使用添加产品功能

时间:2019-12-20 13:09:18

标签: php opencart

使用AddProduct()函数,我想添加来自不同数据库的产品。但是我无法运行它。

我的代码:(./admin/controller/extension/produ/addpro.php)

<?php
class ControllerCatalogProduct extends Controller {
    public function index() {
        $products = array(
            'model' => 'test',
            'name'=>'test',
            'description'=>'test',
            'tag'=>'test'
        );
        $this->load->model('catalog/product');
        $this->model_catalog_product->addProduct($products);
    }
}
?>

然后我访问此链接domain.com/admin/index.php?route=extension/produ/addpro&user_token=xxx

但是返回此500错误;

Fatal error: Uncaught Error: Class 'Controllerextensionproduaddpro' not found in /home/domain/public_html/opencart/storage/modification/system/engine/action.php on line 71
( ! ) Error: Class 'Controllerextensionproduaddpro' not found in /home/domain/public_html/opencart/storage/modification/system/engine/action.php on line 71

0 个答案:

没有答案