Written from real project work since 2011 — security, performance, development and SEO.
Magento's store count is shrinking and Shopify keeps growing. Here's an honest framework for deciding whether to stay or migrate — and how to cut Magento's real costs if you stay.
SessionReaper (CVE-2025-54236, CVSS 9.1) is being mass-exploited and most stores patched late or not at all. How to check if you're vulnerable, signs you're already hacked, and a proven cleanup process.
What a carding attack is and how to stop it on a Magento 2 store using server logs and fail2ban.
Fix products showing out of stock after M1 to M2 data migration with one SQL insert into inventory_source_item.
Eight practical conversion tactics for Magento stores: simple homepage, speed, video, email capture, testimonials, upselling, live chat, A/B testing.
How to apply security patch SUPEE-10266 on Magento 1.x by uploading the patch files and executing the shell script.
SUPEE-6285 protects against customer information leaks, request forgery, XSS in wishlist and cart, path disclosure and more.
Add an extra category attribute in Magento 1 with a standalone installer script using Mage_Sales_Model_Mysql4_Setup.
Code snippet using getCrossSellProducts() to display cross-sell products on the Magento product page.
The Heartbleed OpenSSL vulnerability explained and how to patch your Magento server by upgrading OpenSSL and reissuing certificates.
A fee module that adds an additional fee or discount line to orders based on country, delivery type, payment method or subtotal.
Retrieve product collections, select attributes and apply filters with getResourceModel('catalog/product_collection').
Avoid duplicate-content issues caused by URLs resolving both with and without a trailing slash.
Snippet to fetch products of a category sorted by ordered quantity using the reports product collection.
Audit an extension's config.xml before installing: model/class/controller rewrites, event observers and cron jobs.
Ajax Add to Cart lets customers add or remove products without page reloads on any page and for every product type.
Show cart quantity and grand total anywhere using the checkout/cart helper's getSummaryCount() and getQuote()->getGrandTotal().
One-liner: Mage::getModel('newsletter/subscriber')->loadByEmail($email)->unsubscribe().
Print the store phone anywhere with Mage::getStoreConfig('general/store_information/phone').
Let your own IPs work on the site while everyone else sees maintenance mode by editing index.php.
Retrieve the child (simple) products belonging to a configurable product in Magento.
Edit sidebar.phtml to open the product compare page in a modal window.
Show a product's custom options on the category list page by loading the product and iterating getOptions().
Install a language pack into app/design and app/locale, then create a store view using that locale.
Stop Magento from including card details in order emails by editing payment/info/cc.phtml.
Add a per-item textarea in cart.phtml and item/default.phtml so customers can leave notes per product.
Set the first image as default base, small and thumbnail after imports that wrongly set the last image.
Magento doesn't allow deleting orders from admin; this SQL removes a specific order by increment_id (backup first).
Raise Magento's session lifetime for long-running admin work like large product imports.
Add a back-to-category button in view.phtml using the product's current category.
Create cart price rules in code: rule information, conditions and actions.
Add Lightbox to your theme to show larger product images with a brief description.
Use the reports/product_collection with addViewsCount() to show the most viewed products.
Fix reindexing stuck on product price with a SQL cleanup (backup your database first).
Add checkboxes and quantity fields to list.phtml so customers can add several products to the cart in one action.
Four steps to add a custom field to the new-customer registration form via register.phtml.
Move the mini-cart block into the header via checkout.xml and getChildHtml().
Change the number of products per row by editing the product_list block in catalog.xml.
Set and read custom session variables in the frontend using Mage::getSingleton('core/session').
Show all store categories with their images on the homepage via a custom phtml template and CMS block.
Steps to add a country missing from Magento's directory tables.
Stop Magento search returning loose matches (e.g. 'earrings' matching 'rings') by switching to exact match.
A free extension to bulk import and export categories: install app and skin folders, clear cache, run from admin.
Build a daily-deal feature in three parts: create the attribute, code view.phtml, update style.css.
Thanks to all members and visitors after the first month; more free plugins and themes coming.
Import large numbers of categories from a two-column CSV placed at var/import/importCategory.csv.
Six first SEO steps for a new Magento store: robots visibility, robots.txt, page titles, meta tags, XML sitemap, canonical links.
Customer collection joined with billing and shipping address attributes: street, postcode, city, phone, region, country.
Format dates per locale with Mage::app()->getLocale()->getDateFormat() and date()->toString().
addError, addWarning, addNotice and addSuccess session messages and how to display them.
Add the Google +1 button to product pages to bring social recommendations to search.
Create layeredview.phtml and show layered navigation filters on the product page.
Add a paged product list to the homepage with Update Layout XML in the CMS page — no code files needed.
Create productbrand.phtml listing brand attribute values as links in the sidebar.
Create customer accounts programmatically with the customer model.
Rename the /admin frontName in app/etc/local.xml to harden your backend against attacks.
Reports collection with addOrderedQty() filtered by the current category, ordered by quantity sold.
Fetch the quote's grand total and format it with the checkout helper.
Remove the catalog.compare.sidebar block from catalog.xml.
BCC all transactional emails to the owner by editing the core email template model (better: use a rewrite).
Check login state with customer/session then read the group ID from the session.
Build a small custom module (MageWorks_Contact) with module XML, config.xml and a notification email.
Combine the tax helper's getPrice() with the core helper's currency() for a formatted final price including tax.
Swap the main product image on hover by editing media.phtml.
Change the store's base currency from code at bootstrap.
Set up a Facebook app with API key and secret to let customers log in with Facebook.
Checklist for migrating a Magento installation between hosts: backups, database credentials in local.xml, base URLs, cache flush.
Resolve catalog price rules not applying after reindex.
Use core/resource core_read connection to run raw SQL against Magento's EAV tables.
Iterate a product's visible frontend attributes and show them per cart item in default.phtml.
What Mage::getModel() instantiates and how magic getters like getName() and getPrice() map to data keys.
Style the stock availability label by editing the product type template.
EasyCheckout converts the multi-step checkout into a single page.
Random featured products via a CMS block calling a custom homepage.phtml based on list.phtml.
Enable Gzip compression via .htaccess and switch catalog to flat tables to speed up Magento.
Loop the product collection and load each review summary to list all reviews on one page.
Render a qty dropdown limited by the product's stock quantity on the category page.
Why EAV is slow and how the flat resource option (Magento 1.5+) speeds up product data fetching.
Free extension converting layered navigation to Ajax with multi-select filters, SEO links and backend configuration.
Set the module's active flag to false in its app/etc/modules XML file.
Mage::registry('current_category')->getName().
Bootstrap Mage.php from an external script to batch-update product images and data.
Full example building and saving a simple product: SKU, attribute set, categories, prices, stock data.
Change the contact form success message shown after submission.
Enforce an image limit in the admin ProductController saveAction.
Include a template file in a CMS page via a block directive.
<img src="<?php echo $this->getSkinUrl('images/sitelogo.jpg');?>" />.
Mage::getSingleton('customer/session')->isLoggedIn().
Stop session IDs appearing in URLs (also configurable via System → Configuration → Web → Session Validation).
Echo the product ID with the catalog output helper.
number_format($_product->getFinalPrice(), 2).
Load an order and iterate getAllItems() collecting name, price, SKU, product ID and quantity.
Fetch the store's base URL from code.
Filter product collections: eq, neq, gt, lt, gteq, lteq, like, in, notnull and more.
Swap the main image when a thumbnail is clicked by editing media.phtml.
Build a nested category navigation with the catalog/category helper and getChildrenCategories().
createBlock('cms/block')->setBlockId('identifier')->toHtml().
Retrieve every address of a customer by email address.
Fetch product IDs of a category with raw SQL against catalog_category_product.