Archive

Archive for February, 2009

Magento Notes - Fix for admin login problem

February 9th, 2009

Today’s Magento installation has become a real drag!! The upgrade to version 1.2.1 was troubling as after the upgrade I had trouble logging into the admin page.  After digging for hours trying to find a fix, I finally came up with the right fix!! View Entire Thread Here

The long and short of the fix is that apparently the newer Magento version is implementing some security check to make sure that the domain is a valid one that is accessing the admin page; a valid domain name or host consists of one with a period in the host name, so if you are installing locally using something like http://localhost, YOU WILL RUN INTO THIS PROBLEM! There are a couple ways to fix this

1) you can reference your admin page by using http://127.0.0.1 (this way it has periods in the host name) instead of localhost or

2) if you are on windows xp, add a host record in your hosts file by going to: C:\WINDOWS\system32\drivers\etc and have 127.0.0.1 point to something like magento.localhost

3. modify the core Magento code (keep in mind you may have to re-apply the fix if you update the code Magento code) - go to: app/code/core/Mage/Core/Model/Session/Abstract and open up varien.php, and comment out lines 73 (comment out the comma at the end of the line) through 76 so that it looks like the following:

// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath() //remove this after putting on server (leave the comma)   ,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()

);

I am sure many people will appreciate this fix!

blog posting, magento, technical notes ,

Magento Notes - Magento Connect came up blank when click on check for updates

February 9th, 2009

After my installation of Ver 1.1.8, I attempted to run a “Check for Update” through Magento Connect, so that I can upgrade the installation to 1.2.1 (the newest version right now).  The page did a postback and return nothing (a blank page - no listing of any updates).  Did a quick Google online and came up with the fix in the Magento forum:  Copy the following extension:

magento-core/Mage_All_Latest

Make sure no trailing spaces, and you should be able to successfully download and upgrade to 1.2.1.  From the forum it appears to be an issue with ver 1.1.8, as I didn’t have problem with version 1.1.6.

blog posting, magento, technical notes , ,

Magento Notes - SQL Error mysql4-upgrade-0.7.46-0.7.47.php

February 9th, 2009

I tried running the installation for a new Magento project this morning, and I used version 1.1.8 and had the following error message:

“Erro during installation magento mysql4-upgrade-0.7.46-0.7.47.php” - SQLSTATE[42000]“ with additional text indicating access violation with the database user account. I know that i don’t have an issue with permissions as I have setup other Magento stores using the same db user/pswd.

Anyways, the fix for this is to locate the file: mysql4-upgrade-0.7.46-0.7.47.php inside: app/code/core/Mage/Catalog/sql/catalog_setup and comment out lines 66-69 where it issues command to lock the database:

$installer->run(”
LOCK TABLES `{$installer->getTable(’catalog_category_product_index’)}` WRITE, `{$installer->getTable(’catalog_category_product’)}` READ, `{$installer->getTable(’catalog_category_entity’)}` READ;
/*!40000 ALTER TABLE `{$installer->getTable(’catalog_category_product_index’)}` DISABLE KEYS */;
“);

and then also comment out lines: 85-88 where it unlocks the database again:

$installer->run(”
/*!40000 ALTER TABLE `{$installer->getTable(’catalog_category_product_index’)}` ENABLE KEYS */;
UNLOCK TABLES;
“);

Then go into: app/etc and rename the local.xml file and rerun the Magento setup.  You should be fine this time around.

magento, technical notes , ,

Magento Notes - Customizing the Invoice and Packing Slip PDF

February 3rd, 2009

We just got our first online order on Tickon.com (our very own Magento-based e-commerce site)!! YEAH!!! But we weren’t even ready for order taking yet!! Paypal Pro hasn’t been setup and logistics haven’t been figured out out…yikes!!

Contacted Paypal to expedite the site approval process, and contacted our vendor with shipping the item…all done in 1 afternoon.  Everything is under control now, I was able to use Paypal’s virtual terminal to key in the CC info and all’s well!  So far.

When I was getting ready to print out the packing slip and the invoices for my vendor to ship the product, I noticed that the plain vanilla invoices and packing slips didn’t include my store’s logo nor address.  Make sure you get those on if to build your store’s brand identity!! Or atleast so that the customer knows where this package came from!

I browsed in the Magento admin interface, and looked everywhere but couldn’t find the form to fill in the store address nor an image for the outputted PDF file.  After some googling i found the thread that talks about this…and the location to configure this IS in the admin interface…just that it wasn’t placed at a very intuitive location. To customize the logo and the store address on the invoice, go to: System (at the top), Sales (on the left side), and Invoice and Packing Slip Design (third tab in the middle).  Upload the images, and type in your store address.  All Done.

NOTE: Picture shown is what was purchased. Very cool Queue 2-Tone Stick Lighter.

blog posting, e-commerce, magento, technical notes , , , , , ,

Annoying Notification Message in the Admin Page

February 2nd, 2009

Are you sick of seeing that Magento notification always showing up whenever you login to the admin page?  There’s a quick way to disable this feature…I am surprise that it was so hard to google for a solution on this. Am I the only one annoyed by that notification?!

Anyways, the quick fix is the following: go into app/code/core/Mage/Adminhtml/Block/Notification and open up the file: toolbar.php and look for the function: isShow.  If the function returns true that notification box will show up, but if it returns false, the notification will never show up.  So what I have done is change the original code:

public function isShow()
{
if ($this->getRequest()->getControllerName() == ‘notification’) {
return false;
}
if ($this->getCriticalCount() == 0 && $this->getMajorCount() == 0 && $this->getMinorCount() == 0 && $this->getNoticeCount() == 0) {
return false;
}
return true;
}

to always return false:

public function isShow()
{
return false;
}

Hope someone appreciate this fix.  I know I do.

blog posting, e-commerce, magento, technical notes , ,