Skip to main content

How products are matched

WooCommerce IDs​

Every WooCommerce product has an ID, and every variation of a variable product has its own ID. Order lines carry both: product_id (the product) and variation_id (the variation, or 0). Odoo links:

  • a simple product by its product ID,
  • each variant of a variable product by its variation ID, with the parent product ID kept as Store Parent ID.

So an order line is found by its variation ID first, then by its product ID, then by SKU.

Odoo keeps a link between each WooCommerce product and an Odoo product: Online Stores > Catalog > Store Products for products, Product Links for each variant. Links are how orders, stock and prices find the right product.

Product links with the stock and price last sent

How an order line finds its product​

  1. Link. Odoo looks for a product link with the variant ID of the line, then with the product ID.
  2. SKU. Odoo looks for a product whose Internal Reference equals the SKU of the line. With Match Products By set to Internal Reference, then Barcode = SKU, it also tries the Barcode. Only products of the store's company or of no company count; archived products count too.
  3. Import. With Import Unknown Products With Orders on, Odoo imports the product from WooCommerce (step by step as below), then tries the link again.
  4. Not found. The whole order waits in the queue with Products not found in Odoo: ... Link or import them, then retry. Nothing is created for that order until every line has a product.
tip

A line found by SKU does not create a link. Run Sync... > Import products from the store once so every product is linked; stock and prices are only sent for linked products.

How a product import finds or creates the Odoo product​

  1. Link. A WooCommerce product that is already linked keeps its Odoo product.
  2. SKU. Odoo looks for an Odoo product with the SKU of the product, or of any of its variants (same rules as above), and links its product template.
  3. Create. When nothing matches, Odoo creates the product.

When Odoo links an existing product, it does not change it: name, description, prices and taxes stay as they are in Odoo. Only a missing image is added (with Import Images on).

What a new product looks like​

Odoo fieldValue
NameThe WooCommerce product name
Product typeStorable (tracked in inventory)
Sales PriceThe store price (for variants: the lowest variant price)
Internal Reference, BarcodeThe SKU and barcode. A barcode already used by another product is left empty.
WeightThe store weight
Sales descriptionThe short description from the store, when there is one
Product CategoryThe Odoo category mapped to its store category (Catalog > Store Categories), else Category for New Products
CompanyNone (the product is shared by all companies)
ImageThe main store image, with Import Images on

Variants​

  • Each option of the store product (for example Size, Color) becomes an Odoo attribute with the same name, set to create variants. An existing attribute of that name is reused only if it also creates variants instantly; Odoo never touches an attribute set to Dynamically or Never.
  • Each WooCommerce variant is linked to the Odoo variant with the same SKU, else with the same option values.
  • New variants get the SKU, barcode, weight and image of the store variant.
  • Prices: the lowest variant price becomes the product's Sales Price. When variants have different prices and the store has a Pricelist, Odoo adds a fixed price per variant to that pricelist. Without a store pricelist, only the lowest price is kept.
  • Store variants that match no Odoo variant are listed in the log as a warning. Their orders then need the product linked by hand or a matching SKU.

Examples​

SituationResult
The Odoo product has the same SKULinked. Nothing in the Odoo product changes.
No SKU in the store, product not in OdooCreated with the store name and price.
Two store products use the same SKUThe second import stops with Odoo product X is already linked to another store product (SKU clash with store product Y). Give each store product its own SKU.
Store product type not supported by the connector (for example a bundle or external product)Skipped with a warning in the log.
A product is renamed in WooCommerce after linkingThe Odoo name stays. Odoo is the master of product data once linked.

FAQ​

I imported products by mistake. How do I undo it? Archive or delete the created Odoo products, then delete their lines in Store Products. Nothing changes in WooCommerce.

Can one Odoo product be linked to two stores? Yes, one link per store. Within one store, a product can only be linked to one store product.

Can I link a product by hand? Give the Odoo product the store SKU as Internal Reference, then run Sync... > Import products from the store again.

Was this page helpful?