February 22, 2012

Test credit card numbers

You don’t always have to use genuine plastic to test your shopping solution.  Check out Paypal’s list of test credit card numbers here.

And if you check here the Visa one is also valid for use with Authorize.net and can be used to trigger specific responses from their system.

Install Magento via SSH (the easy way)

I just spent one too many times waiting while Magento uploaded to my server via FTP.  And as it happens much of the time it failed.  Rather than dealing with repeated FTP disconnects I headed off to see if there was a better way.  The obvious choice had to be something over SSH.  But to be honest, my SSH-fu isn’t as strong as your average sysadmin.  Thankfully, there are some kind souls out there who put together a wonderful script and instructions on how to do just this.

This like any other SSH activity this isn’t for the feint of heart and should come with a standard disclaimer: you can really screw some stuff up using SSH so be cautious, use a strong password, and backup your stuff.

Ready?  Good, head on over here for the detailed instructions.  Let me tell you, this was substantially faster than the old-fashioned way over FTP and then manually running the installer.  Figure this will take you a few minutes to parse the instructions, get your SSH client fired up, and start the script.  This is compared to waiting eons on FTP to upload the 12, 194 files (I shit you not) in the standard Magento install.  And in my experience using FTP doesn’t always work anyhow.

Keep in mind since you will need to navigate first to your Magento installation folder before getting started.

Note! make sure you have your PHP memory limit set high enough.  For me at the MediaTemple DV default (I think it was 32MB) it failed.  However, upping this to 128MB (I have a total of 768MB of RAM) made things work like a charm.

Thanks to the guys at Crucial web hosting for the article, you just saved me a ton of time and frustration.

Get the current category name with Magento

Wish there were some friendly template tags don’t ya?  Yeah you aren’t in WordPress-land anymore.

Need to show the category name anywhere?

Here you go:

$categoryobject = Mage::registry(‘current_category’);
$category=$categoryobject->getName();

I can’t take the credit for this one though, I actually found the object reference over here.  He got me the object, I just added the line to grab out the name from the object.  Many thanks to Richard for the post.