Developer forum

Forum » Development » ProductParameterEditor in statistics

ProductParameterEditor in statistics


Reply

Hi.

 

I am trying to build a statistics report and I am able to use the datetime pickers just fine, but I can't seem to figure out how tu use this ProductParameterEditor. If I just use it like the datepickers, then nothing shows up:

 

private string _Vare = "PROD10160";


[Dynamicweb.Extensibility.AddInParameter("Vare"),
Dynamicweb.Extensibility.AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.ProductParameterEditor), "")]
public string Vare
{
    get { return _Vare; }
    set { _Vare = value; }
}
 

 

System.Collections.Hashtable Dynamicweb.Extensibility.Editors.IDropDownOptions.GetOptions(string Name)
{
    // Get Hashtable
    System.Collections.Hashtable htOptions = new System.Collections.Hashtable();
    switch (Name)
    {
        case "Vare":
                //Adding a static entry for testing purposes

                htOptions.Add("PROD10160", "Sansegynge");
            break;
    }
    // Return the hashtable
    return htOptions;
}
 

 

I am assuming that I can use the ProductParameterEditor as a "Product picker" of some sort. Is this a wrong assumption? Would I be better off using the generic DropDownParameterEditor instead?

 


Replies

 
Reply

For now, I've used the DropDownParameterEditor:

 

[Dynamicweb.Extensibility.AddInParameter("Vare"),
Dynamicweb.Extensibility.AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.DropDownParameterEditor), "")]
        public string Vare
        {
            get { return _Vare; }
            set { _Vare = value; }
        }
 

 

This takes a hashtable with the options in it, but since I am putting 300 products into the list, it would be nice if I could sort them by the Value in the hashtable...

 

How can I achieve this?

 
Reply

*bump*

 
Andrey Kozachuk
Reply

I have the same issue, are there any changes since 2008?

 
Vladimir
Reply
This post has been marked as an answer

Hi Andrey,

Please try to use  Dynamicweb.Extensibility.Editors.ProductSelectorParameterEditor 

instead of ProductParameterEditor

btw: what class do you extend to build a statistics report?

Best regards,

Vladimir

 

Votes for this answer: 1
 
Andrey Kozachuk
Reply

Hi Vladimir,

ProductSelectorParameterEditor  works perfectly, thanks.

I am using Dynamicweb.eCommerce.Statistics.Dynamicweb.eCommerce.Statistics as a base class.

 

You must be logged in to post in the forum