Zen Cart Logo
Forums / General Questions / class override - Can I?

class override - Can I?

Views: 763

Results 1 to 3 of 3
10 Feb 2011, 1:29 AM
#1
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

class override - Can I?

Can I override a class instead of having to modify the original? Working on /includes/classes/shipping.php

THanks

10 Feb 2011, 10:49 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,711
Plugin Contributions:
56

Re: class override - Can I?

No, you must modify the core file - there are no overrides for classes. Be sure to keep the original (as shipping.php.orig or something like that) for reference.

10 Feb 2011, 1:22 PM
#3
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: class override - Can I?

Also consider keeping a copy in a folder for your template ( /includes/classes/YOUR_TEMPLATE/shipping.php). It won't be used as an override, but you'll have a copy of your changes which won't be overwritten by an upgrade/update making it easier to duplicate.

Quick rule of thumb: If there's no classic folder, there's no override.