I want to Hide a specific checkout attribute in case of a particular vendor's product in cart during the checkout.
Please help where I need to change for this functionality.
@if (Model.IsEditable)
{
var dataChackoutAttributes = new ViewDataDictionary();
var productService = EngineContext.Current.Resolve<IProductService>();
if (Model.Items.Select(item => productService.GetProductById(item.ProductId)).Any(product => product.VendorId == 1))
{
dataChackoutAttributes.Add("hideMyAttrbute", true);
}
@Html.Partial("_CheckoutAttributes", Model.CheckoutAttributes, dataChackoutAttributes)
}
if (attribute.Name.Equals("MyAttrbute") && (ViewData.ContainsKey("hideMyAttrbute") && Convert.ToBoolean(ViewData["hideMyAttrbute"])))
{
continue;
}