Page 1 of 1

Change product picture folders to default folders after upgrades

Posted: Wed Apr 15, 2020 9:07 pm
by mophielle
Hello, I updated OC for years up to OC 3.0.3.2 but transferred products via databases or as well a transfer module. Never had problems but now, after installing a new theme with another Product page which has a special view on product pictures i get an error undefined variable: result in /catalog/controller/product/product.php on line 290 at the products which are not in the "default" image folder.
I´m using image/data (OC 1.5), image/catalog (think this is OC 2) and image/image (which works so i think OC3). The problem is just at the product page, not at categories eg. you still can see the pictures working on main page, but causing this problems if they are in the folders image/data or image/catalog. So can somebody tell me whether how to bulk transfer the image folders without uploading a few hundret pictures one by one for each product by database or however to the default OC3 image folder?

Or does anybody have a clue why i got this problem?

On line 290 it says

Code: Select all

$images = $this->model_catalog_product->getProductImages($result['product_id']); 
So i don't understand why there is an error, because actually the products have pictures connected to their id.

Thank you for your support!

Re: Change product picture folders to default folders after upgrades

Posted: Wed Apr 15, 2020 9:26 pm
by straightlight
This topic has now been moved to the OpenCart 3.0 Support > General Support section of the forum.

Re: Change product picture folders to default folders after upgrades

Posted: Wed Apr 15, 2020 10:38 pm
by letxobnav
first of all, that is not default OC, default, the product images are fetched with:

Code: Select all

$results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
on line 269
second, if you get an undefined variable result on your line 290:

Code: Select all

$images = $this->model_catalog_product->getProductImages($result['product_id']);
then that means that $result['product_id'] is undefined, resulting in a warning (not error) and no retrieved results from that function of course.
So better focus on why $result['product_id'] is undefined.

Re: Change product picture folders to default folders after upgrades

Posted: Thu Apr 16, 2020 3:56 pm
by paulfeakins
mophielle wrote:
Wed Apr 15, 2020 9:07 pm
can somebody tell me whether how to bulk transfer the image folders without uploading a few hundret pictures one by one for each product by database or however to the default OC3 image folder?
You may find this article interesting:
https://www.antropy.co.uk/blog/using-wi ... -opencart/