Friday, October 4, 2024 10:53:45 AM
public class FeedManagerPlugin
{
public virtual string ReadAttributeValue(Product product, ProductAttributeCombination productAttributeCombination, string feedColumnName, string typeFeed)
{
string url = GetProductUrl(product);
if (productAttributeCombination != null)
{
url += "?sku=" + productAttributeCombination.Sku;
}
return url;
}
private IUrlHelperFactory _urlHelper
{
get
{
return EngineContext.Current.Resolve<IUrlHelperFactory>();
}
}
private IActionContextAccessor _actionContextAccessor
{
get
{
return EngineContext.Current.Resolve<IActionContextAccessor>();
}
}
private string GetProductUrl(Product product)
{
return _urlHelper.GetUrlHelper(_actionContextAccessor.ActionContext).RouteUrl(nameof(Product), new { SeName = product.GetSeName() }, "https");
}
}