Skip to main content

WooCommerce Product Variant FROM iPaaS.com Mapping Documentation

How the WooCommerce integration updates or adds a single variation when one iPaaS.com variant changes on its own, without resending the whole product.

Contents

  • Summary

  • ID Format

  • Deleted Record Support

  • Custom Field Support

  • Mapping Collection Status

  • Duplicate or Conflicting Mappings

  • Supported Child Collections

  • System Caveats

  • Setup Requirements

  • Integration Flow

  • Mappings

  • Error Handling

  • Testing and Validation

  • Additional Notes

  • Related Documents

Summary

This documentation covers a variant changed on its own in iPaaS.com, FROM iPaaS.com. The integration finds the variant's product in WooCommerce (the product must have reached the store first) and then:

  • updates the linked variation, or the one with the same SKU, or the one with the same options;

  • or adds a new variation, adding its option values (for example a new size XL) to the product's attributes.

Its stock travels with it, as the total of the Stock Locations. Variants sent with their product are covered by WooCommerce Product FROM iPaaS.com.

ID Format

Manual Sync ID Format: Enter the iPaaS.com Product Variant ID.

External ID Format (saved after sync): {product id}|{variation id} (for example 812|815); its stock {product id}|{variation id}|{iPaaS.com location id}.

Deleted Record Support

Deletes are not sent. Set the variant Disabled or Discontinued in iPaaS.com: it becomes a draft in WooCommerce (hidden from shoppers), so orders that used it keep their history.

Custom Field Support

Yes, FROM iPaaS.com: create a custom field for the WooCommerce subscription on its WooCommerce Product Variation table, named exactly as the meta key, and map a value to it. Keys starting with _ are not written.

Mapping Collection Status

The template is active and its filter passes every variant. If you filter the Product collection, add the same condition here. If a stand-in product has variants, leave them out by the stand-in products' iPaaS.com product ids, for example return Convert.ToInt64(ParentId) != 12345 && Convert.ToInt64(ParentId) != 12346;.

Duplicate or Conflicting Mappings

Keep the parent product id mapping (IpaasProductId): without it the variation can't be placed. A second collection with a filter that doesn't overlap is safe; a variation is found, not duplicated.

This collection has no Collision Handling Method setting. Matching is automatic: a variation is found by its link, else its SKU, else its options (WOOC-BIZL-1004, WOOC-BIZL-1007 when that is ambiguous).

Supported Child Collections

  • WooCommerce Product Variant Inventory FROM iPaaS.com (with the variant): the variation's stock.

System Caveats

  • The variant's product must be in WooCommerce for this subscription first (WOOC-NFND-1003): transfer the product, and its variants go with it.

  • The WooCommerce product must be a variable product (WOOC-BIZL-1005).

  • Give each variant its options: up to three in Option1 to Option3, and more in its Attributes list. A variant without options is written as given, and WooCommerce shows it as matching any option (Known Limitations 6).

  • Two variations of one product with the same SKU, or the same options, stop the transfer (WOOC-BIZL-1004, WOOC-BIZL-1007).

Setup Requirements

The iPaaS.com events product/variant/created and product/variant/updated turned on in the subscription's FROM iPaaS.com data flows, and the products sent first.

Integration Flow

  1. A variant is created or changed in iPaaS.com.

  2. iPaaS.com runs this collection; the filter decides whether it is sent.

  3. The integration finds the product by the variant's parent link, then the variation by link, SKU or options.

  4. It updates or adds the variation (adding new option values to the product) and saves the link.

Mappings

Add/Update WooCommerce Product Variant FROM iPaaS.com

iPaaS.com data type: Product Variant. Sync type: Add/Update. Mappings: 16.

Description: A variant changed or added in iPaaS.com on its own updates or creates its WooCommerce variation, with its stock from the inventory child collection. The product must already be in WooCommerce for this subscription (transfer the product first); otherwise the variant stops with a clear error and nothing is created. A new option value is added to the product's attributes first. Products and variants are never deleted: an inactive variant becomes a draft.

Mapping Filter:

// Every variant iPaaS.com sends is created or updated in the store.
// If you filter the Product collection, add the same condition here.
// If a stand-in product (the fee item or the item for lines without a SKU) has variants, leave them out here too,
// by the stand-in products' iPaaS.com product ids, for example:
// return Convert.ToInt64(ParentId) != 12345 && Convert.ToInt64(ParentId) != 12346; with your ids.
return true;

Mapping Type

Source Field (iPaaS.com)

Destination Field (WooCommerce)

Description

Dynamic Formula

formula 1 (below)

IpaasProductId

(Required.) The iPaaS.com product this variant belongs to. A variant sent on its own finds its WooCommerce product with it (transfer the product first).

