samsup
Forum Replies Created
-
Thank you, the reset fixed it.
I was puzzled because I did have the password reset for the account done, even requested a new password by the ” lost password” function, so didnt figure that it would still be hung up on the initial forced password reset!
Forum: Plugins
In reply to: [WooCommerce] REST API not updating image linkHello,
Yes thank you all for the information and help. The result is different than expected at first, but essentially it all works. It would be good to explain the mechanics of images a bit more deeply in the API documentation maybe, as I would imagine more people are strugling to grasp how the library does its magic.
But long story short, picture update via API works, however the JSON response is not going to be the image link ( which is what I expected) but it is rather going to be the newly created imagelink in the medialibrary.
The only thing that I could not get to work is to update an image ( overwrite in the library) using the imageID, so I am stuck at just creating new images, but perhaps that is not thet intended fuction of the API ( hence it would be good to more deeply explain the documentation here).
As for creating endless duplicates, it is not optimal, but easily manageable with a plugin that sanitizes unused images.
so on my end, I was able to do everything I needed to do!
Forum: Plugins
In reply to: [WooCommerce] REST API not updating image linkMirko, your suggestion works, partially. I can in fact confirm that I can now modify images when not using the imageID.
This however creates the problem that the media library keeps generating new images every time I do an API call ( so by now I have for product 0260101, I have 0260101.jpg, 0260101-2.jpg, 0260101-3.jpg, 0260101-4.jpg, which are all 4 copies of the same image ( for the 4 PUT requests I did) When I change the image to for example 0260101test.jpg, it creates that image, and when I PUT it agian, it creates another 0260101test-1.jpg for example.
This would ofcourse overflow my server after a few iterations of doing this.From what I read in other topics regarding images and API, the solution to that would be to include the imageID.. but when I include imageID, I am not able to update/change the image at all, wether it has same filename, or new filename to an existing image in the library.
I tried using DELETE call with the image but that just trashes the whole product.. so thats a no go..
so essentially whats left is to find a way to remove the entire picture library every time I want to mass update images? There must be a more “correct” way to remove unused images right?
Forum: Plugins
In reply to: [WooCommerce] REST API not updating image linkHi Mirko,
I am doing the exact same thing, as far as I can tell..
below image of what I am doinghttps://snipboard.io/G4v3IQ.jpg
The response keeps giving back the old link location. I have tried above with Put, Patch and Post, all give the same response. I can update any value in the product Json, except for the image link.. Is there some setting somewhere that might be causing the change of images to become impossible? Either in the server settings, woocommerce or wordpress settings?
- This reply was modified 4 years, 1 month ago by samsup.
Forum: Plugins
In reply to: [WooCommerce] REST API not updating image linkI can by the way also confirm that I have tried to do the request without the read only datapoints of ` “date_created”: “2021-06-30T13:02:27”,
“date_created_gmt”: “2021-06-30T13:02:27”,
“date_modified”: “2022-05-05T17:32:26”,
“date_modified_gmt”: “2022-05-05T17:32:26”,Forum: Plugins
In reply to: [WooCommerce] REST API not updating image linkHi Mirko,
Thank you for the suggestion. I must have made a typo when redacting the link, but I can confirm that I have been doing the put request with the correct double quote..
"images": [ { "id": 20435, "date_created": "2021-06-30T13:02:27", "date_created_gmt": "2021-06-30T13:02:27", "date_modified": "2021-07-11T13:14:19", "date_modified_gmt": "2021-07-11T13:14:19", "src": "https://www.https://samsup.com/images/0260101.jpg", "name": "test", "alt": "test "}],it returns:
"images": [ { "id": 20435, "date_created": "2021-06-30T13:02:27", "date_created_gmt": "2021-06-30T13:02:27", "date_modified": "2022-05-05T17:32:26", "date_modified_gmt": "2022-05-05T17:32:26", "src": "https://www.samsup.com/wp-content/uploads/2021/06/0260101.jpg", "name": "test", "alt": "test" } ],Forum: Plugins
In reply to: [WooCommerce] REST API not updating image linkOkay so an update to this issue I am running into;
I can modify image name, and altname via the postman PUT command. I have been succesfull in updating various other arrays too. The only thing at this point not working is updating the image “src” link. Whenever I drop a paypload it will update all fields fine, just not the image “src” ones. It gives status 200, so no errors.
Unless there is another way this should be done..simply dropping the files in with FTP clearly doesnt work to bulk replace images, and linking each image separately by hand is not an option with over 4000 products to update. My idea was to have a little script in my database program crawl trough each product and just update the image source link in woocommerce by using the REST API to link to the new image ( image is present on the server, accesible via http), and hoped that woocommerce would be able to pick that up.. but this seems to be impossible too. Also failing to add a second picture by just uploading the “src” imagelink without imageID (from what I gather it should then create a second image)
I have tried to find more correct methods of mass updating images in woocommerce, but have been unsucessfull in finding somethhing that works for us.