• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Nick Alberti
#1 Posted : Tuesday, December 5, 2006 3:33:42 PM(UTC)
Nick Alberti

Rank: Member

Joined: 9/27/2004(UTC)
Posts: 1,099

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;}
JohnRossey
#2 Posted : Tuesday, December 5, 2006 3:52:58 PM(UTC)
JohnRossey

Rank: Member

Joined: 8/28/2004(UTC)
Posts: 463

Thanks Nick, that was exactly what I am looking for
John Rossey Productions
[color=gray>Flash,][/color]
[email protected]
http://www.johnrossey.com/
http://www.toocoolwebs.com
Cliff
#3 Posted : Tuesday, December 5, 2006 4:01:58 PM(UTC)
Cliff

Rank: Member

Joined: 5/24/2004(UTC)
Posts: 4,147

Nick needs a new tagline: DocuMaster?
Nick Alberti
#4 Posted : Tuesday, December 5, 2006 4:50:23 PM(UTC)
Nick Alberti

Rank: Member

Joined: 9/27/2004(UTC)
Posts: 1,099

I couldn’t produce enough documents to be as helpful as you have been on the forums Cliff.

I’m glad this helped John!

The dynamic compilation makes implementing such code a breeze. Just copy and paste, no recompiling required. Hopefully I can find time to do more of these in the near future.
JohnRossey
#5 Posted : Thursday, December 7, 2006 7:18:48 AM(UTC)
JohnRossey

Rank: Member

Joined: 8/28/2004(UTC)
Posts: 463

I've really liked experimenting with the ability to make code changes without recompiling the whole thing, that was one thing that kept me from doing more code with BVC2004. If I wreck the store now it just takes 2 seconds to go back and try again.
With this new version little code mods like this become something designers can handle without sending clients off for a coder to do something simple like add a property to a category grid.

Good Stuff. The flexibility is amazing...

ok, now what if I want to do something like this to the product rotator module as well? same idea I assume, right?
John Rossey Productions
[color=gray>Flash,][/color]
[email protected]
http://www.johnrossey.com/
http://www.toocoolwebs.com
Nick Alberti
#6 Posted : Thursday, December 7, 2006 10:51:23 AM(UTC)
Nick Alberti

Rank: Member

Joined: 9/27/2004(UTC)
Posts: 1,099

The product rotator is a little bit different. The following will get the price on the page, but you'll have to style it properly:

Add the following to BVModules > ContentBlocks > Product Rotator > view.ascx

Code:
<asp:Label ID="listPrice" runat="server"></asp:Label>


I placed mine under

Code:
<asp:HyperLink ID="lnkProductName" runat="server" NavigateUrl=""></asp:HyperLink>


Afterwards, add the "newly added code" to view.ascx.vb:

Code:

Dim product As Catalog.Product = Catalog.InternalProduct.FindByBvin(bvin)

'Newly Added Code
Dim lp As Decimal = product.ListPrice
Me.listPrice.Text = lp.ToString("C")
'End Newly Added Code

Dim count As Integer = 1
JohnRossey
#7 Posted : Thursday, December 7, 2006 10:56:04 AM(UTC)
JohnRossey

Rank: Member

Joined: 8/28/2004(UTC)
Posts: 463

Awesome, thanks again.
John Rossey Productions
[color=gray>Flash,][/color]
[email protected]
http://www.johnrossey.com/
http://www.toocoolwebs.com
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012