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

Notification

Icon
Error

Matt@9BallDesign
#1 Posted : Thursday, July 12, 2007 12:19:35 PM(UTC)
Matt@9BallDesign

Rank: Member

Joined: 12/23/2003(UTC)
Posts: 909

having a little trouble figuring out the right code for cart.aspx.vb to make the thumbnail image in the Cart link to the product.


Any pointers would be greatly appreciated!!



Thanks
Matt Martell


http://www.9balldesign.com - Web, Print, Graphic


http://www.martellhardware.com/ - Decorative & Builder's Hardware

------------------------------------------------
blueacorn
#2 Posted : Friday, July 20, 2007 8:47:04 AM(UTC)
blueacorn

Rank: Member

Joined: 6/27/2007(UTC)
Posts: 63

Hey Matt, were you able to make any headway with this?

Coming from someone who is new to BV and has just started digging around the code - the asp:image web control that's being used in the cart.aspx does not have a URL property (as a link) - nor an onclick from the server-side. So a few ways off the top of my head this could be done:

Change it from an asp:image control to an asp:hyperlink control, and modify the .vb accordingly, all of the other properties and methods used on the image should also be applicable to the hyperlink control.

Or, in the .aspx page you could add an onclick event, and databind the url as a parameter, in the .vb create the onclick function to point to the URL that's being passed as a parameter.

Hope that helps! I'm going to be getting more involved here (as in on the boards) especially on the development side so I look forward to sharing ideas with everyone on here as I pursue further.
Matt@9BallDesign
#3 Posted : Friday, July 20, 2007 8:59:30 AM(UTC)
Matt@9BallDesign

Rank: Member

Joined: 12/23/2003(UTC)
Posts: 909

Thanks for the tips. It's just a little one on that maybe I'll get to it list...LOL....
Matt Martell


http://www.9balldesign.com - Web, Print, Graphic


http://www.martellhardware.com/ - Decorative & Builder's Hardware

------------------------------------------------
Cliff
#4 Posted : Friday, July 20, 2007 5:31:07 PM(UTC)
Cliff

Rank: Member

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

From what I understand, it isn't just a link back to the product page, it's actually a post-back so that you can edit the item in the cart and save the changes.

The existing link is actually implemented badly, since it's wrapping around DIVs; not a legal move in HTML. But anyway, the easiest way that I can see to do this is to just copy what's going on with the link button and turn the image into an input using ASP:ImageButton.

In Cart.aspx, find the ASP:Image:
Code:
<asp:Image ID="imgProduct" runat="server" AlternateText="" />

And replace it with this ASP:ImageButton:
Code:
<asp:ImageButton ID="imgProduct" runat="server" />


Now open Cart.aspx.vb to something like line 143, which should be this:
Code:
Dim img As System.Web.UI.WebControls.Image = CType(e.Row.FindControl("imgProduct"), System.Web.UI.WebControls.Image)

Replace that line with this:
Code:
Dim img As ImageButton = CType(e.Row.FindControl("imgProduct"), ImageButton)


Then it looks like we need to add the Command Name and Argument that the standard line item link is using, so find the following around line 150:
Code:
img.AlternateText = HttpUtility.HtmlEncode(lineItem.AssociatedProduct.ImageFileSmallAlternateText)

And paste these lines below it:
Code:
img.CommandName = "EditProduct"
img.CommandArgument = lineItem.Bvin


I'm sure there's a better way to do this (so please share if there is), but this is easy and seems to work. You also may need to restyle since it's now an input and not an img.
pbannette
#5 Posted : Saturday, July 21, 2007 6:48:54 AM(UTC)
pbannette

Rank: Member

Joined: 3/25/2006(UTC)
Posts: 111

Hello,

I suggested months ago, maybe even last year either here in the forum or directly to BVC, that like other carts that allow the options to be edited after adding to the cart, that there be a link for this.

Most carts, when clicking on the image, you go back the the product to order again. This is especially applicable when the product has options - you just can't change quantity. There should be a link by the product that says "Edit Options", or something similar.

It's not intuitive that clicking the image you can update the options.

If you change the code then if there is a product with options, you can't edit them.

My suggestion to BVC was as I stated above, a link to edit options, and clicking the image would go back to the product page.

Bob
Cliff
#6 Posted : Saturday, July 21, 2007 8:23:01 PM(UTC)
Cliff

Rank: Member

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

Yeah, I would prefer that as well.
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