I have just upgraded my site from Frozen to the latest Phoenix 1.0.7.10. All seems to have gone well but I am having a problem with the product images. In frozen I had two product images a small one and a large one. That all worked great, but in Phoenix I can see that there is only a requirement for one image and that is unfortunately the small image that was saved into the products table products_image column in the database.
Am I right in this and is there a way to replace the small images with the large images that were saved in the product_images image column. Failing that is there a way of removing the word -small from the name of the images in the products table - products_image column as the large and small images were basically called the same i.e. imagename.jpg or imagename_small.jpg
I may have also missed something in the upgrage path somewhere also that may have sorted this.
Problem with product image after upgrading from Frozen
-
- Lead Developer
- Posts: 2423
- Joined: Tue Oct 29, 2019 9:37 am
- : Buy Me A Beverage
- Has thanked: 48 times
- Been thanked: 137 times
Re: Problem with product image after upgrading from Frozen
If I have understanding of the issue;
You want to replace what is stored in products.products_image with what is stored in products_images in the relevant product ID row.
Not tested, but it would be something like this:
UPDATE products p
INNER JOIN products_images pi ON p.products_id = pi.products_id
SET p.products_image = pi.image
HIGHLY suggest to make a backup first in case that is incorrect.
You want to replace what is stored in products.products_image with what is stored in products_images in the relevant product ID row.
Not tested, but it would be something like this:
UPDATE products p
INNER JOIN products_images pi ON p.products_id = pi.products_id
SET p.products_image = pi.image
HIGHLY suggest to make a backup first in case that is incorrect.
Gamechanger Addon: Queued Emails, try before you buy.
-
- Lead Developer
- Posts: 2423
- Joined: Tue Oct 29, 2019 9:37 am
- : Buy Me A Beverage
- Has thanked: 48 times
- Been thanked: 137 times
Re: Problem with product image after upgrading from Frozen
> Failing that is there a way of removing the word -small from the name of the images in the products table
UPDATE products SET products_image = REPLACE('products_image', 'small', '');
Which might be safer. But untested again, so highly suggest to back up first.
UPDATE products SET products_image = REPLACE('products_image', 'small', '');
Which might be safer. But untested again, so highly suggest to back up first.
Gamechanger Addon: Queued Emails, try before you buy.
-
- VIP Member
- Posts: 549
- Joined: Fri Oct 25, 2019 7:01 pm
- Has thanked: 8 times
- Been thanked: 49 times
Re: Problem with product image after upgrading from Frozen
Thanks Gary.
This worked and added a main image to each product which is good for now. There are some products that need a second image but I will find them later.