CS 2.0 Architecture

If you’re looking to do complex customizations, you should introduce yourself with CS 2.0’s advanced MVC architecture and basic principles first.



CS 2.0’s code is structured into a Model-View-Controller (MVC) architecture, which means that the application is basically structured into three distinct layers that provide separation of presentation logic, business logic and data.



Model-view-controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model.



The three distinct layers are:



* Model - represents business entities: products, categories, orders, users, etc. - and provides means to access and manipulate object data. CS 2.0 model classes implement Active Record pattern, which allows to completely abstract the database operations.



* View - generates application output. In CS 2.0 views are simply Smarty templates.



* Controller - works as a glue between a model and a view and defines application behavior. In essence, main controller responsibilities are to read/change model state and pass model data to view for displaying.



Such architecture allows to achieve a great code separation by responsibility, which provides several additional benefits:


  • Enforces clean and organized code structure.
  • Easy to make changes - one doesn’t even need to touch business or model logic code when it’s only necessary to modify the presentation template.
  • Different methods of presentation for the same data are possible (just change the view to return data in XML, for example).
  • Possible to extend application behavior without a need to change Controller code. The Controller passes the data to View through an intermediary Response object, which can be altered before it reaches the View.

Thank you for explanation. I as a shop owner and site administrator see more importance in other layers/logics/structures - customer layer and admin layer. I have been using 1.3.5 version for about 1.5 year and used to it - I find admin part of 1.3.5 very comfortable and effective (after some modifications), I spent each day some hours with CS-Cart so this is really important to have good usability of admin part.



From usability of customer side I can not see difference of new 2.0 version with old one. Some time ago here was a discussion of Checkout procedure, I was expecting that developers would take it into account but “one-page checkout” is still the same.



I did not play much with new 2.0 version but it is quite disappointing

Hi Sno,



Thanks for the description - and that follows what I see in the code. In terms of development trajectories - are we likely to have a release candidate by the end of January? Reason being I have to do a number of customizations to our copy (front and back) and while I have been gearing up to do it in 1.3.5 I don’t want to have to do it all over again two weeks later…



Is there any consistency between function names or calls between the two versions? I am just trying to figure out if it would be worth it to chisel the wheel twice.



~J

Hi Jacob, from what I understand their is nothing compatible at all from 1.3.5 to 2.0, their will be a database upgrade from 1.3.5 to 2.0 and that’s it, their should be a beta 2 release sometime soon, then after that 2.0 should be stable enough to be released, I would say wait, but in the mean time become familier with where / what templates you need to edit ect…

Hi Snow,



Any news about possible speed enhancements, maybe in conjuction with better caching?

They have upgraded to the latest smarty and also have rewritten some of it to help speed up their cart. I dont have specifics at to what parts they rewrote, but was told that speed tests showed 2.0 was faster than 1.3.5.



Not sure about any caching improvements.

I’m so glad I did not sell my license. Since I bought it in 2007, I still have access to use all upcoming versions right? Where I can find all the new features in 2.0?

[quote name=‘mobileguy’]I’m so glad I did not sell my license. Since I bought it in 2007, I still have access to use all upcoming versions right? Where I can find all the new features in 2.0?[/QUOTE]

Why would you ever consider selling such a wonderful cart? Are you mad?

[quote name=‘mobileguy’]I’m so glad I did not sell my license. Since I bought it in 2007, I still have access to use all upcoming versions right? Where I can find all the new features in 2.0?[/QUOTE]

A few features are listed here:

[url]https://www.cs-cart.com/news.html#toc5[/url]



and you can test drive the beta demo here:

http://beta.cs-cart.com

[quote name=‘snorocket’]A few features are listed here:

[url]https://www.cs-cart.com/news.html#toc5[/url]



and you can test drive the beta demo here:

http://beta.cs-cart.com[/QUOTE]

Hi Snorocket, could you please explain a bit about the Quote Manager? Currently I am thinking of getting certain quoting services like inquiry first and then after verifed to pay.



Thank you.

Hi Joe, with the quote manager you can create, edit quotes for customers, once the quote is approved or accepted by the customer the quote is turned into an invoice which can be paid online through your cs-cart store…

[quote name=‘snorocket’]with the quote manager you can create, edit quotes for customers, once the quote is approved or accepted by the customer the quote is turned into an invoice which can be paid online through your cs-cart store…[/QUOTE]



Well that’s going to be handy for custom orders! Looking forward to the stable release :smiley: .