I want to use my spreadsheet to add new products to WooCommerce. I have already read quite a few topics on the Make forum, but unfortunately, it has not yet led to the success I am looking for.
What needs to be done:
- Spreadsheets detect if a new row is added and push it to WooCommerce. However, there is a problem:
In the spreadsheet, both the parent and the variable are listed. When creating a product, only the parent should be created first, and the variables should be added later.
These variables each have their own size, price, and SKU, and that is precisely the part where I need help. How do I ensure that all variants are added to the parent with the correct information?
I had thought of creating a datastore after the spreadsheet and using it later after the parent is placed to add all the sizes with the correct information one by one, something like this:
Is this the best option? Or does anyone had a better idea?
To address your main issue, you should focus more on the Google Sheets database.
If parents are mixed with the variants, the database should contain at least:
- Parent SKU/ID: This will help you identify assigned variants.
- WooCommerce ID of the Parent: This should be filled out after the successful export of the product.
- Variables linked to the Parent: Use the ID described in step 1.
- Variables ID’s from Woo: to ensure all of them were uploaded.
To ensure that everything was correctly exported to WooCommerce, log it back to your database (Google Sheets).
Here’s how your scenario can work:
- Watch new rows
- Router
- Route 1:
3.1. FILTER: Is Variant=False
3.2. Create new product
3.3. Update a cell (WooCommerce Parent ID) with WooCommerce product ID
- Route 2:
4.1. FILTER: WooCommerce Parent ID is not empty
4.2. Create new variant
4.3. Update a cell: WooCommerce Variant ID with WooCommerce Variant ID
Here’s an example structure of Google Sheets database:
Then, you just need to put everything in the process. Keep in mind that if the scenario is scheduled to watch for new rows, the product should be ready to upload when the scenario is triggered.
Hi @mszymkowiak, thanks for the feedback.
I’m struggeling with 1 more problem: how to update the parent id (at all the variations) in the spreadsheet, the row is always different.
I find this topic on make: Google Sheets: Lookup Row, Lookup Column then Update Cell. But here, the row is always the same.
I got 1 parent id, and 10+ sizes.
*You always need the parent-id for the variantions to link them to the parent.
So i think route 2 need some modifications, but i don’t know how to.
- Route 2:
4.1. FILTER: Is Variant: TRUE
4.2. Variant need the Assigned Parent ID by update a row
4.3. Create product variation
Today I looked further and came up with the following. Unfortunately, my Make knowledge does not extend further and I hope someone can supplement it.
I have a Woocommerce module that searches for the parent ID.
Then an advanced search row with the formula:
select * where CW = '{{47.id}}'
that searches for the parent ID.
After this, I want to do a bulk update row to give all children the parent ID (this is needed to link later within Woo). However, I don’t have enough knowledge to set up FUNCTIONS correctly.
Am I on the right track this way? @mszymkowiak
With a bit of help and support from Make, I figured it out.
In this topic: Multiple Input Router, @Runcorn mentioned that if you want to duplicate modules in different routes, you need to use a database. Many thanks for sharing .
Here is the scenario that worked for me:
3 Likes