Forums / Built-in Shipping and Payment Modules / Cloning Shipping Modules

Cloning Shipping Modules

Results 1 to 3 of 3
30 Dec 2014, 20:06
#1
henry3 avatar

henry3

New Zenner

Join Date:
Feb 2010
Posts:
20
Plugin Contributions:
0

Cloning Shipping Modules

Is there a technical reason to rename the class and function names when you clone a shipping module, or because it's easier (and safer) to rename everything the same? I wasn't sure if the class and function names are local or used outside of the individual module.
30 Dec 2014, 22:45
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Cloning Shipping Modules

The renaming prevents issues ... example a clone of Flat Rate flat would use:
flat.php goes to flat2.php
flat goes to flat2
FLAT goes to FLAT2


Or something like:
flat.php goes to flatusa.php
flat goes to flatusa
FLAT goes to FLATUSA

as long as you follow case sensitive renaming you should be fine ...
01 Jan 2015, 17:24
#3
henry3 avatar

henry3

New Zenner

Join Date:
Feb 2010
Posts:
20
Plugin Contributions:
0

Re: Cloning Shipping Modules

I followed your instructions from an earlier post because I wanted to have a freeoptions module with price > x and weight < x, and only for the lower 48 states. I did see why changing both comparisons in the final check from OR to AND caused an issue. If the value fields are blank for both fields for items, it defaults to false which works fine for an OR but not an AND. Another tip, if you use an editor like UltraEdit, you can set the Preserve Case option. This allows a case insensitive search, with the replace matching the case of the found value.