Easily bulk fix of WooCommerce product attributes: Integrate WooCommerce and Printify Series Part 2

We hope you find this tutorial useful, please share it if you do!

When you publish your product from Printify into your WordPress WooCommerce site, this tutorial shows how and why to change your WooCommerce product attributes: specifically from custom product attributes to global product attributes when incorporating Printify* products into WooCommerce. This article is part of a wider series on integration between print on demand platforms and WordPress and WooCommerce integration.

Author

About this Print-on-Demand and WooCommerce Integration Series

The Print-on-Demand and WooCommerce Integration series takes you all the way from signing up to your chosen print on demand (‘POD’) providers, creating your first product inside your POD account, establishing a connection between your POD provider with your WooCommerce website, publishing your product into WooCommerce and making necessary changes to WooCommerce settings.

There are a range of print-on-demand providers who support WordPress WooCommerce integration. This particular set of articles shows you how to integrate your WordPress and WooCommerce website with the print on demand platform Printify *.

Prerequisites for this tutorial

This tutorial assumes that you have already been through the process of signing up to Printify *, linking your WordPress and WooCommerce website to your Printify * account, and publishing your first product from Printify to WooCommerce. If you have not been through this process already, you can follow another of our tutorials called “Integrating WooCommerce and Printify: Part 1 – Set up Printify and Connect with WooCommercehere.

To follow along with this tutorial, we assume you already have the following in place:

  • WordPress and WooCommerce pre-installed on your website
  • A Printify * account, connected to your WordPress website;
  • You have created your first product within Printify, ready for publishing to your WordPress WooCommerce website

If you haven’t created a Printify account yet, follow the link below to sign up:

Sign up to Printify* for free

The Printify Print on Demand platform is completely free to join and integrate into your WooCommerce and WordPress site. By joining Printify * via this affiliate link (denoted by ‘*’) we receive a small commission on the product orders your customers make, which are fulfilled through Printify. This comes at no extra cost to you, and funds more technical articles like this.

Assuming you already have all those preliminary Printify/WooCommerce integration tasks above under your belt, let’s get started with this tutorial, which covers looking at and, where necessary, fixing your Printify product’s attributes, and why you need to make changes to your product attributes.

1. Publish your product from Printify to your WordPress WooCommerce Site

First of all, take a product you have made and finalised in your Printify account, and import it into your WooCommerce site by ‘publishing’ it from Printify (how this is done is separately covered in detail in a separate article). Section 1.1 of this article and onwards explains how a product imported from Printify appears on a WooCommerce site, using an example t-shirt.

1.1 The Printify Product imported into WooCommerce

Here, the t-shirt imported from Printify * into the WooCommerce website is shown in Figure [1]. Note that it contains all the variations of size and color which we have chosen to import from Printify and thus displays the t-shirt as a variable product (as opposed to a ‘simple product’ within WooCommerce):

how an imported Printify product appears on the front end of a WooCommerce site with available color and size variations
Figure 1: how an imported Printify product may appear on the front end of your WooCommerce site and shows the Color and Size variations for the variable product.

Note from Figure 1 that the product attributes of the variable product are Colors: Black, Navy, Sport Grey, White and Sizes: S, M, L, XL, 2XL, 3XL, 4XL, 5XL.

1.2 Printify Product Settings when you import a product into WooCommerce

At the backend of WordPress when you are logged in, have a look at the imported Printify * product and its settings, amongst all the other WooCommerce products. In order to view the Printify imported t-shirt, go to WooCommerce -> Products -> All Products, and you will see the list of all your products, and the imported t-shirt at the top of the list (Figure 2):

wordpress dashboard showing all woocommerce products in a list
Figure 2: WordPress back end dashboard showing WooCommerce -> Products -> All Products

In the list of WooCommerce products shown in Figure 2, it is the T-shirt at the top of the list which is of interest; this is the product which has been imported from Printify *. In order to look at the Printify t-shirt, click on that product’s name to the right of the product icon. You will then see settings for the example T-shirt imported from Printify. Depending on the settings you have chosen in Printify * for importing, you can import product images, product description and this all appears as shown in the T-shirt listing, as in Figure 3:

