Author Topic: Cloning Flat Rate Shipping Extension (or any other extension)  (Read 7760 times)

Offline yujindeviant

  • Newbie
  • *
  • Posts: 9
  • Karma: +3/-0
    • View Profile
Hi, I have been trying to figure out on how to make duplicates of any Shipping Extensions. I want to clone flat rate extension. I need a step-by-step guide on how to achieve this. I'm not able to find any clear guides on how to create this. Please, I really need help! Thank you!
« Last Edit: May 10, 2017, 01:26:06 PM by abantecart »

Offline yujindeviant

  • Newbie
  • *
  • Posts: 9
  • Karma: +3/-0
    • View Profile
Re: Cloning Flat Rate Shipping Extension
« Reply #1 on: May 10, 2017, 02:17:35 AM »
Help me, I can donate for the effort.

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Cloning Flat Rate Shipping Extension
« Reply #2 on: May 10, 2017, 01:23:54 PM »
Here are the steps:

1. Inside of extensions directory copy folder default_flat_rate_shipping (including content) and rename to something else.
I will use new_extension_clone as a name
https://github.com/abantecart/abantecart-src/tree/master/public_html/extensions/default_flat_rate_shipping

2. Inside of new directory extensions/ew_extension_clone/ you need to locate all the files and folders that are named with default_flat_rate_shipping
For example:
https://github.com/abantecart/abantecart-src/tree/master/public_html/extensions/default_flat_rate_shipping/admin/language
https://github.com/abantecart/abantecart-src/tree/master/public_html/extensions/default_flat_rate_shipping/storefront/language
https://github.com/abantecart/abantecart-src/tree/master/public_html/extensions/default_flat_rate_shipping/storefront/model/extension

Use file search tool on your OS

Rename above files/folders to new_extension_clone. For files, important to keep same file extensions (.php).

3. Inside of new directory extensions/ew_extension_clone/ you need to locate usage of string default_flat_rate_shipping in the files and replace with new_extension_clone

4. In models and controllers, you need to change class names
https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/default_flat_rate_shipping/storefront/model/extension/default_flat_rate_shipping.php

From:
class ModelExtensionDefaultFlatRateShipping extends Model {
To:
class ModelExtensionNewExtensionClone extends Model {

5. See what you need to change in configuration file:
https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/default_flat_rate_shipping/config.xml

That is all.
Now you can go to admin and install new extension.
 

PS:
Feel free to help and add extension cloning functionality to Extension Dev tools.
https://github.com/abantecart/developer_tools_extension/tree/master/v1.3beta
« Last Edit: May 10, 2017, 01:25:46 PM by abantecart »
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline yujindeviant

  • Newbie
  • *
  • Posts: 9
  • Karma: +3/-0
    • View Profile
Re: Cloning Flat Rate Shipping Extension (or any other extension)
« Reply #3 on: May 10, 2017, 10:29:00 PM »
Thank you, i will try the above steps. Thank you! Will let you know the outcome.

Offline yujindeviant

  • Newbie
  • *
  • Posts: 9
  • Karma: +3/-0
    • View Profile
Re: Cloning Flat Rate Shipping Extension (or any other extension)
« Reply #4 on: May 11, 2017, 09:18:34 AM »
Thanks! Out of all the above, what i did wrong was i missed the class. I overlooked that part. Thanks again for the great assistance. How or where do i send some donates to? Get back to me!

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5774
  • Karma: +274/-2
    • View Profile
Re: Cloning Flat Rate Shipping Extension (or any other extension)
« Reply #5 on: May 12, 2017, 01:24:43 AM »
Thanks! Out of all the above, what i did wrong was i missed the class. I overlooked that part. Thanks again for the great assistance. How or where do i send some donates to? Get back to me!


http://www.abantecart.com/contribution
contribute and help us build even better open source ecommerce

Offline yujindeviant

  • Newbie
  • *
  • Posts: 9
  • Karma: +3/-0
    • View Profile
Re: Cloning Flat Rate Shipping Extension (or any other extension)
« Reply #6 on: May 12, 2017, 02:52:07 PM »
Thanks again. Will donate some!

 

Powered by SMFPacks Social Login Mod