• PHP
  • 2 MINUTES READ

Allowing eCommerce Customers Their Own Store Customization With Yii Framework

  • POSTED ON
  • April 13, 2015
  • POSTED BY
  • Aayan Arif
  • POSTED ON April 13, 2015
  • POSTED BY Aayan Arif

While we’re well-versed with creating customizations on any platform, anytime, anywhere for our own clients, it’s slightly less frequent that we’re asked to enable their customers themselves to customize at their leisure. This situation was different. According to our client users should have beeb able to register with our his eCommerce application, set up their

While we’re well-versed with creating customizations on any platform, anytime, anywhere for our own clients, it’s slightly less frequent that we’re asked to enable their customers themselves to customize at their leisure.

This situation was different.

According to our client users should have beeb able to register with our his eCommerce application, set up their own stores and sell furniture online to their respective customers. The chain of clients, it seemed, never ended.

In that spirit, it was especially important to our client that “customization of every store” be a possibility. In short, he was looking for a function wherein any store owner would freely update the layout and theme of his own, unique store.

As is typically the case when a different development team has already begun work on a project we’re then asked to either complete or salvage, our client’s past developer left them without providing any solution for the requirement. Eventually, our developers suggested that we utilize Yii Framework to build the application, as well as recommending several updates within the database architecture.

But why Yii?

Yii is a high-performance framework with structured, clean and maintainable code. Its ease of use is unrivaled and its layered architecture/multiple themes support would come in especially handy for this particular project.

We began by creating the theme folder inside “root/themes”, following up with the “views” folder for each respective theme. We crafted individual views for every action inside the site controller (if you wanted a different home page for one theme, you’d create an “index.php,” adding the entirety of your code within.) We then modified the unit function of our main controller. Finishing off, we wrote a database query to source each theme name from the store table and passed the theme name to our configuration variable. At this point, after refreshing our main page, the shiny new layout was loaded.

ABOUT THE AUTHOR

Aayan Arif

Content Strategist at vteams - Aayan has over 8 years of experience of working with multiple industries.

0 Comments

Leave a Reply

More Related Article
We provide tips and advice on delivering excellent customer service, engaging your customers, and building a customer-centric business.