I'm new to Magento so please fo开发者_开发技巧rgive me if my question isn't really clear - I can refine it in response to comments if required.
Magento has two types of customer address out-of-the-box: billing addresses and shipping addresses. I need to customise it so that there is a third type of address - I'll call this address type a "Return Address" for lack of a better term. I think it needs to be a first-class address - it needs to be treated in the same way as the other default address types.
What are the steps I need to perform to make this work?
I imagine I need to do at least some of the following actions:
- Add an installer file with (at least one) $setup->insert(...);
- Override part of the admin to display the new address type.
- Override the Customer model object to include new getDefaultReturnAddress() and a couple of other methods.
I'm need either a semi-detailed explanation of the process or a link to a good resource describing the process. Unfortunately, the documentation for Magento is lacking and I haven't been able to find anything which points me in the right direction with this so far.
Thanks in advance for any help provided!
I didn't figure out a way to do exactly what I wanted but I did find a solution to this that worked for me. It involves using the Pol AttributeManager extension which you can download here: http://www.magentocommerce.com/boards/vi/viewthread/176169/. The official one isn't up-to-date with Magento's current version and doesn't work but someone was kind enough to create an updated version! The link in the first post doesn't work but you can use the link in the fourth post.
Once you've installed the extension you need to go to System > Attributes > Customer Address Attributes in the Admin section. Unfortunately, there doesn't seem to be a way of adding a 'complex' attribute type - so I just added a field called "address_type" which I use as an key field. Once you've added this attribute you can then assign an appropriate key to use for retrieving the address.
Hope this can help someone else...
Comment here for more info if I haven't explained enough.
Cheers, Zac
精彩评论