Magento is an e-commerce platform that allows you to create an online store for goods you want to sell. When you install it, Magento comes with several critical core files. These files include pages that allow product upload, pages for checkout, and an invoice file for billing. You can make custom additions to an invoice to personalise it for your company. To edit the Magento invoice, you must save a duplicate file and edit the PHP tags inside the file.
- Skill level:
- Moderately Easy
Other People Are Reading
Things you need
- PHP code book
Navigate to your Magento invoice PDF core file. You should be able to reach your Magento invoice by typing "/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php" at the end of your website domain address in the domain search bar.
Save a copy of the invoice core file, but place it in the folder ending with "/app/code/local/Mage/Sales/Model/Order/Pdf/Invoice.php". Note that the address now says "local" and not "core."
Change the PHP code of the "/app/code/local/Mage/Sales/Model/Order/Pdf/Invoice.php" file to your new specifications. If you are not very familiar with PHP code, use a code book and work very carefully to stay on track. If you find that you have accidentally deleted code that you needed, you can either delete the copied file and try again, or you can compare it to the original to try and find the deleted code.
Save your changes by navigating away from the page back into your Magento Admin screen. Changes made to PHP code are saved automatically by the system.
Open your invoice in the back office by navigating to Admin, scrolling to Configuration, scrolling to Sales, and then clicking Invoice Packing Slip and Design. Monitor the changes you have made and make certain that everything is exactly the way you want it. If more changes are needed, redirect back to the PHP file.
Tips and warnings
- Manually update your copied file from the original core file so that you do not end up using outdated code on your site.
- Magento stresses that you should not make edits to core files. Always edit a copy of the core file. This way, if something goes wrong with the invoice you edited, you will still have a core invoice to fall back on.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for