Jump to content

[Solved] Product images disappear after changing image positions


Shwetab55

Recommended Posts

  • 7 months later...

Same problem in 1.7.6.8. I have noticed that images disappear just after change photo order/position ajax call in:

/admin/index.php/sell/catalog/products/image/positions

I don't need even press save button

Any ideas?

Link to comment
Share on other sites

  • 1 month later...

In Prestashop 1.7.7.5 I have the same issue : images are disappearing after reordering them.

Context:
Site migrated from Prestashop v1.6 to Prestashop v1.7.7.5 using Prestashop Migrator (v2.1.6) module.

Analysis:
It seems that the "product_id" in the table "ps_image_shop" is set to zero, leading to issues.
With the following SQL query, you can get some examples rows to see if it's your case.

SELECT psi.id_image, psi.id_product, psi.position, psis.id_product, psis.id_shop
FROM ps_image psi
INNER JOIN ps_image_shop psis ON psis.id_image = psi.id_image
WHERE psis.id_product <> psi.id_product
LIMIT 100

To restore the mapping of the "ps_image_shop" if your mapping is still correct in the "ps_image" table it's pretty simple.
BEWARE: please do not launch this command without having done a database backup first !

UPDATE ps_image_shop psis 
SET psis.id_product = (SELECT psi.id_product FROM ps_image psi WHERE psi.id_image = psis.id_image)

Hope it helps.
It seems to have resolved my problem!

Edited by Quentin Fahrner (see edit history)
  • Like 2
Link to comment
Share on other sites

  • Shwetab55 changed the title to [Solved] Product images disappear after changing image positions

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...