detailed WooCommerce product listing (a t-shirt) imported from Printify which shows imported product image, product description
Figure 3: Detailed Woocommerce t-shirt listing imported from Printify

In the detailed WooCommerce product listing view ( Figure 3 above), scroll down through the product description and look at the product settings in Figure 4 below, where you see the Product data tabs (inventory, Shipping, Linked Products, Attributes etc).

detailed woocommerce product (Printify t-shirt) showing product data options such as Attributes
Figure 4: Detailed WooCommerce t-shirt listing imported from Printify *, showing Product data options such as Attributes – the t-shirt is a Variable product
Tip 1: Virtually all your imported Printify products will be variable products, as you are likely to offer a range of colors and, depending on the product, also sizes. Colors and sizes are attributes of that variable product.

1.3 WooCommerce Global Product and Custom Product Attributes

Global Product Attributes are feature or settings which can cover any of your products, right across your WooCommerce online store. They can be created as a way – together with using product categories or tags – to enabling filtering across all your products by attribute, and creating archive pages for any attribute. Common attributes are size, color or pattern, but they could be any type of attribute you like.

Custom Product Attributes are attributes which can be created within a particular product’s settings (within Product data for that product) but those attributes only apply to that particular product, and not to any other product in your shop. Say for example you sold a variable product which was an outdoor table, and its custom attribute was ‘material’: with options of wood, metal and plastic. This attribute may not be applicable to any other product, just your particular product which is a table. This brings us on to Printify* product attributes, and how they appear in WooCommerce on product import from Printify.

1.3.1 Printify Product Import Creates ‘Custom Product Attributes’ by default

When you import a variable product from Printify * (a t-shirt in this example), by default it creates custom product attributes, not global attributes for the variations. Therefore in this t-shirt example, each variation (e.g. color: white, black, navy, sport grey) or size (S, M, L, XL, 2XL, 3XL, 4XL, 5XL) is a custom product attribute.

Looking at the variable product (the example Printify t-shirt) in more detail, click on the Attributes tab within Product data; this shows that Custom product attributes have already been added (Colors, Sizes) via the import process from Printify (Figure 5):

imported Printify product into WooCommerce showing custom product attributes of colors and sizes for a variable product
Figure 5: Your imported Printify* product has custom product attributes in WooCommerce with variations in Colors and Sizes, shown via the Attributes tab

If you hover your mouse between the ‘burger’ icon (the three horizontal lines) and the word ‘Remove’ in Figure 5, and a triangle will appear which you can toggle. If you click on that triangle for the particular attribute e.g. Color, all the custom Color attribute options which have added via Printify will appear (Figure 6):

WooCommerce product dropdown menu showing custom color attributes imported from Printify
Figure 6: WooCommerce product dropdown menu showing custom color attributes imported from Printify*

If the ‘used for variation’ box is not ticked (which it is not in Figure 6), ensure that it is ticked [1] https://woocommerce.com/document/variable-product/#add-attributes-to-use-for-variations . Having seen that custom attributes have been added to the t-shirt product from Printify, going to the global product attributes settings will confirm that no equivalent size and color global attributes have been added as a result of the Printify* t-shirt import, which will be illustrated next.

1.3.2 No global Product Attributes have been created on Printify product import

Global attributes are to be found in the WooCommerce Product → Attributes (this appears just below Categories and Tags on the left hand side of Figure 7). As described in section 1.2.1, when the Printify* product has been imported it creates Custom product attributes (Color, Size) . However, as Figure 7 shows, importing a product from Printify with various size and color attributes has not imported the attributes as global attributes, hence the Attributes area within Products is empty.

WooCommerce products attributes menu showing no global attributes
Figure 7: Products -> Attributes: Importing a variable product (a t-shirt) from Printify does not create global attributes

Sign up to Printify* for free

The Printify Print on Demand Platform is completely free to join and integrate into your WooCommerce and WordPress site. By joining Printify * via this affiliate link (denoted by ‘*’) we receive a small commission on the product orders your customers make, which are fulfilled through Printify. This comes at no extra cost to you, and funds more technical articles like this.

