<Keithblog />

Technology based ramblings in PHP, MySQL, JavaScript, CSS, HTML and more.


PHP: glob

glob($string); Return an array of pathnames matching a specific pattern. // Find all CSV files in the /home/var/imports/ directory glob(“/home/var/imports/hello-*.csv”);…


Magento Code: Check an import directory for new product CSVs and process using a Magmi profile

This script will first scan the var/import directory for all CSV files starting “import-” using the glob() function in PHP.…


Magento: What are Sage Pay Orphan Transactions?

This is a regular issue when using Sage Pay with Magento that needs a bit of explaining. Sage Pay transactions…


PHP: header

header($string); Used to send a raw HTTP header, often used for page redirects. Must be called before any other output…


PHP: str_replace

str_replace($search,$replace,$subject) All instances of $search are replaced with $replace in $subject. // Will print to screen: “Why is the sky…


Create a custom URL rewrite/redirect in Magento

You can use a custom rewrite to redirect CMS pages, or any other type of page. For example, if you change…


Magento Code: Include currency switcher in the header or footer with Foundation mark-up

It is easy to set-up multi-currencies in Magento. This code  allows you to quickly include a currency drop down or…


Magento Code: Add a drop down attribute and display it on the product page in custom HTML

Magento makes it really easy to expand the usual product attributes through the Admin Panel. While these can be added…


Magento header.phtml basic user account and basket code

Some useful shippets for including customer accound and a basic basket/cart product count in the header of Magento. This should…


Magento Issue: Unable to sort configurable product attribute drop down options

Having encountered this issue a couple of times I though it was time to make a note. This is a…


Testing YouTube embedded video responsiveness in WordPress

It turns out YouTube video uploads have come a long way since I last tried them out. This is a…


Magento product types and what to use them for

Magento comes preconfigured with a number of different product types. These range from simple bog-standard products to digital downloads and…


Anonymous Browsing

A few links to help secure your online activities private and secure. In the United Kingdom the Investigatory Powers Act…


WordPress Code: Completely disable comments using functions.php

The code below will completely disable any commenting and trackback features in WordPress. This code won’t turn off any “This…


MySQL TRUNCATE command: Quickly and easilty clear out the Magento database

This is a simple list of SQL commands which can be used to clear out various parts of the Magento…