AbanteCart Community
AbanteCart Development => Extensions and Add-Ons => Topic started by: yujindeviant on May 10, 2017, 02:15:36 AM
-
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!
-
Help me, I can donate for the effort.
-
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
-
Thank you, i will try the above steps. Thank you! Will let you know the outcome.
-
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!
-
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
-
Thanks again. Will donate some!