Back to Catalog Support

igorblumberg
igorblumberg

Hello, I'm trying to show a product but I'm getting the following error: Trying to get property of non-object /home/vagrant/Code/dimona-october/public/plugins/tiipiik/catalog/components/ProductDetails.php line 50 http://snag.gy/wQDeJ.jpg

I've dug into the source code and fixed it:

$this->product = $this->page['product'] = $loadProduct;
//here $this->product is NULL

if I change the source code from:

        $this->product = $this->page['product'] = $loadProduct;
        $this->page->title = $this->product->title;
        $this->page->description = $this->product->description;

to:

        $this->product = $this->page['product'] = $loadProduct;
        $this->page->title = $loadProduct->title;
        $this->page->description = $loadProduct->description;

Everything works, but since I'm new to October I'm afraid this might break future updates.

Any idea why this is happening?

thanks

igorblumberg
igorblumberg

By the way, anothe fix is to add

    protected $product;

To the class

I'm using homestead (PHP 5.6)

Tiipiik
Tiipiik

Hi,

It seems there has been some changes in October, I check that right now and publich an updated version as soon as possible.

Thanks for pointing me onto that and find solutions.

Tiipiik
Tiipiik

Last update (1.6.3) should resolve all these problems.

If you can't see update to 1.6.3 you shouldn't have enabled the edeges updates, please enable them.

Finally, please tell me if this solve your problems or not.

igorblumberg
igorblumberg

Hello, I've enabled edge updates and everything works, thanks for the credits :D. By the way, is there a reason why the filter for product is commented on the file? plugins/tiipiik/catalog/controllers/products/config_list.yaml This filter would be really usefull for me. I've uncommented the line, but my change will be overriden when you update the plugin. (is there any way to override a plugin file?)

Tiipiik
Tiipiik

Hi,

I've enabled the firlters on products and custom fields. I think I remove it for some old testing.

You can probably override the scopeFilterCategories method by creating antoher plugin that will extends this one, but you wouldn't be able to add a config_filter.yaml for this (at least I think).

1-6 of 6