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.
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 WooCommerce ” here.
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.
- About this Print-on-Demand and WooCommerce Integration Series
- Prerequisites for this tutorial
- 1. Publish your product from Printify to your WordPress WooCommerce Site
- 2. Bulk amend WooCommerce global product attributes for Printify products
- 3. Checking New Product Attributes
- 4. Why do you need Global Product Attributes?
- Conclusions
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):
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):
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:
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).
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):
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):
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.
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]):
Press ‘export’ and you will get the following Export screen (Figure 9):
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/ :
- Online spreadsheet editor Google Drive / Docs
- free Apache OpenOffice
- a free calculation application in LibreOffice
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.
The Color and Size Attributes
Zooming out, both color and size attributes can be seen, and are similarly labelled in Figure 11.
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.
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).
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
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:
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:
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:
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:
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:
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:
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.
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:
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.
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.
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
↑1 | https://woocommerce.com/document/variable-product/#add-attributes-to-use-for-variations |
---|---|
↑2, ↑3 | https://woocommerce.com/document/product-csv-importer-exporter/ |