Page 1 of 1
Error adding new Product
Posted: Sat Oct 14, 2017 10:07 pm
by andrey1112
Hello. I have Opencart CMS 2.3.0.2.3.
I have a problem, an error occurs when trying to add a new item through the admin panel
Notice: Undefined property: Proxy::addProduct in /home/lcarouse/sitename.com/www/system/storage/modification/admin/controller/catalog/product.php on line 28
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
$this->model_catalog_product->addProduct($this->request->post); <= this is line 28
Help me please.
Re: Error adding new Product
Posted: Mon Oct 16, 2017 12:04 am
by bumcarks
Please check the code is available before addProduct method call, if not then add the below code before addProduct method call.
$this->load->model('catalog/product')
Re: Error adding new Product
Posted: Mon Oct 16, 2017 12:38 am
by andrey1112
bumcarks wrote: ↑Mon Oct 16, 2017 12:04 am
Please check the code is available before addProduct method call, if not then add the below code before addProduct method call.
$this->load->model('catalog/product')
thank you for a reply.
i had this code before. and i have the same problem when i try to Copy "Product"
Fatal error: Call to undefined method ModelCatalogProduct::addProduct() in system/storage/modification/admin/model/catalog/product.php on line 451
public function copyProduct($product_id) {
$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "product p WHERE p.product_id = '" . (int)$product_id . "'");
if ($query->num_rows) {
$data = $query->row;
$data['sku'] = '';
$data['upc'] = '';
$data['viewed'] = '0';
$data['keyword'] = '';
$data['status'] = '0';
$data['noindex'] = '0';
$data['product_attribute'] = $this->getProductAttributes($product_id);
$data['product_description'] = $this->getProductDescriptions($product_id);
...
...
...
$this->addProduct($data); 451 line
}
}
Re: Error adding new Product
Posted: Mon Oct 16, 2017 1:28 am
by bumcarks
this function "public function addProduct($data) " is missing in the file system/storage/modification/admin/model/catalog/product.php. Please check it. You have ocmod or vqmod problem. vqmod or ocmod delete the function or comment the function. By default opencart have function addProduct($data) in admin/model/catalog/product.php