Field

Sku

Sku

(Recommended.) The variant's SKU. It finds a variation the integration already created, and order lines are linked back to the variant by it.

Dynamic Formula

formula 2 (below)

Option1Name

(Recommended.) The first option's name, for example Size. WooCommerce tells variations apart by their options, and adds the option to the product's attributes. A variant without options is written as sent, and WooCommerce treats it as matching any option of the product (Known Limitations 6).

Dynamic Formula

formula 3 (below)

Option1Value

(Recommended.) The first option's value, for example Large.

Dynamic Formula

formula 4 (below)

Option2Name

(Optional.) The second option's name, for example Color.

Dynamic Formula

formula 5 (below)

Option2Value

(Optional.) The second option's value.

Dynamic Formula

formula 6 (below)

Option3Name

(Optional.) The third option's name.

Dynamic Formula

formula 7 (below)

Option3Value

(Optional.) The third option's value.

Field

DefaultPrice

RegularPrice

(Recommended.) The variant's price as the WooCommerce regular price.

Dynamic Formula

formula 8 (below)

SalePrice

(Optional.) The variant's sale price, sent when it is above zero. A sale price above the regular price is sent as given, and WooCommerce shows no sale. When the regular price is sent and the sale price is empty or zero, the sale ends in WooCommerce, unless the collection keeps its static mapping KeepStoreSalePrice = true (below); WooCommerce's sale price is then left as it is.

Static

true

KeepStoreSalePrice

(Recommended.) Keeps a sale you run in WooCommerce: when iPaaS.com sends a regular price but no sale price, the store's sale price is left as it is instead of being cleared. A sale price sent from iPaaS.com is still written. Remove this mapping only if iPaaS.com is the only place sale prices are managed and an empty sale price should end the sale.

Dynamic Formula

formula 9 (below)

Status

(Recommended.) Active and Preorder variants are published; Disabled and Discontinued ones become drafts (hidden from shoppers, order history kept), the same as products; any other status leaves the variation as it is.

Field

Weight

Weight

(Optional.) Weight, in the store's weight unit.

Field

Depth

Length

(Optional.) Depth, as the WooCommerce length, in the store's dimension unit.

Field

Width

Width

(Optional.) Width, in the store's dimension unit.

Field

Height

Height

(Optional.) Height, in the store's dimension unit.

Dynamic Formulas (verbatim)

Formula 1, IpaasProductId:

return Convert.ToString(ParentId);

Formula 2, Option1Name:

// Option 1 of the variant (iPaaS.com option order).
if (Options == null) return null;
var o = Options.OrderBy(x => x.Order ?? 0).Skip(0).FirstOrDefault();
return o != null ? o.OptionName : null;

Formula 3, Option1Value:

// Option 1 of the variant (iPaaS.com option order).
if (Options == null) return null;
var o = Options.OrderBy(x => x.Order ?? 0).Skip(0).FirstOrDefault();
return o != null ? o.Value : null;

Formula 4, Option2Name:

// Option 2 of the variant (iPaaS.com option order).
if (Options == null) return null;
var o = Options.OrderBy(x => x.Order ?? 0).Skip(1).FirstOrDefault();
return o != null ? o.OptionName : null;

Formula 5, Option2Value:

// Option 2 of the variant (iPaaS.com option order).
if (Options == null) return null;
var o = Options.OrderBy(x => x.Order ?? 0).Skip(1).FirstOrDefault();
return o != null ? o.Value : null;

Formula 6, Option3Name:

// Option 3 of the variant (iPaaS.com option order).
if (Options == null) return null;
var o = Options.OrderBy(x => x.Order ?? 0).Skip(2).FirstOrDefault();
return o != null ? o.OptionName : null;

Formula 7, Option3Value:

// Option 3 of the variant (iPaaS.com option order).
if (Options == null) return null;
var o = Options.OrderBy(x => x.Order ?? 0).Skip(2).FirstOrDefault();
return o != null ? o.Value : null;

Formula 8, SalePrice:

// The sale price when it is above zero. WooCommerce shows it as a sale only when it is below the regular price.
if (SalePrice == null || SalePrice <= 0) return null;
return SalePrice;

Formula 9, Status:

// Active and Preorder variants are sold; Disabled and Discontinued ones become drafts (hidden from shoppers, order history kept), the same as products. Other statuses leave the variation as it is.
if (Status == "Active" || Status == "Preorder") return "publish";
if (Status == "Disabled" || Status == "Discontinued") return "draft";
return null;

WooCommerce Product Variant Inventory FROM iPaaS.com (with the variant)

