Install mod_security 2 on CentOS/RedHat

Posted in Customization, Programming on August 31st, 2009 by Ryan

This is a translation from Spanish to English, but still the best guide I’ve used so far. Modified slightly to help others but could use more work.

Important: ModSecurity blocks lots of UNIX commands. I had to add dots to them. They are colored red so you know to change them.

This article assumes that you have installed a RedHat Enterprise or CentOS and not guaranteed to work, although we have tested on several CentOS 4.5 with success. Read more »

Edit the Magento Invoice PDF Templates

Posted in Programming on December 2nd, 2008 by Ryan

Code Location

  • /app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php
  • /app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php

Changing the font size

Change the font size in the two files:

  • /app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php (line 487-507)
  • /app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php (line 255-274)

Change the invoice logo

  • Admin -> Configuration -> Sales -> Invoice and Packing Slip Design

More info

  • Changing the invoice size from A4 to letter
  • Changing the font from Libertine to Helvetica
  • Read up here.

Remove the Store View from the Magento Meta Title Tag

Posted in Programming on November 5th, 2008 by Ryan

Having problems with the word ” – English” showing up on all your meta titles? Here’s the solution: Read more »

osCommerce Error: Unable to determine the page link

Posted in Programming, Technical Issues on October 2nd, 2008 by Ryan

This is a simple PHP4 -> PHP5 error. Make sure the following is in your .htaccess file.

php_flag register_globals On
php_value register_long_arrays On

Work on sites before the DNS has rolled over (by editing the hosts file)

Posted in Programming, Tricks on September 29th, 2008 by Ryan

Important: This does not work if you are behind a proxy, which includes antivirus firewalls and such.

  • Right click on the hosts file in C:\Windows\System32\drivers\etc
  • Go to properties, turn off “read-only
  • Open the file using Notepad or any text editor
  • Add a line to the bottom of the file with the IP and domain
  • When you are done, don’t forget to turn read-only back on again

Ex.

200.200.200.200  thedomain.com

Use the IP of the new server and then the domain you want that IP to resolve to.

Now you can browse to that domain and it will resolve to the new IP even though the DNS hasn’t been updated yet.

Display code in the browser

Posted in Programming on September 23rd, 2008 by Ryan

Use &lt; instead of “<” and &gt; instead of “>”.

Or if you’re pasting code into a WYSIWYG editor, just paste into the design view and not the source view. It should automatically convert the characters for you.

Remove Estimate Shipping and Tax box from Magento checkout

Posted in Programming on September 23rd, 2008 by Ryan

Open the file /app/design/frontend/default/default/layout/checkout.xml

Remember if you are using a different theme the path to that file will be slightly different.

Remove this line:

<block type=”checkout/cart_shipping” name=”checkout.cart.shipping” as=”shipping” template=”checkout/cart/shipping.phtml”/>

Source

Canada Post module for Magento now available

Posted in Programming on September 22nd, 2008 by Ryan

After this module is installed you can request quotes from the Canada Post Sell Online system.

Feature list

  • Storage of sellonline information
  • Easy setup process
  • Easy configuration / setup process
  • Add ability to view number of boxes to ship and contents of each box
  • Orders from backend may use “Free” shipping method

Get it here.

Make your Wordpress site faster (easily)

Posted in Programming, Tips on September 21st, 2008 by Ryan

What:
There’s a feature called “gzip” that’s installed by default on most web servers. Modifying your site to make use of it can really speed up the performance.

How much faster?
Try the quick and easy mod_gzip tester by WhatsMyIP.org. Just enter the URL and it will tell you how much faster it would be.

How to enable it in Wordpress:
It’s easy! Just grab the plugin called Gzippy and install it. Run the gzip tester again to see it in action.

osCommerce PHP4 -> PHP5 Fixes

Posted in Programming, Technical Issues on September 15th, 2008 by Ryan

There are a few problems that come from moving an old install of osCommerce to a new server with PHP5 or just simply upgrading from PHP4 to PHP5. Read more »