GitHub and Repositories within Repositories

I’ve recently started using GitHub – and I had the requirement to have nest repositories which I could have running in a single test/live environment that could be edited and committed independently. After looking at the various options available I am trialing a sym-links.

I have each repository stored in the root directory with the base/core repository setup to load specific domains via the vhosts file on an XAMPP installation.

Each sub-repository is then sym-linked into the parent directories within code/theme directories. This allows my system to load the code into the core base for testing and means I don’t have to move files around for changes and I can still make commits completely independently.

Yes this technique isn’t perfect but I can easily write a bash script for pulling/pushing all, multiple or single repositories as and when required.

Exporting Products from Magento – making it quicker

The phrase take only what you need springs to mind when it comes to exporting products in Magento. The lack of a check all button to ignore all field options in the export can lead to a waste of time if you only want 2 or 3 specific columns. Enter developer tools in (some/most modern browsers) Chrome and a little bit of Javascript magic.

Entering this in the console tab in the developer tools (right click and choose inspect from the menu that appears)  and all the checkboxes are checked and you can spend your time selecting which columns it is you need.

Code comes from here

Fix Form_key validation for T-Shirt Magento Template #58506

If you have purchased the T-shirt #58506 template from Template Monster you may well find it doesn’t work with FormKey validation enabled.

Here is the fix for it.

Open the following file:

And add the following code to line 217 just inside the </form> tag (they forgot to include it, or possibly didn’t update it when patch SUPEE-9767 came out):






Adding Custom CSS for Print

You may want to setup a custom css file for your magento store – for your order details as an example.

Adding the following code to your custom layout.xml file will add a custom_print.css file from the location of /skin/frontend/base/default/css/custom_print.css


Ordering a Category Collection by the Newest to Oldest

Well it sounds simple and it is – but only once you remember that there is no “id” field in the flat catalog tables. Every time you add a new category or product – it is assigned a new incremented entity_id there by ordering by the field in DESCENDING order you will always get the newest ones at the top.


Re-indexing Magento 2: Command Line

You can no longer do any re-indexing manually through Magento Dashboard – you can either do it through a cron-job or using a series of commands on the command line.

You can specify an optional reindexer name to re-index a specific index otherwise the above command will re-index all of them one after the other.

Read More Here

Magento 2 – Migration from

This is something I have been putting off for quite some time – waiting for the market place and all the 3rd part extensions to have time to optimise and debug before I started to try and replicate a fairly bespoke Magento Store.

I will be updating this post as I go along trying to help where I can with problems I had to overcome…

Deleting Duplicate Records using MySQL

I recently had a table which ended up with some duplicate records being imported. A simple way to achieve this is to use a subquery as follows:

If you want to keep the row with the lowest id value:

If you want the id value that is the highest:

Original Article: Stack Overflow

Use Developer tools to select DB tables quickly.

If like me you find yourself emptying the same tables again and again (test orders etc) it can be frustrating to check 20-30 tables. Why not let the developer tools in Chrome do it for you.
For example the javascript below will select all the sales data tables you will need to empty if you want to reset all the order tables. Just open the inspector and paste the Javascript into the console.

To customise this to suit your requirements simply replace the value=”; with your database table names.