New NopCommerce Control - Prefilled Drop Down

1 2 Next
Posted: Saturday, January 15, 2011 8:47 PM Quote
I've created a new drop down control that you can use over and over (with the same items) without having to add the items to the drop down each time. It is great if you have a lot of products that need the same attribute with the same values... I'd post a demo, but it just looks like a regular drop down :)

It is available here:

http://www.nopeasy.com/contributions/NopPrefilledDropdown.zip
Posted: Tuesday, March 22, 2011 4:58 PM Quote
I've installed per your instructions. Running 1.9.  Everything works EXCEPT when I select an item from the dropdown and add the product to the cart, the product does not selection when viewing the item in the cart.  For example, say i selected the color "green", added the product to my cart, when i view the product in the cart it does not show that I selected "green"  or any color. But if I select a color of "Red" and add to cart, then it shows 2 separate products instead of one product with a quantity of 2.  So the values are passing, but not displaying.  Have you run across this problem before?  maybe something i am doing when setting up the dropdown?   Any help would be MUCH appreciated.

Thanks
Posted: Tuesday, March 22, 2011 5:59 PM Quote
The only thing that you have to do to set the dropdown up is add an attribute with a certain name and then add a setting with ProductAttribute.PrefilledDropDownList.[attribute name] - where the attribute name is the attribute you created. That is all. If the values are showing up there and you can select them, then the set up sounds like it has been done right. I don't know what could be wrong. You might want to check ProductAttributes.ascx.cs to see if the code that I put in there is correct on your site.
Posted: Wednesday, May 18, 2011 11:15 AM Quote
I am having the very same issue as Ross!

I create the attribute, create the setting "ProductAttribute.PrefilledDropDownList.Colour" and it looks fine on my product page. However when the item is added to the cart it does not pass the info selected from the dropdown.

I have only today upgraded my live store to v1.9 specifically just to use this mod, and never noticed this issue beforehand!

Is there anything you can advise?

I have a product here using your mod - Prefilled Drop Down List

And one here using the standard attribute - Standard Attribute - You can see this one works fine.

Cheers...
Posted: Wednesday, May 18, 2011 11:52 AM Quote
How did you install the prefilled drop down? Did you use the .dll files or did you add the code and re-compile the project? I have had this issue in the past when I was developing it, but I fixed that and it works just fine on this site - even showing up in the cart.

This bit of code in "public stirng SelectedAttributes" in ProductAttributes.ascx.cs is what grabs the value of the drop down and passes it to the cart page:

case AttributeControlTypeEnum.PrefilledDropdownList:
   {
      var ddlPrefilled = phAttributes.FindControl(controlId) as NopPrefilledDropDown;
      if (ddlPrefilled != null)
      {
         if (ddlPrefilled.Value != "---")
         {
            selectedAttributes = ProductAttributeHelper.AddProductAttribute(selectedAttributes, attribute, ddlPrefilled.Value);
         }
      }
   }
break;

The "ddlPrefilled.Value" is the value of the drop down... that should have something in it to pass.

I'll have to make sure when I get home that the code that I have posted is the code that I have on my site that works. I'm pretty sure it is, and it works on my site.
Posted: Wednesday, May 18, 2011 12:04 PM Quote
I just used the dlls and replaced all four and the .pdb files, as well as the ProductAttributes.ascx.cs in my Modules folder. This was just a new upgrade so all files are from default install.

I have checked in my ProductAttributes.ascx.cs and that code is there:

                        case AttributeControlTypeEnum.PrefilledDropdownList:
                            {
                                var ddlPrefilled = phAttributes.FindControl(controlId) as NopPrefilledDropDown;
                                if (ddlPrefilled != null)
                                {
                                    if (ddlPrefilled.Value != "---")
                                    {
                                        selectedAttributes = ProductAttributeHelper.AddProductAttribute(selectedAttributes, attribute, ddlPrefilled.Value);
                                    }
                                }
                            }

I have no idea what to check next!
Posted: Wednesday, May 18, 2011 12:57 PM Quote
I actually gave up on this for a while and proceeded without it.  My code is the same as you guys show and I have even traced the steps with no luck.  I decided that I had spent long enough on it and would revisit later.  I was actually getting ready to look at this again and this thread notification came through.  It would be GREAT if you determined what the cause was.  I eagerly await your response.  Many Thanks
Posted: Tuesday, May 24, 2011 2:18 PM Quote
did you guys ever figure this one out?
Thanks
Posted: Tuesday, May 24, 2011 2:21 PM Quote
ross.gibby@gmail.com wrote:
did you guys ever figure this one out?
Thanks


Give me a couple of days and I'll repost the code, just to make sure.
Posted: Tuesday, May 24, 2011 4:19 PM Quote
orders@nopeasy.com wrote:

Give me a couple of days and I'll repost the code, just to make sure.


That would be great if you could sort this out for us!

ross.gibby@gmail.com wrote:
did you guys ever figure this one out?
Thanks


If we cannot get a fix I plan on do this manually through the database. Although not as handy to do than this Prefilled dropdown mod, it would be quikcer than doing each product manually through the admin control panel I think. I have already done a couple to test and it worked fine.

Let me know if you need the steps involved.
1 2 Next