Chat with us, powered by LiveChat

This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

Say hello to redesigned Cloudways, an empowering Startup Program, enhanced Staging, a new Let’s Encrypt Wildcard SSL certificate feature, and more. GET STARTED

Essential Magento Functions Cheat Sheet For 2018

Updated on  24th January

2 Min Read
Magento Cheat Sheet
Reading Time: 2 minutes

Magento is a robust ecommerce platform that is just right for projects of all complexities. Perhaps because of the all-inclusive code base, creating and editing Magento based code could become a real challenge.

To help out fellow Magento coders, I have compiled the following cheat sheet of the frequently used Magento functions, which are frequently used during Magento Developments. So in no particular order, the following list covers essential Magento functions that will help you take care of basic tasks while writing Magento code.

Get the Store URL

Get the Referer URL

Get Current Page URL

Get Magento Page URL

Get Product URL

Get Image From Skin Folder

Get Image From Skin Folder (Secure Access)

Get Checkout Page URL

Get Cart Page URL

Get Current Category

Get Category by ID

Get Product by ID

Get Product by SKU

Add CSS File in Layout Block

Add JS File in Layout Block

Remove Block From Old Parent

Add Block to New Parent

Add CMS Block in Layout Block

Insert Template File in Layout Block

Get Base URL in CMS Pages

Get Store URL in CMS Pages

Get Media URL in CMS Pages

Get Skin URL in CMS Pages

Call a Magento Block in CMS Pages

Load Cache Object

Save Item in Cache Object

Retrieve Saved Cache

Remove Saved Cache

Save Session Value

Retrieve Session Value

Check Whether Customer is Logged in


As you could probably guess by now, this list does not cover all the functions in the Magento universe. Magento is huge and no single blog post could even begin to cover all the available functions ( people have written entire books on the subject!).

I would recommend that you go through the list carefully while making notes on the usage of individual functions. The best way of improving your Magento code is to explore the core of the Magento platform ( PHP, XML, and PHTML files), to learn more about Magento functions.

Happy coding! 🙂


Share your opinion in the comment section. COMMENT NOW

Fayyaz Khattak

Fayyaz is a Magento Community Manager at Cloudways - A Managed Magento Hosting Platform. His objective is to learn & share about PHP & Magento Development in Community. Fayyaz is a food lover and enjoys driving. You can email him at

Convert visitors into buyers on your 100% faster Magento store.

Deploy your Magento stores on optimized Magento hosting servers.


Get Our Newsletter
Be the first to get the latest updates and tutorials.