Recently, I got assigned to build an interesting Magento Enterprise extension. The requirement was to allow certain groups of customers to create their own store in the Magento front-end. The customers will have a site which is ready to sell selected products from the catalog provider when they complete this setup wizard. The initial launch of the website will have a home and an about page as well as catalog pages. These pages will be tailored based on the customer’s input. A Magento admin account with limited permission will also be created to let customer do any further customization such as adding/modifying a page, adding/removing products etc.
I started my prototyping session with a Magento sandbox environment, a pen and a notebook. I broke the extension down into major sections before I started prototyping. They were: the frontend wizard, logic (controllers), and modification of Magento backend & store data.
1. Drawing the wizard
Drawing the wizard helped me gather all information in a format that I familiar with. It’s basically a visual notepad. The first step is the store creating page. The customers will enter the store information, administration information, payment account information etc. A new store will be created when the customer submits this because other steps will requires a store ID to function. The second step is the about page. The customer will enter more detailed information, such as bios, store contact info, store hours etc. From this, an “about us” CMS will be created when this step is completed. The third step is product selection. Customers will select what products will be sold on their store. The list of products is provided by the main product distributor, who is the owner of the website. When the customer submits this third step, a final confirmation page will ask the customer whether to publish their store now or continue to customize their store in the backend.
I started to tackle the controller logic, once I was done with the drawing. The controllers logic is the area where I spent most of my time. There is always new material to learn as Magento is such a beast. I replicated the flow of creating a store with Magento code in the sandbox:
1. Set up a new website & store
2. Added an admin account
3. Created a role and assigned permissions
4. Assigned the role to the admin account
5. Created a new CMS page for the new store
That’s it! A new store as well as a new admin with proper permission are created. However, the store is not reachable because there is still store data missing. This part was functional by the end of the afternoon. I felt the progress was alright since I was also working on some other bugfixes.
That’s it for now. There will be more to show when I reach the beta stage!
To be continued…