iPaaS.com data type: Product Variant Inventory. Child of: Add/Update WooCommerce Product Variant FROM iPaaS.com. Sync type: Add/Update. Mappings: 3.

Description: The variant's stock, written with the variant. The integration reads the stock of every location in the Stock Locations setting from iPaaS.com, measured by the Stock Quantity Field setting, turns on Manage stock and sets the variation's total. The Stock Locations setting decides which locations count. If this collection's filter passes no inventory record, stock isn't sent with the variant; the stock-only collections still update it.

Mapping Type

Source Field (iPaaS.com)

Destination Field (WooCommerce)

Description

Dynamic Formula

formula 10 (below)

IpaasVariantId

(Required.) The iPaaS.com variant this stock belongs to (the inventory record's parent). The integration uses it to find the WooCommerce variation and to read the stock at every location.

Dynamic Formula

formula 11 (below)

LocationId

(Optional.) The iPaaS.com location of this stock. Left unmapped, the integration finds the location from the inventory record in iPaaS.com.

Field

QtyAvailable

StockQuantity

(Required. A plain field, never a formula: map the same quantity as the Stock Quantity Field setting, QtyAvailable by default or QtyOnHand when the setting is QtyOnHand; change both together.) The WooCommerce total is read from iPaaS.com's inventory over the locations in the Stock Locations setting and counts the quantity the Stock Quantity Field setting names. This mapping never changes the total: the integration compares it with this location's available and on-hand quantities in iPaaS.com to confirm that iPaaS.com already shows the stock change, so the check covers only the quantity mapped here. A formula here (for example a safety buffer) doesn't change the total; a value that matches neither quantity is logged as a warning.

Dynamic Formulas (verbatim)

Formula 10, IpaasVariantId:

return Convert.ToString(ParentId);

Formula 11, LocationId:

return Convert.ToString(LocationId);

Error Handling

Every error the integration raises carries a WOOC- code; WooCommerce Error Messages has the full text, cause and what to do for each. iPaaS.com's own refusals have no WOOC- prefix. Connection errors (Store URL, key, host) can stop any transfer and are listed there under "Connection and settings".

Code

When

What to do

Retried by iPaaS.com

WOOC-EXTN-1006

WooCommerce rejected a value in the record (its own message follows).

Correct the value named in WooCommerce's message in the source record or the mapping, then transfer again.

Yes, until fixed or dismissed; it fails the same way until the cause is fixed

WOOC-NFND-1003

A variant was transferred on its own before its product reached WooCommerce.

Transfer the parent product; its variants go with it.

Yes, until fixed or dismissed; it fails the same way until the cause is fixed

WOOC-BIZL-1004

The variation SKU is used more than once on the product.

Give each variation its own SKU in WooCommerce, then transfer again.

Yes, until fixed or dismissed; it fails the same way until the cause is fixed

WOOC-BIZL-1005

A variant was sent for a product that is not a variable product in WooCommerce.

Transfer the parent product with its variants so it becomes a variable product.

Yes, until fixed or dismissed; it fails the same way until the cause is fixed

WOOC-BIZL-1007

The product has duplicate variations with the same option values, and the variant has no link or SKU that picks out one of them.

Delete or change the duplicate variations in WooCommerce, or put the variant's SKU on the WooCommerce variation it should update, then transfer again.

Yes, until fixed or dismissed; it fails the same way until the cause is fixed

WOOC-VALD-1009

WooCommerce stores stock as a whole number, and the total of the counted locations has a fraction.

Keep this product's stock in whole units in iPaaS.com (the total is read from its inventory there), then transfer again.

Yes, until fixed or dismissed; it fails the same way until the cause is fixed

WOOC-NFND-1006

The Stock Locations setting names locations (ids or names) that don't exist, or are misspelt.

Correct the Stock Locations setting: iPaaS.com location ids or names, comma-separated; leave it blank to count every location.

Yes, until fixed or dismissed; it fails the same way until the cause is fixed

Testing and Validation

Follow the WooCommerce Installation Instructions, "Before you test: test safely": test on a staging copy of the store with its own subscription, if your host offers one; on your live store, test before your back-office systems are connected, with a Private test product and your own name and email address.

  1. Add a third variant (for example XL) to a test variable product already in the store: a new variation appears and the product's Size attribute gains XL.

  2. Change one variant's price: only that variation changes.

Additional Notes

A variant sent before its product reached the store fails with WOOC-NFND-1003 and iPaaS.com retries it; once the product is sent, the next attempt succeeds.

Related Documents

Related Mapping Documentation

  • WooCommerce Product FROM iPaaS.com Mapping Documentation

  • WooCommerce Inventory FROM iPaaS.com Mapping Documentation

Did this answer your question?