We’ve been working hard on adding WP All Import compatibility to our plugins that require it, and I’m excited to announce that WooCommerce Show Single Variations was next in line! Let me go through the details on how to import your variation visibility when using WP All Import.
Preparing the Spreadsheet
I use OpenOffice for creating my spreadsheets, saving them as CSV files. However, the beauty of WP All Import is it accepts a variety of file types, so use whatever you feel comfortable with, but follow this structure.
You are able to import the following fields:
A comma separated list of visibility locations. These are catalog, search, and filtered.
1 for true, 0 for false.
- Disable “Add to Cart”
1 for true, 0 for false.
- Display Title
The title of your variation in the catalog. Don’t import this column if you want to keep the parent product title.
The following example assumes you are *updating* an existing set of variations, so I’ll also have an
Your spreadsheet structure should be as follows:
ID | Visibility | Featured | Disable "Add to Cart" | Display Title
1596 | catalog,filtered,search | 1 | 1 | Variation 1
1597 | catalog | 0 | 0 | Variation 2
1598 | search,filtered | 1 | 0 | Variation 3
Importing the Variation Data
Importing the variation data is simple. Now that you’ve prepared and saved your spreadsheet as a CSV file, let’s import it into WordPress.
Firstly, upload your CSV file. Then, choose Existing Items and select Variations from the dropdown field.
Click Continue to Step 2.
Step 2 should show you a well formatted list of your variation data. Assuming all looks good, click Continue to Step 3.
On Step 3, we’re only going to be importing custom field data. Click the Custom Fields tab. We want to add 4 custom fields, these are:
Add those rows, and click and drag the relevant column titles from the right hand side spreadsheet overview. It should now look like this:
You can save these settings to use again, by checking the Save settings as template field and giving it a name. Click Continue to Step 4.
As we’re updating existing items, we want to match variations by Post ID. Click Post ID and drag the id column heading into the input field.
Next, we want to make sure that it *only* updates those 4 custom fields, and nothing else. Uncheck Create new posts from records newly present in your file. Check Update existing posts with changed data in your file and make sure Choose which data to update is selected. Unselect all except Custom Fields. Then choose Update only these Custom Fields, leave the rest alone and enter the custom field names from before into the field.
We’re good to go! Click Continue, check the Import Summary, and then click Confirm & Run Import.
Your variation data will now be processed accordingly.
Wrap It Up
I’ll be adding WP All Import to all of our WooCommerce plugins that require it, so keep an eye out for updates in the future!