Developer forum

Forum » CMS - Standard features » Ecom Group Sorting does not work when having _ in groupID

Ecom Group Sorting does not work when having _ in groupID

Dennis van de Giessen
Reply

Hello,

I have a problem with sorting productgroups in the admin panel of DynamicWeb

Example:

I have the following ProductGroups:

  • SZ
    - Frost Black
    - Black
    - White

When I press the “Sort” button in the CMS the sorting window opens.

When I move the group White to the top, the sorting is not changed.

For example:

Original Sorting

- Frost Black
- Black
- White

Before save:

- White
- Frost Black
- Black

After Save:
- Frost Black
- Black
- White
 


When looking in the DynamicWeb database in the “EcomGroupRelations” table we have found something strange:

When executing a SELECT  statements on the “GroupRelationsParentID” field with the SZ GroupID as condition, 6 records are returned where we would expect only 3.


 

GroupRelationsGroupID

GroupRelationsParentID

GroupRelationsSorting

FrostBlack

Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ

0

White

Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ

1

Black

Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ

2

Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ_White

Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ

0

Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ_Black

Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ

0

Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ_FrostBlack

Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ

0

 

For some reason the GroupRelationGroupIDs: FrostBlack, White and Black where added.
It seems when saving a sorting the GroupID gets split on “_” and only the final part is saved in the “EcomGroupRelations” table?

I have checked whether groups with these ID’s (FrostBlack, White and Black) exist in the “EcomGroups” table but they were not found.

To be clear: The correct GroupID's are (Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ_White, Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ_Black, Catalogus_ClothingHelmets_ARAI_2016_OnRoad_OpenFace_SZ_FrostBlack)

Thank you for your time and effort.

Regards,

Dennis

 


Replies

 
Nicolai Høeg Pedersen
Reply
Hi Dennis
It is because of the _ in the ID - we use an external JS framework to do the sorting in UI - and that JS does not like your underscores. So when you sort, the script will do some weird things on your underscores. See http://madrobby.github.io/scriptaculous/sortable/.
 
So do not use underscores for IDs. IDs should be A-Z and 0-9 only.

 

You must be logged in to post in the forum