Try our conversational search powered by Generative AI!

Ordering of Categories an Entry "Belongs To"

Vote:
 

Hello!

The strategy we're using is as follows: The first category an entry belongs to is the primary category (used for product breadcrumb/search), and the second category an entry belongs to will be is the brand category (used for faceting search and brand logos etc).

We manually created all the categories within EPiServer, and used the EPiServer service API to bring in some entries and assign them to categories. All good so far! When navigating to a category and "moving" a product to another category, we can confirm the intended behaviour works - the products' categories change in the correct order, e.g.

P1 belongs ot C1 and C2. If we navigate to C1 and "move" the P1 to C3, the P1 categories will be C3 and C2. As expected, all good!

However now if we create a new category (after the inital upload) and we navigate to C3, if we drag P1 into C4; the categories are now C2 and C4. This isn't ideal, as the ordering of categories is essential to our initial strategy, we'd expect them to be C4 and C2.

Is this intended behaviour? Could anyone provide some info, we don't want our customer navigating through hundreds of products every change :)


Regards,

Dean

#152072
Aug 15, 2016 16:41
Vote:
 

The Node-Entry relation SortOrder handling is currently not perfect. We're reworking the SortOrder of Node-Entry relation, so it'll be easier to sort that ordering the way you like. However this change will only be available in Commerce 10.

Regards,

/Q

#152090
Aug 16, 2016 10:48
Vote:
 

I have a similar problem: I need to change the 'Belongs to' order. The first category will be the main category for a product. Is this fixed in Service API 3?

/Erik

#176370
Mar 16, 2017 22:26
Vote:
 

Hi Erik,

You could potentially a bool on the category content type "IsMainCategory" - then just take the first category with the bool value as true.

Alternatively you could use the restful api to remove all relations, then add them in the new order.

Hope this helps!

#176380
Mar 17, 2017 9:32
Vote:
 

We are working on "correcting" the relations between entry and the categories it belong to. That will be included in Commerce 11 (It was planned for Commerce 10 but did not make it, and it requires breaking changes so we can only include it in a major release)

#176381
Mar 17, 2017 9:38
Vote:
 

I tried the solution to delete the categories and then add them in the reversed order but they end up in the same order. We haven't upgraded to epi 10 yet, will this be fixed do you think?

/Erik

#176385
Mar 17, 2017 10:11
Vote:
 

There isn't a fix for what you want in epi 10 - I'd recommend adding a bool to the categories to explicitly determine which is the main one 

#176387
Mar 17, 2017 10:15
Vote:
 

I have an idea of using categories for trademark information for products. For the moment we have products in topcategory and subcategory. e.g. shirts/tshirts or shirts/sweaters. What do you think of using categories for brands e.g. brands/quicksilver or brands/jockey. In that case we could use the brands category as the main category and use that in canonical links for eample.

#176543
Mar 21, 2017 9:49
Vote:
 

I am not entirely sure what you mean with categories.

If it is a data model that inherits from NodeContent i would simply suggest that you create another one for brands.

Having a seperate data model for brands comes with many advantages for one it will enable you to find the brand from all the other nodes regardless of order (unless you link same entry to more than one brand ^^).

Having a node 'brands' to collect them in is optional, it will make it easier to administrate but will require extra work at routing if you don't want it in your urls.

#176544
Mar 21, 2017 10:43
Vote:
 

OK, thanks for the answer. I think we will do like that.

#176545
Mar 21, 2017 10:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.