Developer forum

Forum » Feature requests » Multiple product categories

Multiple product categories

Mikkel Ulstrup
Reply

Hi,

The limitation of only one product category for each product, prevents us from implementing useful specifications tables for products using standard Dynamicweb.

We need something to group the fileds by, to create an overview that is not confusing (both frontend and backend).

The posisbility to apply multiple product categories to a product, would provide the necessary functionality for such an implementation.

Bonus: If a productfield could contain a list of productfields, the possibilities would be endless. This I imagine would be a somewhat difficult to implement, so I would settle for the extra product categories as a start ;)

 

Kind regards

Mikkel Ulstrup


Replies

 
Nicolai Pedersen
Reply

Hi Mikkel

The product categories are attached to a group - adding a product to more groups would give you several categories.

Using PIM would also give you the option to create fields for each product by using one or more categories marked as "Product Property". See https://doc.dynamicweb.com/documentation-9/ecommerce/product-catalog/product-groups#sideNavTitle1-6

 
Mikkel Ulstrup
Reply

Hi Nicolai,

Thank you for the quick response. I will look into the provided solution!

 

Kind regards

Mikkel Ulstrup

 
Mikkel Ulstrup
Reply

Anyway to sort the categories? 

 
Nicolai Pedersen
Reply

Think not I'm affraid. Don't know how they are sorted now...

 
Þórhallur Hálfdánarson
Þórhallur Hálfdánarson
Reply

Offering sorting of categories would be really nice.

We worked around this like this:

  1. Category names start with the order index (numeric values 10..99) and an underscore, like these
    1. 10_CPU
    2. 30_Dimensions
    3. 20_Memory
  2. In the templates (like Product detail page) we sort the loop using the Name field, and then use Regex to strip everything up until and including the underscore
@using System.Text.RegularExpressions;
[...]
@foreach (LoopItem inner in GetLoop("ProductCategories").OrderBy(o => o.GetString("Ecom:Product.Category.Name")).ToList())
[...]
<h5 class="compareTableTitle"> @Regex.Replace(@pair.Key, @"^.*_", "") </h5>
 
Best regards,
Tolli
 
Mikkel Ulstrup
Reply

Thank you for the provided workaround. - I will look into it!

Though I would rather have the sorting possibility in standard Dynamicweb! :)

 

Kind regards

Mikkel Ulstrup