How to Manually Add Woocommerce Attributes with Hierarchy

WooCommerce Attributes…Ah our lovely attributes…

As defined by their makers, Woothemes people, now Automattic people, Woocommerce attribues are little pieces of data that you can add to your WooCommerce shop, then assign them to your Woocommerce products. Their role is to helps your users, let’s say your customers, easily search or refine your online shop catalog while browsing and searching for a product on your site.

Creating an attribute set is very simple: you create them just as you create a wordpress post category. Let dive deep in attributes and understand how, when nested with attributes support, they can give us some nice benefits, especially for our customers browsing our online shops!

 

The scenario

Let’s consider an online shop that list cell phones unlocking services. That store’s woocommerce products, are considered as “unlocking tools”. The store owner have created differents tools that deliver cell phone unlock codes to customers instantly online.

In fact they have servers behind handling cell phone unlocking algorithm and generating genuine factory unlock codes for each request….. Anyway, let’s focus back to our subject of the day: adding woocommerce attributes to an online woocommerce shop.

so each product or tool, support unlocking some specific cell phones models and brand; but also locked to some specific carriers.

Here are some sample tools or product characteristics needed. Thoses characteristics will be registered in WooCommerce as attributes:

  • Product name :Unlock Samsung UK
    • Supported brands : Samsung
    • supported phone models : Samsung Galaxy S4, Samsung Galaxy S5, Samsung Galaxy S6, Samsung Galaxy S6 Edge, Samsung Galaxy S7, Samsung Galaxy S7 Edge, Samsung Galaxy A5, etc, etc… Samsung phones models list have over 2 hundreds devices
    • supported country : United Kingdom
    • supported carrier : Everything Everywhere UK,Orange UK, O2 UK, Tesco Mobile UK, Virgin Mobile UK, Vodafone UK,3 Hutchison UK

After a few time analysing the need, we ended up setting up WooCommerces attributes and terms like theses to support the specific need of this shop:

  • First Attribute : Brands & Models
    • First level term wil be the brand name
      • second level terms will be the phones models available under each brand
  • Second Attribute : Countries & Carriers
    • First level term wil be the country
      • second level terms will be the GSM carriers in that country

 

Creating our Attributes

Here are the steps to create our attribtues.

  1. Head to Products > Attributes. It open with the “Add New Attribute” form being displayed.
    Fill in the form with the attributes needed, in our case Brands & Models, then click “Add Attribute” button

    How to Manually Add Woocommerce Attributes with HierarchyWhile creating you can choose attribute’s type and their sorting. Note you can give this a try and run later on, as these values are updatable after initial setup.
  2. Repeat that step to add the second attribute needed, in our case Countries & Carriers
    adding attributes to woocommerce
  3. Tha’t all for manually creating your attributes.

 

Let’s organize our attributes and terms with hierarchy support

So now that our attributes are ready to receive data, the next job is to insert data. In our case, you noticed that we created only 2 attributes…Why ?? This is because in our case, it was intersting to make use of the support of attributes hierarchy in WooCommerce.  We could have created 4 attributes like :

  • Brands
  • Models
  • Countries
  • Carriers

to hold the data of our products…..But we rather decied to do it like this:

  • Brands & Models
  • Countires & Carriers

So let fetch our input data sample back; this sample data is for the product “Unlock Samsung UK”

Sample Attributes Organisation Model

  • Supported brands : Samsung
  • supported phone models : Samsung Galaxy S4, Samsung Galaxy S5, Samsung Galaxy S6, Samsung Galaxy S6 Edge, Samsung Galaxy S7, Samsung Galaxy S7 Edge, Samsung Galaxy A5, etc, etc… Samsung phones models list have over 2 hundreds devices
  • supported country : United Kingdom
  • supported carrier : Everything Everywhere UK,Orange UK, O2 UK, Tesco Mobile UK, Virgin Mobile UK, Vodafone UK,3 Hutchison UK

So our data will be inserted like this (explianed previously, but let’s repeat this…). In fact, these attributes terms will represent brand name and models supported or compatible with each accessory or tool. So we have:

  • Attribute name: Brands & Models.
    This attribute will contains Attributes terms, that will be the real cell phones brands, and model.

    • Under this attributes we will add first level terms that will be brands : like Samsung, LG, HTC, Samsung, etc…
      With these first level attributes terms created, we have what we call “parent attributes terms”. We can now add child attribute terms below them.

      • So under each parent attributes terms, we will add phones model’s name, as child attributes terms. For example for Samsung, we will have as child attributes terms (under parent attribute term Samsung) models like: Samsung Galaxy S4, Samsung Galaxy S5,Samsung Galaxy S6, Samsung Galaxy S6 Edge, Samsung Galaxy S7, Samsung Galaxy S7 Edge, etc…..
  • Attributes name: Countries & Carriers
    This attribute will contains terms that will correspond to countries (as 1st level terms) and each coutries GSM carriers or operators will be considered as second level terms under each 1st level

    • USA
      • AT&T USA
      • T-Mobile USA
      • Metro PCS
      • Cricket USA
    • Spain
      • Orange Spain
      • Vodafone Spain
      • Movistar Spain
      • Yoigo Spain

 

Adding the attributes terms manually in WooCommerce with hierarchy

Adding new attributes terms is done from Products > Attribtues
add attributes terms1

  1. So let’s add the brand as first level attribute. (Go to Products > Attributes), then let’s click either on the attributes name, in our case Brands & Models”
    • insert the name of the attributes term you will like to have first level; in our case first brand is Samsung
      adding attributes term 1
    • Now let’s add the phone’s models as attributes terms of second level; they will be under the parent previously created Samsung.
      adding attributes term
      Note we have selected in parent field, the parent atttibute, in our case Samsung….
      The result of adding this is:
      adding attributes term 3
    • We will need to repeat this task as much as needed by the number of attributes terms we need in our shop structure….for this example, Samsung have over 200 hundred phones devices available….Try estimating how long it would take adding them like this
  2. We will have to repeat the same process to add supported Countries as well and supported carriers. If you understood the classic process, you should be able to organize your attributes data as our sample, like this:
    adding attributes term with hierarchy 4adding attributes term with hierarchy 5

 

That’s all for manually adding Woocommerce Attributes to your store…..time consuming huh?? We will show you in a next post how to do this easily and save your day!!

 

Published by James Munford

WooCommerceBulkAttributes.com Manager. This project started as a little tool to help me in my own projects and finally after several request I set it up for public usage and allow any WooCommerce user facing this issue to have a simple way to manage WooCommerce Bulk Attributes importing.

Join the Conversation

1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *