Add field to registration form?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Hi,

I would like to add some fields to the registration form on my website. I want those to be attached to the member, and I would like to have them in the registration process. The fields I want to add are "Make", "Model", "Serial Number".

Anyone willing to help? thanks...
13 years ago
Hello, I must also add the fields in the registration form as the tax code and VAT. The fields should be mandatory. How can I do?.
Thanks for your help
13 years ago
Adding a new field to an entity in nopCommerce

1. Add the property to your entity class in Nop.Common (e.g. Customer.cs)
2. Add the property to your DB Entity class in Nop.DataAccess (e.g. DBCustomer.cs)
3. Update the DBMapping function in your EntityManager to map the new fields from data entity to business objects (e.g. CustomerManager)
4. Update your insert and update methods in DBEntityProvider (e.g. DBCustomerProvider) to include the new parameter.
5. Update your insert and update methods in EntityManager to include a parameter for your new field (e.g. CustomerManager) and pass this to your updated DBEntityProvider methods
6. Update insert and update methods in Sql provider (e.g. SqlCustomerProvider) to accept new parameter (and pass to stored proc)
7. Update GetEntityFromReader methods in Sql provider to map new field from database.
8. Modify EntityInsert and EntityUpdate stored procs to accept new parameter (select procs should be okay since most of them are select *)

Think that's it.

Admittedly I have to agree with those in favour of using ORM technologies, in that the above process is a bit long winded to add one field. However I have done a lot of work with the nopCommerce architecture recently that make extending the nopCommerce providers much easier. With the changes I plan to implement it would only be necessary to update the Business/DB entity objects with the new field, the business insert/update methods with the new parameter and the business/sql mappings.
13 years ago
Hello,
sorry if i reup an old post, but i want to renew the question. I simply don't find the files and classes you kindly mentioned, perhaps something changed in the structure?

Sorry if my english isn't clair

regards
13 years ago
Hi, any updates on this topic?
12 years ago
Does this work with nop 1.9?

Also, in your instructions, you do not mention adding the fields to the SQL Server database Table.
12 years ago
Hi all,

I want to add a new fill in the registration. A field like interest. I want to populate the values from Nop_Category in a Listbox.

I change the dll of Nop.BusinessLogic.dll. I add a new function in the class CategoryService.

Here the code

  public List<Category> GetAllCategoriesForRegistration()
        {
            string key = string.Format(CATEGORIES_ALL_KEY);
            object obj2 = _cacheManager.Get(key);
            if (obj2 != null)
            {
                return (List<Category>)obj2;
            }


            var query = from c in _context.Categories
                        orderby c.DisplayOrder, c.Name
                        select c;
          
            var unsortedCategories = query.ToList();

            //sort categories
            //TODO sort categories on database layer
            var sortedCategories = unsortedCategories.SortCategoriesForTree(0);

            return sortedCategories;
        }

I also add the constant CATEGORIES_ALL_KEY which query all the category.

On the registration form i added also a function

protected void FillInterestListBox()
        {
            var lsInterest = (ListBox)CreateUserWizardStep1.ContentTemplateContainer.FindControl("lsInterest");
            lsInterest.Items.Clear();
            var categoryCollection = this.CategoryService.GetAllCategoriesForRegistration();
            foreach (var category in categoryCollection)
            {
                var ddlCategoryItem2 = new ListItem(category.Name, category.CategoryId.ToString());
                lsInterest.Items.Add(ddlCategoryItem2);
            }
        }

I also add the library NopSolutions.NopCommerce.BusinessLogic.Categories;

But when i try to populate the value in a listbox on the registration form, the listbox is blank.

I'm using the 1.90 version. Can someone help me plz.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.