Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Architecting for Easy Upgrades - Best Practices

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-17-2013, 10:59 AM
 
abarker abarker is offline
 

Newbie
  
Join Date: Apr 2005
Location: Canton, OH
Posts: 6
 

Default 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.
__________________
-SysAdmin
Reply With Quote
  #2  
Old 10-17-2013, 01:40 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default 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.
__________________
xcartmods.co.uk
Reply With Quote

The following user thanks PhilJ for this useful post:
totaltec (10-17-2013)
  #3  
Old 10-17-2013, 05:37 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
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.
Reply With Quote
  #4  
Old 10-19-2013, 04:43 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default 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.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:46 AM.

   

 
X-Cart forums © 2001-2020