How to clone my extensions

In some cases, you may need 2 or more copies of an extension you purchased. For example if you want have 2 Purchase Order extensions, one for different geozones, or something like that. 

I've coded my extensions using a more dynamic approach compared to the core or other 3rd party module. All variables referencing the extension are based off the filename itself. This makes it much easier to clone as you typically only need to change one line of the cloned file to make it work.

For shipping extensions

  1. Copy the "admin" and "catalog" folders and paste into their own new folder
  2. Go into each subfolder and rename all files to have "2" at the end of the name.
    Example:   xxx.php --> xxx2.php
    Example:   xxx.tpl --> xxx2.tpl
     
  3. Edit the admin/controller/shipping/xxxxxx2.php file
  4. Change the line at the top that looks like

                                                                                                            
      class ControllerShippingXXXXXX extends Controller {      
                                                                                                            

to include a "2" in the name:

                                                                                                            
      class ControllerShippingXXXXXX2 extends Controller {    
                                                                                                            

 

  1. Edit the admin/language/english/shipping/xxxxxx2.php file
  2. Change the line for heading_title that looks like

                                                                                                            
            
$_['heading_title']      = 'Some Shipping Mod';               
                                                                                                            

to include a "2" in the name:

                                                                                                            
          $_['heading_title']       = 'Some Shipping Mod 2'              
                                                                                                            

  1. Edit the catalog/model/shipping/xxxxxx2.php file
  2. Change the line at the top that looks like

                                                                                                            
             class ModelShippingXXXXXX extends Model {             
                                                                                                            

to include a "2" in the name:

                                                                                                            
             class ModelShippingXXXXXX2 extends Model {           
                                                                                                            

  1. ‚ÄčSave files and upload the new "admin" and "catalog" folders. Now you should see 2 copies of the extension in the admin.

 

If you want to have extensions work for different stores, you will need to use my Ext2Store module that lets you determine which extensions are active for which store

Powered By OpenCart
OpenCartGuru.com © 2017