mothership-ec / cog-mothership-commerce

Mothership Commerce Cogule
Other
5 stars 1 forks source link

Product subcategories #242

Closed thomasjthomasj closed 9 years ago

thomasjthomasj commented 10 years ago

Mothership doesn't currently support subcategories, however, the Union site divides its products into categories and subcategories, for instance:

It would be good to be able to support subcategories as I can see this coming up in the future, but it may bring up more complications.

The Union site could potentially get away with creating top level CMS pages for Strings & Things etc. and using the bottom level categories as the product categories.

However, I think subcategories are something that future clients are probably going to want, and if we're gonna be breaking BC with this anyway, it might be a good opportunity to implement it.

joeholdcroft commented 10 years ago

I think the route of removing categorisation from the products/inventory system is an interesting one. Thoughts @jamiefreeman ? We would use the CMS to organise products on the frontend.

This would mean the following, however:

Just listing those out makes me think it's probably not the right solution.

So if we do implement product categories, we need a more intelligent way of listing them to pages in the CMS, I think. We spoke in the meeting about having kinda "magic" pages that are generated from other data and are kept in sync whenever a category is changed or whatever.

We would also, presumably, need some kind of interface for managing product categories. Alternatively we could just make the input box for category separate categories by "/", and it could be a <datalist>. Google does something similar with its product taxonomy. Examples:

Instruments / Guitars Clothing Clothing / Jackets

There's lots of ways this could become really complex and difficult to manage. I can't think of a nice elegant solution, though.

thomasjthomasj commented 10 years ago

I quite like the "/" separation idea. I do think it could get complicated, but that's largely a result of how much flexibility it offers, while still being a simple interface to understand.

However, my only issue is if someone wants something that applies to a horizontal category system, rather than a vertical one, i.e. a product being in more than one category without them existing in a hierarchy. For instance, if TMF sold a waterproof jacket, that could be under 'Waterproof' and 'Jackets'. In this case, we would need to determine some sort of hierarchy between them in order to get it to work, but there may end up being inconsistencies, especially when it comes to users categorising their own things.

I guess we could do something where instead of it determining a hierarchy, it just says 'this product is in these categories', and then let the CMS handle the hierarchy?

jamiefreeman commented 10 years ago

IF we accept that a product could be in two categories (at least from a front-end/merchandising point of view)... then in T's last example the CMS could just use whichever was the 'first' category listed for that product. We could call it 'primary' category and make it sound like a plan rather than an accident ;-)

Let's say a harmonica was in /Instruments/Harmonicas and /Gifts. If you clicked the link from a listing in /Gifts your URL could actually be /Instruments/Harmonicas/This Harmonica because that's the Primary category? How does that sound?

The alternative is dodgy - the page can't be in two places, it would look like duplicated content and might fuck with Google. Plus, I hate that kinda thing.

joeholdcroft commented 10 years ago

@thomasjthomasj hmm, multiple categories. I didn't even think about that but you're right: we will likely need to support it.

@jamiefreeman that makes sense, and I agree it shouldn't be in two places. I dunno how we'd achieve it though: the Gifts listing would have to be clever and pull in pages from other sections sometimes. These pages sort-of existing in Gifts but actually living elsewhere might cause issues with things like menus and so on.

The more I think about this the more difficult it seems. Hmm.

jamiefreeman commented 10 years ago

Aren't we just talking about tags at the end of the day?

I click an index page called 'Gifts' and lists out all products that have been tagged as a gift? The page isn't in there, it just links off to wherever the page actually resides (based on the primary category).

joeholdcroft commented 10 years ago

@jamiefreeman that would work so long as a product can't only be in gifts (i.e. it always has a primary category). Would this be the case on Union?

jamiefreeman commented 10 years ago

I think this is a general commerce-wide consideration, not just Union. I think any retailer would accept that a product is in a category so long as they can merchandise it how they wish (i.e. surface it wherever they wish in the website).

So in fact, the possibility of primary and secondary categories would be even more flexible than most people would expect.

thomasjthomasj commented 10 years ago

So to confirm, we will stick to one category hierarchy per product, i.e. in the case of waterproof jackets, users would need to determine this so it would be "Waterproof / Jackets" or vice versa, as creating multiple categories for a product will muddy up the logic and make reporting and other things unnecessarily complicated.

We will use the datalist form type on the category input to allow the category field to be flexible while still preventing spelling inconsistencies. For the moment these will be saved in the database as a regular old string so there will be a distinction between "Waterproof" and "Waterproof / Jackets". However, can make a helper that explodes these things and works out the hierarchy, and could make the loader use the LIKE keyword when loading these.

For weird categories like Gifts or for deckouts and stuff, we can use tags to allow for maximum flexibility while maintaining the solidarity provided by the primary category.

This combined with the current functionality of the CMS should allow the subcategories of products to work as needed, at least for the time being.

Does all this make sense @jamiefreeman @joeholdcroft, have I missed anything?

jamiefreeman commented 10 years ago

I think that's what we said :-)

kuiche commented 9 years ago

Seems like this is resolved