woocommerce / woocommerce/wc-api-python

Image order problem

Open
#68 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
216
Forks
108
Avg merge
6h 34m
Merged PRs (30d)
1

Description

Hello,

When adding a new product with the REST API module, I make sure that the image order is correct, so that the first image becomes the display image. Since we are using REST API v3, there is no position attribute.

The generated python dictionary has correct order, but the images on the product are not.
In this snippet of generated dictionary you can see the order of images, as you can see in the name of the image file, last number is positional index that indicates what order we want the images in.
"images": [{ "src": "https://mana.hal.si/wp-content/uploads/products/2321049000003_22_0.png", "alt": "Baby majica" }, { "src": "https://mana.hal.si/wp-content/uploads/products/2321049000003_22_1.png", "alt": "Baby majica" }, { "src": "https://mana.hal.si/wp-content/uploads/products/2321049000003_22_2.png", "alt": "Baby majica" }]

Any idea why this could be happening?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing product creation through the REST API v3 with the ordered image dictionary shown in the report, then inspect the created product's image order and display image. Compare the submitted order with the API response to determine whether the order is lost during request handling or by WooCommerce; done means identifying the cause and covering the expected ordering behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.