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

Notification

Icon
Error

Cliff
#1 Posted : Tuesday, October 17, 2006 2:53:09 PM(UTC)
Cliff

Rank: Member

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

I'm creating a new product page module based on the BVC5 product module for a project. I need to place the first additional image under the primary image. I've got everything set up, but not sure how to grab the ImageURL of the first additional image for the product. Any ideas?
Chris Dittmeier
#2 Posted : Tuesday, October 17, 2006 8:12:20 PM(UTC)
Chris Dittmeier

Rank: Member

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

Are you referring to the image used for the pop-up with additional images? I would look at the code for that pop-up page to see how it loads an image.
Chris
Sirius Programming

www.siriusprogramming.com
Cliff
#3 Posted : Tuesday, October 17, 2006 8:41:25 PM(UTC)
Cliff

Rank: Member

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

Yep. OK, I screwed around with that code until I managed to get something out of it. I'm not much of a developer, so I'm sure there is a better way to do this in my situation, since I only want to show the first image. This does seem to work, though:
Code:
Try
Dim images As Collection(Of Catalog.ProductImage) = Catalog.ProductImage.FindByProductId(LocalProduct.Bvin)
If images IsNot Nothing Then
Dim i As Integer
Me.ProductSecondImage.ImageUrl = Page.ResolveUrl(Utilities.ImageHelper.GetValidImage(images(i).FileName, True))
Me.ProductSecondImage.AlternateText = images(i).Caption
Me.ProductSecondImage.ToolTip = images(i).Caption
End If
Catch ex As Exception
EventLog.LogEvent(ex)
End Try


I'd definitely be interested to know if there is a better way. This is my favorite way to learn. ;)
CodeSine
#4 Posted : Tuesday, October 17, 2006 9:57:08 PM(UTC)
CodeSine

Rank: Member

Joined: 11/18/2003(UTC)
Posts: 1,465

I don't see where you are setting the value for the variable: i ?
TIM

BVC Add-Ons and Development
Cliff
#5 Posted : Tuesday, October 17, 2006 10:36:38 PM(UTC)
Cliff

Rank: Member

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

I don't either, which is why I'm surprised it works. Not sure what to set, though.
Andy Miller
#6 Posted : Tuesday, October 17, 2006 11:17:40 PM(UTC)
Andy Miller

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 2,136

Was thanked: 1 time(s) in 1 post(s)
Integers have a default value of 0.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing
Cliff
#7 Posted : Tuesday, October 17, 2006 11:26:27 PM(UTC)
Cliff

Rank: Member

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

Guess that's why it works, heheh. :)

Would be nice to be able to say Me.LocalProduct.AdditionalImage(0), or something like that.
Cliff
#8 Posted : Friday, October 20, 2006 1:31:14 PM(UTC)
Cliff

Rank: Member

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

I'm getting a lot of the following error in the EventLog, which I think is related to my code. This usually happens when coming back to the product page from the cart, and could have to do with that stupid URL change (why are we still seeing URLs like BVModules/ProductTemplates/BVC5/Product.aspx?productid=d2c569d8-326c-4090-887b-50c74acd28f1&LineItemId=29b8dc62-839b-48ed-8744-e50b0314c935 when coming back from the cart, instead of the rewritten myproduct.aspx?LineItemId=29b8dc62-839b-48ed-8744-e50b0314c935?)

==================================
mscorlib

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index[ at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.ThrowHelper.ThrowArgumentOutOfRangeException() at System.Collections.Generic.List`1.get_Item(Int32 index) at BVModules_ProductTemplates_blacksheepstyle_Product.PopulateProductInfo(Boolean IsValidCombination) ]
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