Change Product Display templates from variant to product

When changing my product display templates URL from variant to product I cant reach the product page. In the product controller the variant object is null.

[HttpGet]
public ActionResult ProductWithVariants(CategoryModel categoryModel, Variant variant)
{
    var productPageModel = _productPageViewModelBuilder.Build(categoryModel, variant);
    return View(productPageModel);
}

How am I supposed to change from using the variants URL to products URL in the website?

Litium version: 7.3.1

If the URL is on the base product, you should pass a BaseProduct into the action instead. Compare with ProductWithVariantListing in the standard Accelerator.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.