Developer forum

Forum » Ecommerce - Standard features » Default group in multiple shops

Default group in multiple shops

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a situation with a solution running 2 websites with 2 shops but with the same product catalog.

For different reasons, I need to be able to set a default group for each shop.

The product would be assigned to multiple groups inside each shop but I need to have a default group for each shop as opposed to having a default group per DW instance.

Is this possible?

Thank you,
Adrian


Replies

 
Nicolai Pedersen
Reply

You cannot, and you never will. You cannot have 2 defaults as it is used for field inheritance, language inheritance etc.

Is it for URL/canonical stuff?

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

It is useful for many reasons and I believe the logical thing would be to have a default group per Shop. Especially for the purposes you have mentioned.

It's not uncommon to have multiple Websites with multiple shops in different languages using the same catalog. In fact, we pride ourselves on being able to handle these scenarios. It's only reasonable to give the admin the option to say this product's default group in my shop is GROUPX. Otherwise, the system may render as default group the first group in the list. Which might be something used for grouping purposes (like "Deal of the day").

I understand it is currently not supported and probably I won't have a workaround very soon since it will have a lot of impact on the existing functionality, but I am surprised you are not even considering it as a potential change.

Thank you,

Adrian

 

 
Nicolai Pedersen
Reply

Hi Adrian

If I have 2 groups with category field values with the same name, they cannot both inherit onto the product record. It is logically impossible. That is why only one primary group can exist.

If a product is in 2 groups, both groups using a category of "LogicSucks" and it has a field named "Awesome Information" and group one has the value in that field of "blabla" set on the group and group two has the value of "blublu" set on the group it cannot inherit both values - regardless of the groups are in different or the same shop. That is why a product cannot have 2 primarygroups.

So - why do you need it? What is the problem you want to solve? If it is the URL or canonical issue, there can be a solution. 

If you tell me your problem, I can find a solution. If you tell me what you think is the solution it is difficult to solve...

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I agree suggesting a solution is not the way to go. I apologise.

My whole problem started when we started implementing Compare functionality.
We would like to only allow comparing products from the same group, mainly because the ProductCategoryFields should be the same.

I agree that it would be stupid for a user to try and compare Laptops with Shoes but if they are in a generic category called "Spring Products" and they both have the "Compare" option, in theory, they can select both of them to compare.

What we are doing is check if the second product added to the comparison is in the same group as the first one. To do that, we need a way to get a consistent definition of the relevant Group the product is assigned to. We are using right now PrimaryOrDefault but I am afraid the logic behind this tag might not render always the right group. That's why I thought that Having a default group per shop might help with this and any other situations where you need something similar.

I have not asked to have 2 product fields with the same name from different product categories inherited on the product. For Inheritance purposes, I'd expect that only the ProductCategories assigned to the groups of the shop I am looking into should be inherited. But that's another story.

The way the Product Categories are used right now prevents this type of filtering per shop and a product seems to inherit all ProductCategories from all groups regardless of the Shop. There are definitely benefits from this approach but also downsides. So far it seems that the benefits outweigh the downsides.

I hope my explanation makes sense.

Thank you,

Adrian

 

 

You must be logged in to post in the forum