Child pages
  • Contributing code to PrestaShop
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Contributing code to PrestaShop

As an open source project, PrestaShop strives thanks to its community, and especially from volunteer developers who are willing to give some of their time to help resolve issues in the code.

There are several ways to approach this:

Working using Git

In order to make changes to PrestaShop's code, you first need to create a local fork of PrestaShop, or at least have your own Github repository. When your changes are done, you must send your work to the PrestaShop developers for approval. This means installing a tool to retrieve the PrestaShop code from Github, edit it at will on your machine, and send your changes back on PrestaShop's Github. If all this sounds like a foreign language, you should learn about Git and Github first. Go to the "Understand Git" section of this page.

Contributing to PrestaShop means you must first create an account on Github, and then:

  1. Go to https://github.com/PrestaShop/PrestaShop.
  2. Fork the project. If you have a fix for PrestaShop 1.5.x, you should apply this process to the PrestaShop 1.5 project.
  3. Create a branch in your fork for your changes.
  4. Change the files on your branch. Be sure to follow the the coding standards.
  5. Push your branch to your Github account.
  6. Create a pull request for your changes on the PrestaShop project. Be sure to follow the commit message norm in your pull request. If you need some help to make a pull request, read the Github help page about creating pull requests.
  7. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code.

Making changes directly in Github

Github makes it possible to edit files directly online. Here is how:

  1. Browse to the target file.
  2. Click the "Edit" button.
  3. Make your changes in the editor then click on "Propose File Change".

Github will automatically create a new fork and branch on your own Github account, then suggest to create a pull request to PrestaShop. Once the pull request is submitted, you just have to wait for a core developer to answer you.

You can also easily create a new file directly on Github:

  1. From your fork of PrestaShop, click the "+" button next to the project's name (usually, next to "PrestaShop").
  2. Once the online editor is open, type your code in the screen. Try not to forget to add the notice of license and the disclaimer in a comment section at the top of the file, just like every other files in PrestaShop do.
  3. Save your file. Do not forget to give it a name, along with a commit summary and, if needed, an extended description of what your file brings to PrestaShop. This is essential as the PrestaShop developer will use it to get the context of your file, and therefore to decide whether it should be added to PrestaShop or not.

Make sure that you are always making changes to the latest version of the original repository. This means that the "Branch" button above the list of file should read "branch: development", and not "branch: master".

The 1.6 branch is the one where all current works are pushed to.
The master branch is a snapshot of the development branch which was used to build the previous stable version of PrestaShop.
The release branch (if available) is the forthcoming stable version.
Others branches are for specific current projects, and should not be touched.

Understanding Git

You can find instructions on the Github website (more here), but the best way to go is to learn more about Git and Github:

  • No labels