Shopify’s Achilles Heel: Sub Categories (or lack there-of)

Shopify’s Achilles Heel: Sub Categories (or lack there-of)

I’m a huge fan of of the Shopify e-commerce platform – it is without a doubt the best way to quickly get a store up and running with minimal maintenance and stress.  The reasons are know and obvious but for the sake of completeness, for the are:

It’s a Hosted Platform – No need to stress about backing up, security, software updates, database performance, zero-day exploits.  The people that make your ecommerce solution are responsible for keeping it running, no excuses.

Theme Based – Like WordPress, Shopify has an expansive theme store with some great free themes (and paid ones) all of which are highly customizable,

Simplified Payments – Out of the box Shopify is ready to work with a huge number of payment gateways and processors, as well as its own offering.

Apps/Plugins – As with the themes, Shopify also has a wealth of plugins (both third party and in house) to expand the functionality.  Everything from plugins to help migrate from Magento to Shopify to Amazon Fulfilment plugins,

So Is it the perfect platform?   Unfortunately that’s a big resounding: No.

The reason?  Since day one Shopify has been missing a key component of any store (online or real) and that is sub categories and its exclusion people baffled, astonished and angry: http://ecommerce.shopify.com/c/shopify-discussion/t/tags-for-sub-categories-really-152873.

What’s interesting here is that the need for sub categories is so obvious, I can’t find a way to explain why they are needed without sounding patronizing.  Of course they are needed!

Shopify – Why Do You Hate Us?

So why hasn’t this feature been added?  Clearly the Shopify community wants and feels strongly about it and its virtually guaranteed that people have gone to competitors to get this ‘feature’.

Having written a few ecommerce stores and content management systems (CMS) from the ground-up in my time, I’m pretty familiar with the pitfalls of tiered category systems so figured I’d try and get my thoughts down.  There is absolutely no excuse for Shopify to not have overcome the following hurdles but hurdles they are:

Recursion, ecursion, cursion, ursion

So a big problem when creating a category ‘tree’ system is recursion.  The idea is that if you are building a category system than can have sub-categories, sub-sub-categories, sub-sub-sub-categories and so on, you cannot write database or code queries for every possible level – you instead use recursive code: code that calls itself until it completes a task.  For example a function to build the tree might look like this:

function buildCategoryMenu (categoryID)
  fetchAllCategoriesWhoseParentCategoryIs(categoryID)
  startLoopThroughCategories
     printCategoryName
     if this category has categories in it (children), call buildCategoryMenu (categoryID)
LoopThroughCategories
end function

As you can see, this function actually calls itself if needed (and that call can call another and so on).

The problem with recursion is that as well as being difficult to work with, it is performance intensive on the front end scripting language and requires dynamic SQL on the database side (another potential performance bottle neck).

Category Rules

The next decision to be made is do you allow products to be put in ‘parent’ categories or only in child categories?  For example if you have the following structure:

Books
– Thrillers
– Comedy
– Biographical

Do you allow products to be in the category ‘books’ or do you force them to be in a child category?  If the latter, what happens if you delete the child categories, making ‘Books’ no longer a parent category?  Or what happens to the books in ‘Thrillers’ if you add sub-categories to it such as ‘Horror’ and ‘Crime’?

Graphical Display Challenges

The final problem with infinite tiered category systems is that they can play havoc with a website’s layout.  Many times in the past I’d have an email from a customer complaining that the website layout was broken in some places, only to discover that they had categories 12 layers deep in the side menu,

So What Is Shopify To Do?

If I were Shopify , I would introduce sub-categories but place a limit on the number of tiers/levels – I think three levels (categories, sub-categories and sub-sub-categories is plenty).  This allows theme designers to work within realistic limits and is not to difficult to work with.  For 99% of stores, this combined with tags and product types is more than enough.

Will they do it?  I hope so but I’m concerned that the platform has grown so big so fast that introducing it now is going to be a huge task in terms of back-end development.  That said, Shopify tend to be very good listeners so fingers crossed!

Bob McKay

About Bob McKay

Bob McKay works at Perfect Image, is a father, programmer and a self confessed techie-geek type.

Disclosure Policy

Bob on Google+

3 comments on «Shopify’s Achilles Heel: Sub Categories (or lack there-of)»

  1. Hello Bob,

    I don’t think it should be so difficult to create a multi subcategory tree in a CMS system, let me show you how I would have done it.

    There would be a single database for all categories and it will have a column with the parent catagory id and another column for the category level.

    I think this should be fairly simple to put together and I just can’t figure out why Shopify hasn’t done this yet.

    1. Bob McKay says:

      Yep agreed – this is incredibly simple and I’ve done it many times over the years (in ASP and PHP), the only difficulty is rendering a menu system from it because you never know the depth so you have to use a recursive function but if you limit the category depth to – for example – 3 levels, its easy peasy!

  2. Even depth shouldn’t be so complicated the way to it should be fairly simple – create a column called category-level the initial value is set to 0 and when you add the category to a parent category it should increase the category-level value by one – simple enough!

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.