Hello.
We are developing a site, where we wish to align the urls / breadcrumbs with the path to the product we are clicking from the product list.
e.g
http://site/webshop/toys/ (product list with groupid param set to toys group)
http://site/webshop/tools (product list with groupid param set to tools group)
When clicking on a product in these product list, they will always want to go to the "SHOP" navigation tag, due to this being hardcoded in the swift template.
For us, this will redirect all clicks to http://site/products/toys/toy-id etc, which we dont want
I therefore modified the productlist item_type and added a NavigationTag field, and use it in the following manner in the product-list template (see futher down page). This results in the correct links being generated e.g http://site/webshop/toys/bear-12, but clicking through just results in a blank page.
I have double checked that the Primary Details Page is set for these groups (both in the PIM and in the Ecommerce group settings), and in the product details page, I have set the Products page to the relevant products list page. So I dont understand what more I am doing wrong.
var navigationTag = "SHOP"; //Default to Shop, which is Swift default
if (Model.Item.GetString("navigationTag") != null) {
navigationTag = Model.Item.GetString("NavigationTag").ToString();
};
foreach (ProductViewModel product in productList.Products)
{
var defaultGroupId = product.PrimaryOrDefaultGroup.Id;
var selectedDetailPage = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(defaultGroupId)?.Meta.PrimaryPage ?? string.Empty;
string link = product.GetProductLink(GetPageIdByNavigationTag(navigationTag), false); //This renders correctly, but clicking it takes us to a blank page.. no product details
On an side note, I think the changes I have made here should def be included in the standard Swift template. Its a bit restrictive with only one navigationtag