Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
HI
I have a problem with updating the product image when changing variant.
I am using parts of the starterkit, and the ecommerce.js file.
All othere properties are updating.
To get the image
var imageStr = TC.GetPropertyValue(storeId, product, "productImage"); string[] imageIds = imageStr.Split(new char[] { ',' }); int imgeidsCount = imageIds.Count();
To display the image:
@{ for (dynamic i = 0; i < imgeidsCount; i++) { string productImage = imageIds.Length > 0 ? Library.MediaById(imageIds[i]).umbracoFile : string.Empty; <a class="image-popup-vertical-fit" href="@productImage" title="@name"> <img src="/ImageGen.ashx?Width=555&Height=555&Constrain=True&Image=@productImage&[email protected]" class="productImage" alt="@name" title="@name" /> </a> } }
The form line to update
<form action="/base/TC/FormPost.aspx" method="post" class="ajaxForm"> <input name="storeId" type="hidden" value="@storeId" /> <input name="AddOrUpdateOrderLine" type="hidden" value="productIdentifier : productIdentifier, orderLineId : orderLineId, quantity : quantity, propertyKeys : propertyKeys, productImage : productImage" />
Refresh with
refreshwithtemplate="Products/Product.cshtml"
And this is allowed in the teacommerece settings.
This works fine when shoving the product.
When updating the dropdown the image wont update, all the othere parameters updates
Any hint, and thanks in advance.
René
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Update product image
HI
I have a problem with updating the product image when changing variant.
I am using parts of the starterkit, and the ecommerce.js file.
All othere properties are updating.
To get the image
To display the image:
The form line to update
Refresh with
And this is allowed in the teacommerece settings.
This works fine when shoving the product.
When updating the dropdown the image wont update, all the othere parameters updates
Any hint, and thanks in advance.
René
is working on a reply...