Can I use the nopCommerce Login/Registration to control access to other parts of my website?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I would like to use the nopCommerce Customer login/registration page to control access to other parts of my website.  Is this possible?

I would like to be able to just use the login/registration logic within a different page on my website so that a customer can either login through the normal nopCommerce login page or my custom login page and have all the information and validatation that the nopCommerce login/registration page uses.  I want the custom login to reference and store information in the existing nopCommerce database.
12 years ago
Hello,
you have option set access to store only for registered visitors
12 years ago
This is not whqt I want to do.  I want to use the nopCommerce login to control access to other parts of my website which are outside of the nopCommerce environment.
12 years ago
This is possible if you use the same application pool for both applications i.e. website and nopCommerce. I have done this in nop 1.9. don't know yet how to do this in 2.1
12 years ago
Can you give me some information on how you were able to do this?
12 years ago
It's been a while, so can only give you hints..

1.
I copied the ..\nopcommerce\bin to \bin for all the libraries

2.
in the \web.config added the nop connection:
  <connectionStrings>
    <add name="NopSqlConnection" connectionString="Data Source=PC\SQLEXPRESS;Initial Catalog=My_Store;Integrated Security=False;Persist Security Info=False;User ID=sa;Password=***;Connect Timeout=120" />
  </connectionStrings>

3.
In the new file, in the event page_load

protected void Page_Load(object sender, EventArgs e)
        {
            NopConfig.ConnectionString = ConfigurationManager.ConnectionStrings["NopSqlConnection"].ConnectionString;
            var context = ObjectContextHelper.CurrentObjectContext;

            var addToCartWarnings = ShoppingCartManager.AddToCart(ShoppingCartTypeEnum.ShoppingCart, 70, "", 3.40M, 5);
            if (addToCartWarnings.Count == 0)
            {
                context.SaveChanges();
            }

//          GridView2.DataSource = SqlDataSource1;
//         GridView2.DataBind();
        }


hope you can use it. Can;t help you testing it. Don't have 1.8 anymore.
12 years ago
Thanks.  This will be a big help in pointing me in the right direction.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.