X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Architecting for Easy Upgrades - Best Practices (https://forum.x-cart.com/showthread.php?t=67963)

abarker 10-17-2013 10:59 AM

Architecting for Easy Upgrades - Best Practices
 
Are there any ideas for customizing XC so that it makes future upgrades easier?
What do some of you do to write quality code that that simplifies the upgrade process as future XC updates/patches are applied?

I did find this link that had two comments on the topic:
-Do as much as you can in the CSS file and try to edit mostly the main templates
-Possibly comment out the template call and replace the call to your own templates in a separate dir.
http://forum.x-cart.com/showthread.php?t=24769

I thought that it would be sensible to store custom code in a subdir called \custom someplace where X-Cart knows where to look.

PhilJ 10-17-2013 01:40 PM

Re: Architecting for Easy Upgrades - Best Practices
 
IMO best practice is to create your own separate skin, instead of editing skin/common_files directly.

That includes your own version of the main stylesheet - main.css

You can track your modifications better and future patching should be easier.

Mike (totaltec) was kind enough to put a video together explaining how here.

totaltec 10-17-2013 05:37 PM

Re: Architecting for Easy Upgrades - Best Practices
 
Phil is absolutely right. In addition to keeping your skin changes in a custom skin directory, you can build any php changes into a special module for your store. Just like existing XC modules, you can write your code to only run when your module is active, and put minimal edits in the core, just hooks that call your code.

This way your custom PHP changes are contained mostly in the module directory, skin changes in your custom skin. Avoid editing the existing tables in the database if you can, instead add new tables and prefix them with something that makes them stand out.

cherie 10-19-2013 04:43 PM

Re: Architecting for Easy Upgrades - Best Practices
 
Most of your changes will be how the store looks so create a separate skin directory with nothing in it except the files you customize plus your own css/altskin.css. If you want to change a tpl, copy it from common_files into the same place in your new skin directory. Your upgrade should go smoothly but you will have to manually patch any tpl files in your custom skin directory that you copied from common_files.

Or if you want to start with a built-in skin as your starting point, such as Ideal Responsive, copy ideal_responsive to a new skin directory with your new name, adjust altskin.ini, and adjust the files as needed. When you upgrade you'll have to manually patch your skin files using the diff files from the upgrade for ideal_responsive.

If you must make a change to a php file, back it up and comment your changes so you can easily compare (diff) the files if you need to manually patch them during an upgrade.


All times are GMT -8. The time now is 03:25 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.