The code that accomplishes this at runtime (this is for more clarity):
ascx -
<%=String.Format("{0}:{1}",GetCustomProductData(item,"VariantName","/Shop/%"),GetCustomProductData(item,"VariantValue","/Shop/%"))%></p>
code behind -
protected static object GetCustomProductData(ShoppingCartItemInfo item, String propertyName, string propertyPath, string documentType = "CMS.Product")
{
//get the product document
var d =
TreeHelper.SelectNodes(propertyPath, false, documentType, "", "", -1, true)
.Where(x=>x.NodeSKUID == item.SKUID)
.FirstOrDefault();
if (d != null)
{
return d.GetValue(propertyName);
}
else
return null;
}