Using the StarterKit Umbraco 6.1.6, and set a button to add a Donation into the OrderLine, ive set a empty Product in the back office and set it as Donation product, given it a generic property of textstring with alias donationamount
Not sure what im doing wrong here but i have the below HTML to add the value of the Donation to the OrderLine via Properties, but when i inspect the OrderLine in the Cart its not getting a value.
My code HTML below
<formmethod="post"action="/base/TC/FormPost.aspx"><inputname="AddOrUpdateOrderLine"value="productIdentifier, quantity, properties"type="hidden"/><inputname="storeId"value="1"type="hidden"/><inputname="productIdentifier"value="@donationNode.Id"type="hidden"/><inputname="quantity"value="1"type="hidden"/><inputname="returnUrl"value="/shop/cart"type="hidden"/><inputid="donationamount"type="text"/><inputid="uiBtnDonation"type="submit"class="btn"value="Add Donation to Basket"/><inputname="properties"value="donationamount"type="hidden"/></form>
i have tried putting the input box insde and outside of the from tag, and also in different places inside the form tag, also setting the from to do a ajax postback has the same result.
Then when i have a break point in my cart on this line
In your code I would just use orderLine.Properties["donationamount"] - your code use order properties - but you should get the property from the order line. GetPropertyValue is to get a property form a node in Umbraco. So that is why it doesnt work :)
Finally figured it out, i was missing the name="" attribute of all things from the custom property field! i put it down to being a long day lol
It's all working now, i created a override to incorporate the Donation amount into the Order total and Sub total and seems to work well.
On another note Anders, when Warren did a rapid MVC conversion of the starterkit last year after his training i dont suppose you have a copy of that do you i could have, i'd like to look into converting the starterkit to fully MVC, and it be nice to see where he left off and i could possibly pick up.
I can't find the MVC starter kit. Warren just did a quick implementation with no UI etc. So I think the best way is just to start a new solution and start it as MVC and then start by creating the product page, add the product to the cart etc. Sorry I can't find the template.
OrderLine Property not getting value
Hi
Using the StarterKit Umbraco 6.1.6, and set a button to add a Donation into the OrderLine, ive set a empty Product in the back office and set it as Donation product, given it a generic property of textstring with alias donationamount
Not sure what im doing wrong here but i have the below HTML to add the value of the Donation to the OrderLine via Properties, but when i inspect the OrderLine in the Cart its not getting a value.
My code HTML below
i have tried putting the input box insde and outside of the from tag, and also in different places inside the form tag, also setting the from to do a ajax postback has the same result.
Then when i have a break point in my cart on this line
The value is empty, not sure why as im sure ive followed the documention right. Any help would be greafully appreciated. Thanks.
Hi Niel
In your code I would just use orderLine.Properties["donationamount"] - your code use order properties - but you should get the property from the order line. GetPropertyValue is to get a property form a node in Umbraco. So that is why it doesnt work :)
Kind regards
Anders
Hi Anders
Finally figured it out, i was missing the name="" attribute of all things from the custom property field! i put it down to being a long day lol
It's all working now, i created a override to incorporate the Donation amount into the Order total and Sub total and seems to work well.
On another note Anders, when Warren did a rapid MVC conversion of the starterkit last year after his training i dont suppose you have a copy of that do you i could have, i'd like to look into converting the starterkit to fully MVC, and it be nice to see where he left off and i could possibly pick up.
Cheers
Neil.
Hi Neil
Glad you solved it! :)
I can't find the MVC starter kit. Warren just did a quick implementation with no UI etc. So I think the best way is just to start a new solution and start it as MVC and then start by creating the product page, add the product to the cart etc. Sorry I can't find the template.
Kind regards
Anders
Ah no worries, i'll give it a go between projects i have on at the moment :)
Cheers
Neil
is working on a reply...