| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Architecting for Easy Upgrades - Best Practices | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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.
__________________
-SysAdmin |
|||||||
#2
|
|||||||
|
|||||||
![]() 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.
__________________
xcartmods.co.uk |
|||||||
|
#3
|
|||||||||
|
|||||||||
![]() 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#4
|
|||||||||
|
|||||||||
![]() 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. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|