Enable PDF uploads in Magento

By default you are only allowed to upload image based files into the WYSIWYG editor built into Magento. If you need the ability to upload PDF files here is how.

  1. Navigate to: app/code/core/Mage/Cms/etc/config.xmlAround line 110 onwards you will see:
    <allowed>
    <jpg>1</jpg>
    <jpeg>1</jpeg>
    <png>1</png>
    <gif>1</gif>
    </allowed>
  2. Add in the line:
     <pdf>1</pdf>

    where needed and upload your file.

  3. Clean your cache. System -> Cache Management

Thats it!

 

Download Magento extensions directly.

If your like me and prefer to download a file and manually upload it with ftp this will show you how.

  1. Find your required extension on Magento Connect.
  2. Click the “Get Now” button, then the “Get Extension Key” button.

Magento Download Extension

Magento Download Extension

Magento Download Extension

  1. Copy this extension key.
  2. Go to http://freegento.com/ddl-magento-extension.php and paste in the extension key.
  3. Download the compressed folder that contains your plugin.

ERORR 503: Service Unavailable. Magento fix.

This is one of the more frustrating problems I have encountered with Magento. It generally occurs after working with 3rd party plugins. It will lock you out of the both the front-end and back-end of your website.

magento error 503

 

The solution, the only one as far as I know, is to login via FTP to the base of your magento installation. Look for a file named maintenance.flag and delete this file.

This should most likely solve your issue and clear the 503 error.

Fix Magento Redirect Loop problem

If you edit the secure/unsecure base url for you Magento based site you may find yourself locked out of both the frontend and admin sections of the site.

redirect

To solve this problem take the following steps:

  1. Log in to your database using phpMyadmin or similar.
  2. Find the table labelled core_config_data
  3. Edit the rows entitled web/unsecure/base_url and web/secure/base_url 
  4. Edit the row web/url/redirect_to_base to 0 instead of 1
  5. Using your ftp client clear contents of both var/cache and var/sessions folders.

 

For more info on base urls for magento click here

How to improve Magento v1.7 search results

If you are using the standard built in search function in Magento you may notice that you are getting a large amount of responses to any search.

The way the default search works is like this…

If you search for “Red Jumper”, you will get results for every product with either “Red” or “Jumper” in their product details, which will not necessarily be very helpful.

The way around this is to edit a single word in your code to make it search for products with every word you are searching for, as opposed to any word.

  1. Navigate to: /app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php
  2. Go to line 331 and find $likeCond = ‘(‘ . join(‘ OR ‘, $like) . ‘)’;
  3. Change the OR to AND

 

*Tested on version CE 1.7.0.2