For those who’ve been asking for this functionality, this post should hopefully get you going. I’m only going to be adding the MSRP to the Category Template “Grid”. You can use the same code and add it to other templates.
First, open BVModules > Grid > Category.aspx. Add the following “Newly Added Code”. I’ve copied the HTML above and below the newly added code so you could properly place it.
Code:
<div class="recordsku">
<a id="SkuAnchor" runat="server" href=""></a>
</div>
<%-- Newly Added Code--%>
<div class="recordmsrp">
<a id="MSRPAnchor" runat="server" href=""></a>
</div>
<%-- End Newly Added Code--%>
<div class="recordprice">
<a id="PriceAnchor" runat="server" href=""></a>
</div>
Next, add the following code to “Category.aspx.vb”:
Code:
Dim SkuAnchor As HtmlAnchor = DirectCast(e.Item.FindControl("SkuAnchor"), HtmlAnchor)
SkuAnchor.HRef = destinationLink
SkuAnchor.InnerText = p.Sku
Dim PriceAnchor As HtmlAnchor = DirectCast(e.Item.FindControl("PriceAnchor"), HtmlAnchor)
PriceAnchor.HRef = destinationLink
PriceAnchor.InnerText = p.GetSitePriceForDisplay(0D)
'Newly Added Code
Dim MSRPAnchor As HtmlAnchor = DirectCast(e.Item.FindControl("MSRPAnchor"), HtmlAnchor)
MSRPAnchor.HRef = destinationLink
MSRPAnchor.InnerText = p.ListPrice.ToString("C")
'End Newly Added Code
Again, I’ve copied the code above it so you can add it to the correct location.
That’s it. Now we just need to add the styles. Under the “styles” folder for your theme, open “category.css”. Add the following items. You can place them in anywhere though you might want to organize it like the other styles.
Code:
.recordmsrp { font-size: 110%; font-weight: normal;padding-left: 5px; margin-left: 5px; border-left: 5px solid #ccc; }
.recordmsrp a { text-decoration: line-through; }
#categorygridtemplaterecords .recordmsrp {text-align:center;border:none;margin:0;padding:0;font-size:100%;line-height:1em; text-decoration:line-through;}