Skip to content

Instantly share code, notes, and snippets.

riconeitzel / cleanImages.php
Last active Feb 3, 2017 — forked from peterjaap/cleanImages.php
Script to clean up the images tables in a Magento installation. Removes references to non-existing images, removes duplicate images, sets correct default image and deletes orphaned images from the filesystem.
View cleanImages.php
* This script deletes duplicate images and imagerows from the database of which the images are not present in the filesystem.
* It also removes images that are exact copies of another image for the same product.
* And lastly, it looks for images that are on the filesystem but not in the database (orphaned images).
* This script can most likely be optimized but since it'll probably only be run a few times, I can't be bothered.
* Place scripts in a folder named 'scripts' (or similar) in the Magento root.
View onepage.phtml
<script type="text/javascript">
Checkout.prototype.gotoSection = Checkout.prototype.gotoSection.wrap(function(parentMethod, section, reloadProgressBlock) {
// Call parent method.
parentMethod(section, reloadProgressBlock);
var _gaq = _gaq || [];
try {
// push current checkout section to google analytics if available.