Magento is a wonderful platform to kick start your ecommerce endeavors. But the worst part is its customization. As the coding of this robust platform is often found to be grueling, the ideal way would be to look out for solutions from developers across different parts of the world or from Magento community.
One such common problem confronted by Magento site developers/owners is creating an extension package file.
Today, in this tutorial, I’ll assist you in the process of creating an extension package file in Magento.
How to create an extension package file?
Step 1: Go to Magento root folder then Create new folder connect inside the var folder.
Step 2: Login to Magento admin panel.
Step 3: Navigate to System > Magento Connect > Package Extensions
Find below six vital tabs on the Create Extension Package page.
- Package info
- Release info
- Load Local Changes
In order to create the package extension file, the respective fields in the tabs have to be filled in accurately wherever necessary.
1. Package info
Name – (Required)
The name of an extension can be a combination of letters (a–z or A–Z), numbers (0–9), and the underscore character (_). Other characters are not allowed.
The name used in this field will be your extension key. It is case-sensitive as well.
Channel – (Required)
So far, only one channel is available for publishing extensions – community.
If the wrong channel is used during the packaging process, you will receive an error and will have to resubmit it.
Supported Releases – (optional)
Select the option 126.96.36.199 and later & Pre-188.8.131.52
The package will be saved in the Magento/var/connect directory.
Summary and Description – (optional)
Provide a brief summary and description about the extension. This is a required field.
Magento uses this information in the extension review process. The summary will be displayed in the Magento Connect Manager Admin.
License – (optional)
Possible licenses as stated on the Magento community website is: OSL v3.0
License URL- (optional)
Use this field to link to the license text.
It is not required, but recommended.
2. Release info
Release Version- (optional)
The release version can be any arbitrary numerical value that you want to use as the base version. This is often set to 1.0.0 or 5.0.0. To increment the release version number every time you have to update and repackage this extension. To protect against incorrect release version inputs, Magento Connect will not allow you to upload the same version twice.
Release stability can be set to Alpha, Beta, and Stable. Magento Connect users are only allowed to install stable release extension.
You can add any notes related to this release.
Here give the real name, user name, and email address of all members who contributed to this extension.
It is used to specify the dependencies of our code in regard to the php version.
If we add dependencies during the installation time Magento will check it in regard to all versions specified for it.
Enter Minimum — 5.2.0 and Maximum — 6.0.0
This is the most important section in the extension packaging process.
From drop-down select Magento Community module file, and just give the module name inside the textbox.
It will take like ./app/code/community/Module name
Magento Global Configuration – ./app/etc
Magento Core team module file – ./app/code/core
Magento Community module file – ./app/code/community
Magento Local module file – ./app/code/local
Magento User Interface (layouts, templates) – ./app/design
Magento PHP Library file – ./lib
Magento Locale language file – ./app/locale
Magento Media library – ./media
Magento Theme Skin (Images, CSS, JS) – ./skin
Magento Other web accessible file – ./
Magento PHPUnit test – ./anytests
Magento other – ./
Where “./” mean the Magento root directory.
In the Path field, we should enter the path relative to the path specified in the Target field. In the Include and Ignore fields, you can enter a regular expression which will check the path with the file name only for the rows where the Type field is set to Recursive Dir. A file to be included in the extension package must match the expression specified in the Include field. If the file matches the expression in the Ignore field, it will not be included in the extension package correspondingly.
Saving Data and Creating a Package
When all data is correctly filled in, you can click the Save Data and Create Package button to save it in the package data file (Extension Package XML data file) and instantly create an extension file (Extension Package .tgz file).
Now the extension package file is ready for your Magneto site.
6. Load Local Package
We can see the saved and created package data from the load local package tab.
I hope the tutorial was highly beneficial to everyone who read it. If you’ve any alternate coding method to resolve this issue which is simpler than this, add them via comments as it may help coders worldwide.