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

Notification

Icon
Error

Taylor
#1 Posted : Thursday, August 16, 2007 8:21:59 AM(UTC)
Taylor

Rank: Member

Joined: 7/15/2004(UTC)
Posts: 368

When someone first comes to a site and the Recently Viewed module is used, all that they see is the <h4> tag because no products have been viewed yet. Is there a way to "hide" that <h4> tag until products are viewed? Or maybe include that with the code that produces the product list...

I don't want to use the Recently Viewed list on the home page but on the category page would be useful. Also, if someone enters the site on the product page itself they too would get that header with no content.
CorneliuTusnea
#2 Posted : Thursday, August 16, 2007 9:21:10 AM(UTC)
CorneliuTusnea

Rank: Member

Joined: 8/17/2006(UTC)
Posts: 681

BVModules\ContentBlocks\Last Products Viewed\view.ascx.vb
LoadProductGrid:

If myProducts IsNot Nothing And myProducts.Count > 0 Then
Me.DataList1.DataSource = n
..... old code

Else
Me.FindControl("recentlyViewed").Visible = False
End If

Corneliu.
http://www.bestgames.com.au
http://www.bestchess.com.au



BV Product Links, Details and Signatures: Improve your customer experience:

http://www.acorns.com.au/projects/bv/quicklink/

Taylor
#3 Posted : Thursday, August 16, 2007 4:08:17 PM(UTC)
Taylor

Rank: Member

Joined: 7/15/2004(UTC)
Posts: 368

I can't locate that specific code

Code:
If myProducts IsNot Nothing And myProducts.Count > 0 Then
Me.DataList1.DataSource = n


when I went with what I thought it was an added your code, it didn't work. What am I missing?

Here's where I attempted to put it.

Code:

If myProducts IsNot Nothing Then
Me.DataList1.DataSource = n
Me.DataList1.DataBind()

Dim display As Integer = SettingsManager.GetIntegerSetting("LPVDisplayTypeRad").ToString

If display = 0 Then
Me.DataList1.RepeatDirection = RepeatDirection.Horizontal
Me.DataList1.RepeatColumns = SettingsManager.GetIntegerSetting("LPVGridColumnsField")
ElseIf display = 1 Then
Me.DataList1.RepeatDirection = RepeatDirection.Vertical
Me.DataList1.RepeatColumns = SettingsManager.GetIntegerSetting("LPVDisplayTypeRad")
Else
Me.DataList1.RepeatDirection = RepeatDirection.Horizontal
Me.DataList1.RepeatColumns = 3
End If

End If
CorneliuTusnea
#4 Posted : Thursday, August 16, 2007 4:47:52 PM(UTC)
CorneliuTusnea

Rank: Member

Joined: 8/17/2006(UTC)
Posts: 681

Wanita,
The code I gave you is new so your attempt is good. You miss te else bit before your new end if.
This should be the result:

If myProducts IsNot Nothing And myProducts.Count > 0 Then

Me.DataList1.DataSource = n
Me.DataList1.DataBind()

Dim display As Integer = SettingsManager.GetIntegerSetting("LPVDisplayTypeRad").ToString

If display = 0 Then
Me.DataList1.RepeatDirection = RepeatDirection.Horizontal
Me.DataList1.RepeatColumns = SettingsManager.GetIntegerSetting("LPVGridColumnsField")
ElseIf display = 1 Then
Me.DataList1.RepeatDirection = RepeatDirection.Vertical
Me.DataList1.RepeatColumns = SettingsManager.GetIntegerSetting("LPVDisplayTypeRad")
Else
Me.DataList1.RepeatDirection = RepeatDirection.Horizontal
Me.DataList1.RepeatColumns = 3
End If

Else
Me.FindControl("recentlyViewed").Visible = False
End If

Corneliu.
http://www.bestgames.com.au
http://www.bestchess.com.au



BV Product Links, Details and Signatures: Improve your customer experience:

http://www.acorns.com.au/projects/bv/quicklink/

BMFResposio
#5 Posted : Friday, August 17, 2007 8:01:37 AM(UTC)
BMFResposio

Rank: Member

Joined: 3/15/2007(UTC)
Posts: 126

To get this to work properly I would recommend adding a <div> outside of the literal like this: *See top line (<div id="RecentlyViewedTest" runat="server">)

<div id="RecentlyViewedTest" runat="server">
<asp:Literal ID="PreHtml" runat="server"></asp:Literal>
<div class="productgrid">
<div class="decoratedblock">
<div class="blockcontent">
<h4><asp:Label ID="LPVTitle" runat="server"></asp:Label></h4>
<asp:DataList ID="DataList1" runat="server" DataKeyField="bvin" RepeatLayout="Table">
<ItemTemplate>
<table>
<tr>
<td>
<a href="<%#Eval("ProductURL") %>"><img id="imagesmall" runat="server" class="lastproductsviewed"/></a>
</td>
</tr>
<tr>
<td>
<a href="<%#Eval("ProductURL") %>"><%#Eval("ProductName")%></a>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</div>
</div>
</div>
<asp:Literal ID="PostHtml" runat="server"></asp:Literal>
</div>

==============================================================
Then alter code to reference the div ID like this: * see below (Me.FindControl("RecentlyViewedTest").Visible = False)
==============================================================

If myProducts IsNot Nothing And myProducts.Count > 0 Then
Me.DataList1.DataSource = n
Me.DataList1.DataBind()

Dim display As Integer = SettingsManager.GetIntegerSetting("LPVDisplayTypeRad").ToString

If display = 0 Then
Me.DataList1.RepeatDirection = RepeatDirection.Horizontal
Me.DataList1.RepeatColumns = SettingsManager.GetIntegerSetting("LPVGridColumnsField")
ElseIf display = 1 Then
Me.DataList1.RepeatDirection = RepeatDirection.Vertical
Me.DataList1.RepeatColumns = SettingsManager.GetIntegerSetting("LPVDisplayTypeRad")
Else
Me.DataList1.RepeatDirection = RepeatDirection.Horizontal
Me.DataList1.RepeatColumns = 3
End If

Else
Me.FindControl("RecentlyViewedTest").Visible = False

End If

========================

Then everything should work fine. Obviously you can name the id anything you want. Nice catch!
Taylor
#6 Posted : Friday, August 17, 2007 8:31:19 AM(UTC)
Taylor

Rank: Member

Joined: 7/15/2004(UTC)
Posts: 368

That works beautifully! Thanks Brendon and Corneliu!

BV - would you consider adding this to SP3? That way everyone would get the fix and I don't have to keep adding it to every site I do. What Brendon added hides the <h4> tag. Without the extra code to the view.ascx, the background image was still showing up even if there was no content.
Nick Alberti
#7 Posted : Friday, August 17, 2007 9:07:17 AM(UTC)
Nick Alberti

Rank: Member

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

I will add it to the SP3 suggestion list.
Chris Dittmeier
#8 Posted : Sunday, September 30, 2007 5:03:47 PM(UTC)
Chris Dittmeier

Rank: Member

Joined: 1/3/2004(UTC)
Posts: 1,497

I noticed that if a product is deleted from the store, the Recently Viewed items still shows the product when you return to the homepage. Clicking on the link gives you a "resource not found" error. Refreshing the browser doesn't help. Starting a new session, does correct the issue.
Chris
Sirius Programming

www.siriusprogramming.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