distributor icon indicating copy to clipboard operation
distributor copied to clipboard

Woocommerce images wrong transfer

Open cdesp opened this issue 1 year ago • 1 comments

Describe your question

When a product is being pulled the images, not the featured one but all the others, are not displayed correctly meaning it displays the wrong images, images from other product. I traced the problem looking in the database and i see that the _product_image_gallery field on metadata table has the same values (but not all of them) as the original, but the corresponding images are different on the new site so it displays the wrong image.

Example on the original site _product_image_gallery = 22474,22475,22477,22491,22492,22490,22505,22478,22481,22482

22482 | _wp_attached_file | 2024/02/Sento_21_2d3s_R_L.jpg

on the new/other site _product_image_gallery = 22474,22492,22482

22482 | _wp_attached_file | 2024/01/38107ENJ30W1.jpg

as you can see totally different image. I think the _product_image_gallery should get "translated" to the new ids on the new site.

The featured image has a different id and it works ok.

The woocommerce was updated to the latest version a few days ago maybe it has something to do with that.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

cdesp avatar Mar 03 '24 00:03 cdesp

I suspect this happened due to a timeout when trying to send all those images over in a single request and the conversion didn't happen. We have a project that has a lot of grouped products with many hi-res images. In those scenarios it almost alway never completed the transfer and subsequently didn't update the IDs. To work around this. We only transfer the featured image and then use Action Scheduler to transfer all attachments as requests behind the scenes. It's slower to sync (not realtime) but very reliable. We've been doing this for a while so I don't necessarily think it due to the latest version of Woo, but there may be a change in woo I'm unaware of

aaronware avatar Mar 03 '24 13:03 aaronware