Hello, I'm trying to make an Item Field of type Product with code first, but this code don't work.
[Group("Product")]
[Name("Product Link")]
[Product]
public string Product_Link { get; set; }
Hello, I'm trying to make an Item Field of type Product with code first, but this code don't work.
[Group("Product")]
[Name("Product Link")]
[Product]
public string Product_Link { get; set; }
Hello Kim,
Use FieldAttribute for the property:
[Group("Product")]
[Field("Product Link", typeof(Dynamicweb.Content.Items.Editors.ProductEditor))]
public string Product_Link { get; set; }
Hello Alexander, and it works, thanks
I can now pick the produkt, but the selection don't get saved:
Code:
[Group("Product (Box 1)")]
[Name("Product Link")]
[Field("Product Link", typeof(Dynamicweb.Content.Items.Editors.ProductEditor))]
public string Product_1_Link { get; set; }
Hello Kim,
What do you mean when said "but the selection don't get saved"?
Now, I checked the save scenario for my codefirst ItemType - all works well. See my demo video: http://screencast.com/t/DQCePtllBmu
I use:
- DW Version: 8.6.1.16
- CodeFirst entry named "Blog entry" and attached to this post
- Page frontend template is:
==========
<table>
<!--@LoopStart(Item.Product_Link)-->
<tr>
<td>
<!--@Ecom:Product.Link-->
</td>
<td>
<!--@Ecom:Product.Price-->
</td>
</tr>
<!--@LoopEnd(Item.Product_Link)-->
</table>
==========
Hello Alexander,
I pick a product then save and close, if I open the item again the product i just picked is gone. See video
DW 8.6.1.19
I just made a new item with a productlink and here the product get saved, so well I don't know whats wrong with the other item but let us leave it there.. I wonder why the value of the product link is savede with a prefix p_ thats not that usefull, why not just the productID ?
Hi Kim
It can have a list of products (p_*) and groups (g_*) and they can be mixed - that is why. But maybe it should render a cleaned list.
BR Nicolai
Hi Nicolai,
I can't pick groups in mine, only products
Yes, but the control it self supports both - in this case, as a product field editor for items, it only able to return products. You will also soon get a group selector for items - it is essentially the same control, but with different settings.
BR Nicolai
Hej Nicolai, I found out that I can only have 2 product link fields on a item. If I have more DW only save the last two (see attachment)
Hi Kim
Hm, not good. I've asked QA to reproduce the issue and get it fixed if this is a bug.
BR Nicolai
Hi all,
Yes, the bug is reproduced, new TFS 18897 has been created, thanks for cooperating.
BR, Oleg QA
Hello Oleg, can you make it as a hotfix?
Hello Oleg, can you make it as a hotfix?
Hi all,
Kim, the bug has just been fixed on version 861 and higher. Probably, will be released with nearest hotfix.
BR, Oleg
Hi All
The correction of #18897 Data in product fields lost when the product field quantity is more than two
has now been fixed in version 8.6.1.24
You are able to find this build in the download section:
http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx
Please contact Dynamicweb Support if you need any additional help regarding this.
Kind Regards
Dynamicweb Support
Kristian Kirkholt
You must be logged in to post in the forum