On a cs-cart project, I am looking for a clean way to automate the migration of the current theme in a fully automatic manner.
Migrating the theme files is easy since each theme is located in a dedicated directory. Nevertheless, some pages are created using the layouts WYSIWIG editor from the backend. This editor as a nice feature that allows to generate an XML file that describes all the layouts and can be imported back into another environment. This requires manual operation (logging into the backend, clicking the button...) and I would like to fully automate this.
So far, the only solution I was able to find is to migrate the data directly from the database, by generating a dump of the layout related-tables and importing it into the target environment. This solution seems to work but is a bit risky in my opinion.
Does cs-cart provide a command-line interface to export and import the current layouts?
I wrote a small script for this task:
if you put this code to a controller file (for example into your
/app/addons/my_changes/controllers/backend/layout_export.php
) and call this via url (in my case:/youradmin.php?dispatch=layout_export.do
), it will download the default theme's main layout structure.Please note, that I'm working with version 4.3.3. However I think this code will work any type of CS-Cart from version 4.x