2. Bulk amend WooCommerce global product attributes for Printify products

Having the custom product attributes copied over as global attributes has some major advantages, and these are set out at section 4. This section 2 explains how to recreate the custom product attributes as global product attributes. Note that, following this process, the custom product remain; they are not removed.

The first step to recreating custom attributes as global attributes is to export your products from WooCommerce.

2.1 Export your products from WooCommerce to a csv file

WooCommerce has a built in importer/exporter tool which can export all (or a subset of) the WooCommerce products on your site to a .csv formatted file as a spreadsheet [2] https://woocommerce.com/document/product-csv-importer-exporter/ . In order to use the importer/exporter, choose ‘Products’→ ‘all products’. This enables you to see the Products back end, which shows Import and Export buttons at the top (Figure [6]):

woocommerce all products page on the backend of the wordpress site showing Import and Export buttons
Figure 8: Dashboard on the backend of the WordPress site showing all WooCommerce products and Import and Export buttons

Press ‘export’ and you will get the following Export screen (Figure 9):

woocommerce export products to csv file page on wordpress backend with options for columns, types, categories of products
Figure 9: WooCommerce page on wordpress backend to export products to csv file with options for export of columns, product types, categories

This gives you the option to generate a CSV file of all your products. I am exporting all columns, products and categories. I am not exporting custom meta. Pressing ‘Generate CSV’ (the purple box in Figure 9) will prompt you to download the csv file locally to your machine; download that file in order for it to be opened in the next section.

2.1.1 Choosing a Spreadsheet Editing Program to view and edit the csv

There are various free (or built in the case of macOS) spreadsheet editing programs available for download and recommended by WooCommerce to open the exported .csv file [3] https://woocommerce.com/document/product-csv-importer-exporter/ :

Tip 2: due to formatting and character encoding problems, it is not recommended that you use Microsoft Excel Spreadsheets to open the exported csv.

2.1.2 Opening the csv file for inspection

Opening the .csv example using LibreOffice looks something like Figure 10. From section 1, it is known that the Printify* variable product which has been imported into the WooCommerce site is a t-shirt in the colors: White, Black, Sport Grey and Navy, and in the sizes S, M, L, XL, 2XL, 3XL, 4XL, 5XL. These will appear in the product csv file

The Color Attribute

On inspection of the csv, it can be seen in Figure 10 that for the Printify* t-shirt entry, the color variable attributes appear as a list an individual cell within column AO. The color variations (Attribute 1 value(s)) are listed in column AO also. The global attribute value for ‘Attribute 1’ (here, color) is set to zero for all the variations, and that can be observed in column AQ of Figure 10.

labelled woocommerce product csv showing variable product attributes with attribute 1 (color) global attribute set to zero.
Figure 10: WooCommerce product csv with labels showing variable product attributes with attribute 1 (color) global attribute set to zero.

The Color and Size Attributes

Zooming out, both color and size attributes can be seen, and are similarly labelled in Figure 11.

woocommerce product csv showing variable product attributes with attribute 1 global set to zero
Figure 11: WooCommerce products exported csv file showing variable product attributes with ‘Attribute 1 global’ (color) and ‘Attribute 2 global’ (size) both set to zero at this point

Note that in Figure 11 for the t-shirt from Printify*, the color variations (Attribute 1 value(s)) are listed in column AO, and the size variations (Attribute 2 value(s)) are in column AT. Below the listing in a cell of all possible color variations, and another cell which lists all size variations, note that in the rows below them, all possible color and size combinations are listed. For each of these variations, ‘Attribute 2 global’ in column AV is also set to zero for all combinations of size and color.

2.1.3 Change the global attribute settings for all product size and color combinations

For the size and color attribute combinations to become global attributes, the status of the Attribute ‘n’ global column in question (where ‘n’ is the number of a given attribute) must be changed from 0 to 1. For example, Attribute 1 is ‘Colors’. It’s global value “Attribute 1 Global” is set to 0 right the way down the column in Figure 11. To make this global, it should be set to ‘1’, as shown in Figure 12.

WooCommerce product csv setting global color attributes from 0 to 1
Figure 12: WooCommerce product csv setting global color attributes from 0 to 1

