Developer forum

Forum » CMS - Standard features » Set the primary group of multiple products

Set the primary group of multiple products

Tomas Gomez
Reply

Hi,

For each product published in an Ecom group, is it needed to set its primary group in order to display it in the sitemap?

If so, is it possible to set the primary group of multiple products at once? For instance, all the products of a certain Ecom group. Our concern is due to updating bulks of 100-200 products, so it is quite prompt to errors doing it manually.

This question is related to the posts PIM - Setting Primary group and Groups in sitemap

Regards,
Tomas

 


Replies

 
Nicolai Pedersen
Reply

Hi Tomas

No, not anymore. Dynamicweb will use primary group if specified. If not, it will fall back to the first and best group of the current shop, or any other group the product is member of. Only if the product is not in a group it will be discarded.

You have to specifiy a primary page on the group. Otherwise it will not be rendered.

Also the group has to have "show in sitemap" enabled.

Also there is some information to find here: https://doc.dynamicweb.com/forum/ecommerce-standard-features/ecommerce-standard-features/how-to-use-ecommerce-page-url-provider

 
Tomas Gomez
Reply

Hi Nicolai,

We selected "Show in sitemap" and specified the Primary page as the ProductPage (that contains a ProductCatalogue and a URL provider). See attached images. As well, the parent group has this configuration.

However, the products of the group are not yet displayed in the sitemap.

Is there any other setup we must configure to show the products in the sitemap? Or a piece of code we should add to the sitemap template in order to do so.

Regards,
Tomas

productpage_showinsitemap.png urlprovider.png
 
Nicolai Pedersen
Reply

Hi Tomas

I cannot tell - it is not related to navigation. Need a link to see what you have done and look for the details.

 
Tomas Gomez
Reply

Hi,

We wrote an SQL sentence to automatically set the Primary group of all the Ecom products. The ShopID is SHOP14. The products can be located in multiple Ecom groups, but only one group has to be selected as Primary group.

Is this a correct implementation? are we missing any table or command?

UPDATE EcomGroupProductRelation
SET GroupProductRelationIsPrimary = 1
FROM (
SELECT DISTINCT prodrel.GroupProductRelationProductId , prodrel.GroupProductRelationIsPrimary , prodrel.GroupProductRelationGroupId FROM EcomGroupProductRelation prodrel
INNER JOIN EcomShopGroupRelation shoprel ON prodrel.GroupProductRelationGroupId = shoprel.ShopGroupGroupId
WHERE shoprel.ShopGroupShopId='SHOP14') AS filterTable
WHERE
    EcomGroupProductRelation.GroupProductRelationProductId = filterTable.GroupProductRelationProductId
    AND EcomGroupProductRelation.GroupProductRelationGroupId= filterTable.GroupProductRelationGroupId

 

 

You must be logged in to post in the forum