I want to add possibility for clients to receive orders personally in one of our shops. I tried to find some module which gives possibility to select in which shop they want to receive order but I haven't found anything for free. Because of that I want to create new module for it. What's more I'm totally new in prestashop and I don't know where to start or how to create this module. I spend two-three days reading how to do it and these are my assumptions:
- New carrier module can be created by extending CarrierModule class.
- I read some articles / documentation about hooks.
- I have created my first carrier module by editing module attached in this article http://www.prestashop.com/blog/en/carrier_modules_functions_creation_and_configuration/.
- What I achieved is that I installed module and used hook 'BeforeCarrier' to add some layout to page after selecting my carrier.
This is how my carrier should work:
- It should be a part of carrier list so customer is able to select it.
- If carrier is not selected nothing hapens. If carrier is selected by customer then button 'Choose shop' should be shown.
- After pressing button 'Choose shop' new window should be show with addresses of our shops (instead of new window it may be placed somewhere in current page).
- Window with shop adresses will contain list of addresses with radiobuttons and button to confirm selection.
- After confirmation of selection window will be closed and address should be shown as a part of carreir.
- E-mail with confirmation will contain information in which shop customer can collect order.
- Suppose that addresses will be hardcoded in php code.
These are my questions:
- I created new carrier module so I assume it works correctly (as described here http://www.prestashop.com/blog/en/carrier_modules_functions_creation_and_configuration/).
- How to add new button 'Choose shop' near selected carrier?
- Can I use hooks to add 'Choose shop' button?
- Where should I remember choosen shop address? Has 'Carrier' class place for it?
- How to add shop address to e-mails? Should I edit layouts? Does e-mail layout contain place for it or do I need to add new 'placeholder' for it?
- How to show chosen address on admin side?
To describe my problem more detail I have created few scenario (see attachment). I will be greatful for any help.
I've posted the same question on prestashop forum.