Specific Product Load - Pull In Additional Image

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
digdesigner
Ensign (ENS)
Ensign (ENS)
Posts: 9
Joined: Mon Jul 18, 2011 7:47 am

Specific Product Load - Pull In Additional Image

Post by digdesigner » Wed Nov 16, 2011 3:11 pm

I would like to pull in an additional image from the AbleCommerce admin, similar to the way that the "Thumbnail Image" is pulled in. There is a bit of code in the SpecificProductLoad conlib that writes out the "thumbnail" url. I notice that there are multiple values for the standard images (eg. ThumbnailUrl, IconUrl, ImageUrl), but I was wondering if there is a value or property for the additional image similar to the others.

Code: Select all

string thumbURL = this.Page.ResolveClientUrl(_Product.ThumbnailUrl);
Thank you.

User avatar
david-ebt
Captain (CAPT)
Captain (CAPT)
Posts: 253
Joined: Fri Dec 31, 2010 10:12 am

Re: Specific Product Load - Pull In Additional Image

Post by david-ebt » Wed Nov 16, 2011 4:00 pm

The additional images are in the "_Product.Images" ProductImageCollection. For each ProductImage in the ProductImageCollection there is another ImageUrl and ImageAltText.

So you could use this to determine if there are any additional images:

Code: Select all

int addImgCount = _Product.Images.Count;
If there are images, you can loop through the ProductImageCollection or just take the first one if you never have more one additional image.

Take a look at the Admin\Products\Assets\AdditionalImages.aspx control for more examples on how to access these images.
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

Post Reply