Create a Product Page
Products are content items within Sitecore. Use MVC to display product details.
Complete the following prerequisites:
-
You have products in your catalog
-
You have assigned a layout and some controls to the products within your catalog
In the Content Editor:
-
Create a view for your products called _Products.cshtml and use it in the layout controls in Sitecore. You need a view for relationships displayed on the product page called
_ProductSummary.cshtml._Products.cshtml
_ProductSummary.cshtml
-
Create your basic view model for products.
-
The MVC action controller can use the following sections of code to retrieve info about the product.
The example shown below displays product image, name, description, price and relationships. Relationships are a field on the item, where variants would be children of the item.
Previewing a product from within the Sitecore content editor displays a page with details about that product.