dr.pepper Posted July 5, 2012 Share Posted July 5, 2012 Hi About customer's address, I don't see in db any field or relation to say what's is the default customer's address. How can I know what is it? I see even the id can change when the user makes changes. And about limit, is there a number of a limit for addresses can create the user? If so, can be changed? Regards. Link to comment Share on other sites More sharing options...
phrasespot Posted July 9, 2012 Share Posted July 9, 2012 About customer's address, I don't see in db any field or relation to say what's is the default customer's address. How can I know what is it? I see even the id can change when the user makes changes. No relation. PrestaShop DB was created before the relational model theory was proposed by Codd. It is FIFO so the first created address is displayed first. And about limit, is there a number of a limit for addresses can create the user? If so, can be changed? There is no limit, should there be? Link to comment Share on other sites More sharing options...
dr.pepper Posted July 10, 2012 Author Share Posted July 10, 2012 Hi, thanks for answer. I'm not know why Id from an address changes sometimes. I guess when you change an address that you used in a order before, to mantain the old address info in old orders perphaps? The problem is I need to display only the first address created in a section, I did a mysql query but so I can't get it by Id (because can change), maybe there is a method or function to get them ordered? Limit about numbers ... It's no sense but It's a client's petition ... Regards, Link to comment Share on other sites More sharing options...
phrasespot Posted July 10, 2012 Share Posted July 10, 2012 I'm not know why Id from an address changes sometimes. I guess when you change an address that you used in a order before, to mantain the old address info in old orders perphaps? Correct The problem is I need to display only the first address created in a section, I did a mysql query but so I can't get it by Id (because can change), maybe there is a method or function to get them ordered? Customer class, getAddresses method will return all addresses in the order they were added. Address class, getFirstCustomerAddressId method will return the id for the first address Re limiting number of addresses that can be added, many different ways to implement it. E.g. to limit it to one, one could make the id_customer in Address table a unique field etc. Seek professional advice Link to comment Share on other sites More sharing options...
dr.pepper Posted July 11, 2012 Author Share Posted July 11, 2012 Yes, about force to limit the number of address there would many ways, for now I count that number to display or not the 'Add a new address' button/link. The problem was really 'force' to have a 'default address', many thanks for the info. Regards, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now