I have been working on the AddTOBasketForm view in order to replace my dropdown lists with image selectors.
I have the following code which works:
@{
var product = Merchello.TypedProductContent(Model.ProductKey);
}
foreach (var opt in product.Options)
{
<br/>
@opt.Name.ToUpper();
@Html.Raw("<div class=\"container\">")
foreach (var choice1 in opt.Choices)
{
var image1 = choice1.GetPropertyValue("productImageSelector");
@Html.Raw(image1);
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
var image = umbracoHelper.Media(image1); // mediaId = the (int)ID of the media
<div class="col-md-2">
<div class="product-choice-selector">
<img src="@image.Url" onclick="javascript:selectDRP('@choice1.Key', @oindex)" data-imagezoom="true" class="img-responsive">
@choice1.Name
</div>
</div>
Although this code works it will only work on one product at a time, I have a site made up of three products and I can only get the image to show on one of them.
If i build the site it will then show on this product i view first. It will not work on any product if I am not in debug="true".
Can anyone help with this I have no idea why this is happening?
Product Option Content Types
Hi All,
I have been working on the AddTOBasketForm view in order to replace my dropdown lists with image selectors.
I have the following code which works:
}
Although this code works it will only work on one product at a time, I have a site made up of three products and I can only get the image to show on one of them.
If i build the site it will then show on this product i view first. It will not work on any product if I am not in debug="true".
Can anyone help with this I have no idea why this is happening?
*I am using the starter kit.
Thanks
David
I have found a work around that does work, but I dont like it.
Has anyone else experiences problems with getting the Product Option Content Types to show?
is working on a reply...