Similarly for the custom product attribute of size (attribute 2), it’s global setting should be 1, i.e. Attribute 2 global should be 1 not 0 down the column.

2.1.4 Other csv checks and alterations before importing csv

Tip 2: Check the number formatting on the SKU column in the csv file

When you open the csv file to view it and make changes, the csv reading software may alter the format of the cells of the product SKUs (stock keeping units) to convert them by default into scientific/exponential notiation form. As shown in Figure 13, OpenOffice has changed the format of my SKU column to this scientific format, and this SKU format will also appear on the front end of your site for your products (which looks rather odd).

woocommerce product csv showing some simple and variable product columns together with product SKUs
Figure 13: product csv showing some simple and variable products & product SKUs

If you are not displaying your SKUs on the front end of your WordPress online shop this scientific or exponential number format may not matter, but if you need to change it to standard number notation, highlight the whole SKU column by clicking on ‘C’ (column name at the the top of the SKU column) and right click. Then choose ‘format cells’ from the list which appears on right click and select -1235 instead of ‘General’ under Format (as shown in Figure 14), press ‘OK’ to apply the changes

format options window for cells in woocommerce product csv to remove scientific format for SKU
Figure 14: Changing the format of product SKU column to remove default scientific format

2.2 (Re)import all the products to WooCommerce again from the csv file

Once you have made your desired changes to your product csv file, you can keep it as the same file name or change its filename. In order to re-import the updated product file, at the backend of your site, go to Products → All Products → Import. You will get an Import Products interface like the one shown in Figure 15:

Woocommerce products, import products page to enable upload of csv file to import products
Figure 15: Woocommerce products, import products page to enable upload of csv file to import products

Because I have SKUs for each of the product variations I wish to preserve, when I upload the product csv file, I tick the box which says ‘update existing products’.

2.3 Column mapping on import

When you press ‘Continue (Figure 15 above), you will get something similar to Figure 16:

importing woocommerce product csv mapping of import columns options
Figure 16: Importing WooCommerce product csv: mapping of import columns options

I kept all the default ‘Map to field’ settings the same in Figure 16. I click the pink ‘Run the importer’ button at the bottom of that page (not shown) and then you get a message like the one in Figure 17:

message that the import of woocommerce products csv is complete
Figure 17: message that the import of WooCommerce products csv is complete

Sign up to Printify* for free

The Printify Print on Demand platform is completely free to join and integrate into your WooCommerce and WordPress site. By joining Printify * via this affiliate link (denoted by ‘*’) we receive a small commission on the product orders your customers make, which are fulfilled through Printify. This comes at no extra cost to you, and funds more technical articles like this.

Then go view a variable product by going to Products, then choosing a variable product, it looks like this:

3. Checking New Product Attributes

There are a couple of ways to check whether global product attributes have been set correctly for the imported t-shirt, covered in 3.1 and 3.2 below.

3.1 Checking WooCommerce Product Global Attributes following product spreadsheet updates

Following the update of the global attributes in the product spreadsheet and their re-importation into the WordPress site, the global attributes will now be visible. The global attributes can be viewed on the backedn Dashboard by going to WooCommerce -> Products -> Attributes. The new global attributes (Colors: Black, Navy, Sport Grey, White) and Sizes (S, M, L, XL, 2XL, 3XL, 4XL, 5XL) are now shown in Figure 18:

wordpress dashboard showing woocommerce new global product attributes of colors and sizes
Figure 18: WordPress Dashboard showing WooCommerce new global Product attributes of Colors and Sizes which match the custom product attributes for the Printify example t-shirt

3.2 (Optional) test Product Global Attributes by applying product filtering on the front end

This optional step provides a test of whether the new global product attributes created have been assigned correctly to the variable product imported to Printify*. This step also provides one application of global product attributes (see section 4 for more details). On the front end of the WordPress online shop, you can filter by product attribute, and if we have set the Printify t-shirt product attributes correctly, only it and not the simple products should be shown as filtered output, as those example simple products have no size attribute assigned to them:

