Heading

MikeCohenMedia.com

Uncategorized

Magento URL Mistake No Access to Backend Admin Area

by Mike Cohen on Aug.03, 2009, under Uncategorized

The urls set in the Magento Admin -> Configuration  -> Web are used to build all the urls to the css and js
files, if you make a mistake saving them and they don’t resolve properly, that means all the references are off and breaks the site. This means your site won’t appear or function properly and worse, your admin back end will not function since it depends heavily on js. Without js, you can’t do anything in the admin, so you can’t go back in and change back to the old config. Big problem. Here’s how you solve:

1. Change the config back directly in the db, as of Magento 1.3 the table is core_config_data the SQL used should be something like this, or just use PhpMyAdmin.

UPDATE core_config_data SET value=’NEW URL’ WHERE value=’OLD URL’

Make this change for both the Unsecure Base Url and Secure Base Url

2. Clear the Magento cache – according to most post on Magento, this solved the problem for most people. Didn’t for us so there was one additional step that took us a long time to figure out.

3. Magento also has the capability of caching the configuration settings in xml. This file apparently controls how Magento loads config variables, once deleted Magento resorted to using the config values stored in the database.

/app/etc/use_cache.ser

Delete this file, and you should now have your site and admin back to normal. It might be necessary to re-upload the file, not 100% sure about that.

Hope this helps someone save their site and a lot of time. Link to a Magento post on the issue:

http://www.magentocommerce.com/boards/viewthread/22420/

Leave a Comment :, , , , , more...

Changing Magento Validation

by Mike Cohen on Jul.24, 2009, under Uncategorized

To change magento checkout validation, you can change the class of the form field to use one of the other validation methods present in js/prototype/validation.js. Just open that file and scroll down to see the methods available. Search fo r this Validation.addAllThese and you’ll see the methods below. Then open up /app/design/frontend/default/YOUR THEME/template/checkout/onepage/billing.html then change the class. For example if the class is class=”required-entry input-text” change to class=”required-entry validate-phoneLax”. This will now change the validation from simply checking if a value is present to actually checking the format.

Leave a Comment more...

Mystery Space Caused by the Byte Order Mark (BOM)

by Mike Cohen on Jul.06, 2009, under Uncategorized

This took way too long to figure out, hopefully this will help someone else. If you have a mystery space occurring somewhere in your web site and it is not one of the many CSS bugs out there then the byte order mark might be the culprit. Here’s a quote taken from the Joomla forums:

Yes, “” is the Byte Order Mark (BOM) of the Unicode Standard. Specifically it is the hex bytes EF BB BF, which form the UTF-8 representation of the BOM, misinterpreted as ISO 8859/1 text instead of UTF-8.

Probably what it means is that you are using a text editor that is saving files in UTF-8 with the BOM, when it should be saving without the BOM. It could be PHP files that have the BOM, in which case they’d appear as literal text on your page. Or it could be translated text you pasted into Joomla! edit windows.

The Unicode Consortium’s FAQ on the Byte Order Mark is at http://www.unicode.org/faq/utf_bom.html#BOM .

The remedy is to find the offending file, open in notepad, select Save AS, select ‘ANSI’ from the ‘Encoding’ drop down then re-upload to your site.

To find the problem file, you can probably narrow it down to one of the last files you edited before the problem started occurring.

If not, this shell command can help you find it on the server. Login to your server using SSH. This may or may not be enabled on your hosting account. Please check with your host if you are not sure. If you don’t know how to connect using SSH, search for Putty which is an easy to use SSH client. Once your are able to login, run this command (type in after the prompt you receive when logging in)

grep -rl $’\xEF\xBB\xBF’ /home/username/public_html

Where /home/username/public_html is the path to the directory you’d like to search. You might need to ech o $_SERVER['DOCUMENT_ROOT'] in a php file to find the full machine path to your directory.

Once you enter and run the command, it will display the file(s) that contain the BOM. Save these as described above and re-upload. That should solve your problem. Hope this helps!

Leave a Comment :, , , , more...

Hi Class

by Mike Cohen on May.03, 2009, under Uncategorized

TESTING

Leave a Comment more...