Multiple Shops
This article is intended for merchants and agencies/developers wishing to query and link multiple shops data for a tool to a website (Prestashop, WooCommerce ...).
#
IntroductionTo understand how multiple shops data are linked together, you need know that nothing is magical, and we can only link products (aka Variants) together at this point.
This guide explains the steps to follow on:
- How to query mutiple shops variants.
- How to query a specific shop variants.
- How to combine stocks from multiple shops variants which are linked.
#
Prepare the groundBefore starting, we suppose that you have already checked:
- The guide about "Interacting with products".
- The guide about "Creating an online store".
- The guide about "The Playground".
#
PremisesLet's suppose that you have an account which access to 3 shops data (ShopA
, ShopB
, ShopC
).
#
How to query mutiple shops variantsWhen you have an account that access multiple shops then by default you will query over all the data in all the shops combined. so a query as the following will return variants from from ShopA
ShopB
and ShopC
#
How to query a specific shop variantsIn order to get a specific shop variants, we need to simply filter the results using the identifier of the chosen shop (or shops)
#
How to combine stocks from multiple shops variants which are linkedBefore we can answer this question you need to understand how variants from different shops can be linked.
We can say that two or more variants from two or more shops are linked together if they have the exact same value of their stock keeping unit
or (SKU
), this concept is used by organised shops to keep track of their products across multiple shops and you can read more about this here.
But how we can use this knowledge to combine stock of linked variants from multiple shops, and to answer this question you need to:
- Get all the variants which have the same stock keeping unit value.
- Combine their stock raw quantity with a simple for loop.
#
Get all the variants which have the same stock keeping unit valueMake sure to query and paginate through all the variants until you have no more values to query
#
Combine their stock raw quantity with a simple for loop#
SupportWino's technical team is available by chat on the following link: help.wino.fr.