Wordpress and Woocommerce front end product filter filtering by product sizes and using global size attribute - filters everything except Printify variable product
Figure 19: WordPress and Woocommerce front end product filter filtering by product sizes and using global size attribute – filters everything except Printify variable product

Sign up to Printify* for free

The Printify Print on Demand Platform is completely free to join and integrate into your WooCommerce and WordPress site. By joining Printify * via this affiliate link (denoted by ‘*’) we receive a small commission on the product orders your customers make, which are fulfilled through Printify. This comes at no extra cost to you, and funds more technical articles like this.

4. Why do you need Global Product Attributes?

In order for you to apply product filters based on product attribute, such as size (S, M, L, XL etc) and color (black, sport grey, navy, white) (e.g. filters in a side bar in order to search for products), and filter by attribute, the attribute filters have to be global, not custom product attributes. Therefore a bulk conversion from custom product attributes to global attributes is required.

4.1 Applying a Product Filter to find product subsets by attribute

Product filters on your online shop (such as those provided by a plugin) require global attributes if you wish to be able to filter by attribute. Examples of such product filters are:

  • Filter Everything (which can be found here)
  • WooCommerce product filter (which can be found here) – this is the filter shown in action in Figure 19

4.2 Display Product variation swatches to variable products

The product variation swatches plugin (e.g. variation swatches for WooCommerce, available here) works with global attributes, not custom product attributes. figure [16] shows the installed plugin on the WordPress dashboard:

Backend WordPress Dashboard showing 'Variation Swatches for WooCommerce' plugin
Figure 20: Backend WordPress Dashboard showing ‘Variation Swatches for WooCommerce’ plugin

The product variation swatches plugin enables the variable product attributes to appear as buttons on the front end instead of a drop-down menu, as illustrated in Figure 21.

how an imported Printify product appears on the front end of a WooCommerce site with available color and size variations as buttons not drop down menu
Figure 21: Printify* product on the front end of a WooCommerce site with available color and size variations as text buttons, not as drop down menu

The product attributes (size and color options) will automatically appear as labelled buttons automatically, using the information from product custom attributes alone; global attributes do not need to be set if you wish to display a buttons with labels on them. However, in order to display – for example, – the product attributes as color swatches, the process of converting the custom product attributes to global attributes as set out in the previous steps needs to occur.

The Product global Attributes interface is shown in Figure 22 has additional Variation Swatches options below, and when ‘Type’ is selected, the options (label, color and image) can only be set if global attributes have already been created (Colors, Sizes), as they have here:

WooCommerce product global attributes view showing Variation Swatches option at the bottom
Figure 22: WooCommerce product global attributes view showing the ‘Variation Swatches’ option at the bottom (Type and Shape)

If you click on ‘Configure terms’ (shown in top right of Figure 22 just under the attribute terms) you can, for example, set color swatches to match the the color options now set up (Figure 23). This is only possible when Variation Swatches for WooCommerce has access to global attributes.

woocommerce product global attributes - view adding color swatches via 'configure terms' link
Figure 23: WooCommerce product global attributes: configure terms page to add color swatches to the color names

Setting the global color attributes as color swatches instead of text buttons, gives Figure 24. Again, these options are possible only when we have global attributes, not just custom product attributes.

Printify product on the front end of a WooCommerce site with available colors as color swatches and size variations as text buttons
Figure 24: Printify product on the front end of a WooCommerce site with available colors as color swatches and size variations as text buttons

Sign up to Printify* for free

The Printify Print on Demand Platform is completely free to join and integrate into your WooCommerce and WordPress site. By joining Printify * via this affiliate link (denoted by ‘*’) we receive a small commission on the product orders your customers make, which are fulfilled through Printify. This comes at no extra cost to you, and funds more technical articles like this.

Conclusions

This tutorial is a guide to why you would want to change your Printify custom product attributes to global product attributes, and how to go about making this bulk change for free by manually altering WooCommerce product csv files.

References

References
1 https://woocommerce.com/document/variable-product/#add-attributes-to-use-for-variations
2, 3 https://woocommerce.com/document/product-csv-importer-exporter/
We hope you find this tutorial useful, please share it if you do!