• Resolved klaushauschild

    (@klaushauschild)


    Hi there,

    I am using the REST API to WooCommerce to create simple and variable products.
    Now I’m stuck at a problem with prouct images. The referenced images are already uploaded to WordPress.
    Within the POST to create a product there is

    
    ...
    "images": [
            {
                "src": "https://www...jpg"
            }
        ],
    ...
    

    The product is created but the image is connected with the product as a product gallery image. I need the images a product image! Instead my shop isn’t working because the gallery images arn’t used.
    When I change the image association to the product as I want it as the one product image all works in the shop and I mentioned a strange behaviour.
    When I get this product via the REST API there is no difference in the JSON response for the image associated as product gallery image or as product image.
    Is there a way to control the usage of the image or explicitliy add the image as product image?
    Thanks for you help.

    Klaus

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter klaushauschild

    (@klaushauschild)

    By accident I stumbled about the the info that there ways in a previous version of the API a field called featured_url.
    This is gone. But if you do like in the docu said and give a “position”: 0 to the single image it will become the featured one.

    I just registered to thank you wholeheartedly. I was about to submit to a mental hospital from the sanity toll this was taking.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘REST API product image’ is closed to new replies.