Woocommerce API creates duplicate images
-
Hello,
I’m using wordpress 5.2.2 with Woocommerce 3.7.0We’re using the standard Woocommerce API to fill up our webshop with products from our ERP software. But we are having some issues with the images.
When sending products to the shop we upload the images to a folder on the server /public_html/images then the API takes them and put them into /public_html/wp-content/uploads/2019/08
The image name is the articlenumber, for example we send product ABCD to the webshop. It will be placed in the images folder as ABCD.jpg and then in the wordpress folder where the API will create the necessary formats, so in the wordpress folder we’ll have:
ABCD.jpg
ABCD.jpg-100×100.jpg
ABCD.jpg-150×150.jpg
ABCD.jpg-300×300.jpg
ABCD.jpg-214×300.jpg
ABCD.jpg-450×630.jpgThe problem is the next time we send that product to the shop (if something was changed with the product) the API will put the images in the wordpress folder again instead of recognizing it’s already there. So it will add:
ABCD-1.jpg
ABCD.jpg-1-100×100.jpg
ABCD.jpg-1-150×150.jpg
ABCD.jpg-1-300×300.jpg
ABCD.jpg-1-214×300.jpg
ABCD.jpg-1-450×630.jpgSo now for 1 article I already have 14 images. Next time the product get’s exported again it will add it with ABCD-2.jpg etc…
And before we know it the whole disk is full because of all these images. Is there anyone else with this problem that found a solution?
- The topic ‘Woocommerce API creates duplicate images’ is closed to new replies.