Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using Sitecore.Commerce.XA.Feature.Catalog.MockData;
using Sitecore.Commerce.XA.Feature.Catalog.Models;
using Sitecore.Commerce.XA.Feature.Catalog.Repositories;
using Sitecore.Commerce.XA.Foundation.Catalog.Managers;
using Sitecore.Commerce.XA.Foundation.Common;
using Sitecore.Commerce.XA.Foundation.Common.Models;
using Sitecore.Commerce.XA.Foundation.Common.Search;
using Sitecore.Commerce.XA.Foundation.Connect;
using Sitecore.Commerce.XA.Foundation.Connect.Entities;
using Sitecore.Commerce.XA.Foundation.Connect.Managers;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Mvc.Presentation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Sitecore.Services.Examples.Feature.Catalog.Website.Repositories
{
public class ProductInformationRepository : Sitecore.Commerce.XA.Feature.Catalog.Repositories.ProductInformationRepository
{
public ProductInformationRepository(IModelProvider modelProvider, IStorefrontContext storefrontContext, ISiteContext siteContext, ISearchInformation searchInformation, ISearchManager searchManager, ICatalogManager catalogManager, ICatalogUrlManager catalogUrlManager)
: base(modelProvider, storefrontContext, siteContext, searchInformation, searchManager, catalogManager, catalogUrlManager)
{
}
public override CatalogItemRenderingModel GetProductInformationRenderingModel(IVisitorContext visitorContext)
{
var baseModel = this.GetProduct(visitorContext);
var extendedModel = baseModel as Models.CatalogItemRenderingModel;
Item currentCatalogItem = this.SiteContext.CurrentCatalogItem;
extendedModel.WarrantyInformation = currentCatalogItem["WarrantyInformation"];
return extendedModel;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.