user2935044
user2935044

Reputation: 11

Fatal error: Call to a member function in product.php

I am new to opencart, so please help me.
I am using opencart version 1.5.6, now whenever I edit and delete the product it shows me

Fatal error: Call to a member function productUpdateListen() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 78 and Fatal error: Call to a member function deleteProduct() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 133 respectively.

Although it edit and delete the product. Please help me how to fix it.

Code in Line 78 $this->openbay->productUpdateListen($this->request->get['product_id'], $this->request->post);

And code in line 133 $this->openbay->deleteProduct($product_id);

Upvotes: 1

Views: 4195

Answers (2)

Techie
Techie

Reputation: 45124

This means $this->openbay is not an object which contains function productUpdateListen() & deleteProduct(), probably it's NULL or false in some cases (nothing found) due to it's not accessible. Out of scope.

Try

var_dump($this->openbay);

Check the O/P

Upvotes: 1

oezi
oezi

Reputation: 51797

it's simple and the error-message says it all: your $this->openbay doesn't have those methods (productUpdateListen() and deleteProduct()) - most likely it isn't an object at all.

please debug your code since it's impossible to say what's going wrong wich so little information. to start, do a var_dump($this->openbay); right before the function-calls and check the output.

Upvotes: 0

Related Questions