Table of contents
- Introduction
- Step 1: Create an outgoing configuration
- Step 2: Create a route
- Step 3: (Recommended) Create a SKU check to prevent duplicated products
- Additional information
Introduction
This article describes how to create products in WooCommerce.
Step 1: Create an outgoing configuration
- Navigate to “Connections” in the menu and select “Outgoing”.
- Create a new outgoing configuration to setup the process of creating WooCommerce products.
- Insert a name in the “name” field.
- For example: “WooCommerce – Products – Create a product”.
- Under “Publisher” select “WooCommerce - Product - Create or update Product”.
- Under “WooCommerce HTTP client” select the HTTP client that you created during the initial setup.
- Click “Add entity transformer” and select “WooCommerce - Product - Restructure from Alumio product”.
- This transformer converts data from the Alumio product schema to a format that WooCommerce understands.
Step 2: Create a route
Next you’ll create a route to bind the incoming configuration to the outgoing configuration. In the route, you’ll need to select the outgoing configuration you created in the previous steps.
On the following links, you can find more information about creating routes and incoming configurations and subscribers.
Step 3: (Recommended) Create a SKU check to prevent duplicated products
When you don’t already know whether the new product already exists, you can add a check to prevent Alumio trying to add products again, resulting in failing tasks.
- In the route, click “Add entity transformer” and select the “WooCommerce - Product - Find Product by SKU” transformer.
- Under “WooCommerce HTTP client” select the HTTP client that you created during the initial setup.
- Under “Sku”, specify the path where the product’s SKU is stored within the data, using the “&{}” notation.
- For example: “&{sku}” or “&{product.sku}”.
- Click “Add entity transformer” at the bottom of the page and select the “Data, transform data using mappers and conditions” transformer.
- Click “Add filter” and select “Value condition”.
- Under “Accessor” select “Pattern accessor”.
- Under “Pattern” insert “WooCommerceProduct”.
- Select “Add conditions” and select “Is empty”.
Additional information
If you added the check in step 3, no task will be created in your Alumio dashboard if the SKU already exists in the WooCommerce website.
There’s also a transformer available (“WooCommerce - Product - Create or update Product with sending data”) that has the same functionalities as this outgoing configuration. You can use this in case you like to add additional steps in your route after you created the product, like storing the new product ID. You can combine the SKU check in step 3 with this transformer.
It’s currently not possible to create an individual variant.
You could use the “WooCommerce - Product - Find Product by SKU” transformer to get product data based on SKU.
This outgoing configuration uses the Alumio product schema.
That’s it!
You should now be able to create products in WooCommerce!