gherry.gecko
Forum Replies Created
-
Hi George,
Any updates on this?
Hi George,
Add-ons should not leak its internal implementation to the API. As an external consumer of the API, I should just assume that a product id represents a unique product. The product id and the localized product id represent the same unique product in real world and not a different one.
For example, product A has id 1 and the localized version of product A has id 2. If there’s an order and it lists product id 2 in the line items, then how should I know that I need to update the stock of the product A? In real world, product id 1 and product id 2 are the same product and they have the same stock.
Do you have any plan on fixing this?
Cheers,
GherryHi George,
I can’t give you any test server or data to play with because this happened in one of our client store and I’m not sure if they are comfortable with sharing that details.
However, to replicate this you can test it out by creating a product and its translation. Say the original product will get id 1 and the localized product will get id 2. When you create an order in that localized version with that product and you hit the Order Endpoint with GET request (https://woothemes.github.io/woocommerce-rest-api-docs/#view-an-order), then you’ll get product id 2 in the line items.
This is troublesome because product 1 and product 2 are actually the same product. Imagine if you’re tracking the sold stock of that product by getting all the orders through API, you would like to get the sold stock of product 1 which is the original product and not fragmented by its localized product.