Placing Product in Multiple Categories

I am nearly positive this is not a native feature but hoping someone may have s simple hack to allow a product to be in multiple categories.

Cat A
– reference to “Special Product” as if product was in this category
Cat B
– reference to “Special Product” as if product was in this category
Cat C
– reference to “Special Product” as if product was in this category

Cat D “hidden from menu”
– Special Product (Actual product)

I can think of some ways to hack things myself with a custom plugin and URL overrides but thought I would see what is out there first.

For future reference is this something that “Commerce” has as a feature?

Hey @aesmith,

You can try using symlinks but my limited tests with that gave mixed results. Perhaps an easier approach, given that it sounds like you have some kind of sale/special callout you want in all categories, would be to dynamically insert it through your template? The links would go to category D, but you could make sure it shows up where needed.

Commerce will have a fairly simple catalog feature with categories built in, but the best part is that you can use a simple adapter to hook it up to other ways of managing your catalog as well. So SimpleCart, MiniShop or even custom tables could be used for when you have very specific/custom needs.

Thanks for the suggestion. I had already tried that but since SC uses a custom classkey for the resource when those that are symlinks are not found with in the scCategory search.

Getting them to display along with the other items in a given category is not much of an issue. I can inject them into the list with the other items fairly well. The issue is when you then go to that injected items detail page and the URI path now represents the path the the actual container resource that you are storing the common item in and not the category the end users understand the item to be in. The goal it to keep the user in the same category and none the wiser. Also allowing for Breadcrumbs and other URI dependent logic to remain in the desired category too. I knew this was along shot but wanted to ask.

I had hoped not to but I will probably solve it with a plugin to trap the 404 on any given scCategory and check for a global product with the same alias and forward.

If it is turns out to be a simple enough solution I will try to post it back here for others.