Does anyone know how to access the generic attributes (i.e. those stored in the dbo.GenericAttribute table)?
For example I'd like to get hold of the current user's gender in one of my views. Is there a helper function/service for this?
I've tried something along the lines of...
var customer = WorkContext.CurrentCustomer; var model = new CustomerInfoModel(); CustomerController.PrepareCustomerInfoModel(model, customer, false);
if (model.Gender == "M") { // do stuff }
but the PrepareCustomerInfoModel is a protected member function and so not accessible in this way (and creating a CustomerController object isn't possible in this way).
Just in case you're interested, I've been using this to change the css based on user attributes (Head.cshtml grabs a different css file) e.g. if the user is male then the page is presented slightly differently. This will hopefully turn into a cool little feature where users can customise their views via their account settings (a bit like the theme selection option but more lightweight).
Something similar, but as I'm "new" to nop I'm at the bottom of the learning curve. So please forgive my ignorance.
I would like to add additional customer preferences such as preferred sizes. Similar to Male/Female options, I would like to add Preferred Shoe Size: then have a drop down of sizes for the customer to select. This would be saved along with the customer data (gender, Preferred Shoe size, preferred Shirt size, etc.).