Friday, June 1, 2012

Update Magento 1.5 to 1.7

1. First of all prepare your environment for a big time of php execution, this can depend on the size of your database. 1.a Increase the time to your PHP
max_execution_time = 10800     ; Maximum execution time of each script, in seconds, 10800 = 3 hours
max_input_time = 10800 ; Maximum amount of time each script may spend parsing request data
1.b Increase also in your Apache
BusyTimeout 10800
ProcessLifeTime 10800
IPCConnectTimeout 20
IPCCommTimeout 10800
MaxRequestsPerProcess -1
2. Run the updates of Magento
chmod 755 mage
rm -rf var/cache/* downloader/pearlib/cache/* downloader/pearlib/download/*
./mage mage-setup .
./mage sync --force
./mage config-set preferred_state stable
./mage list-upgrades
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
rm -rf var/cache/* downloader/pearlib/cache/* downloader/pearlib/download/*
chmod 755 mage
2.a This step always occurs an error. This step is for re-index the tables.
php shell/indexer.php reindexall
This is the error but is normal, it will fix on the way. It only happen in the "Product Price"
Product Prices index process unknown error:
exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'website_date' in 'field list'' in /home/erjpub/documents/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/erjpub/documents/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/erjpub/documents/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/erjpub/documents/public_html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/erjpub/documents/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/erjpub/documents/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#5 /home/erjpub/documents/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#6 /home/erjpub/documents/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(1974): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...', Array)
#7 /home/erjpub/documents/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(1947): Varien_Db_Adapter_Pdo_Mysql->insertArray('catalog_product...', Array, Array)
#8 /home/erjpub/documents/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(599): Varien_Db_Adapter_Pdo_Mysql->insertMultiple('catalog_product...', Array)
#9 /home/erjpub/documents/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(378): Mage_Catalog_Model_Resource_Product_Indexer_Price->_prepareWebsiteDateTable()
#10 /home/erjpub/documents/public_html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexAll()
#11 /home/erjpub/documents/public_html/app/code/core/Mage/Index/Model/Process.php(209): Mage_Index_Model_Indexer_Abstract->reindexAll()
#12 /home/erjpub/documents/public_html/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#13 /home/erjpub/documents/public_html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#14 /home/erjpub/documents/public_html/shell/indexer.php(198): Mage_Shell_Compiler->run()
#15 {main}
2.b Keep with the update
./mage upgrade-all --force
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 777 {} \;
chmod 750 mage
chmod o+w var var/.htaccess app/etc
chmod -R o+w media
chmod -R 777 var/package var/locks var/report var/export downloader 
3. Update to 1.7 is succesfull, but the pager doesn't work as expected. This is because an missing function. 3.a Go to 'app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php' line 35. Look up this line
class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Core_Block_Template
Change it by this
class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Page_Block_Html_Pager

Friday, March 2, 2012

Problem with DataTable and FancyBox in Internet Explorer

Working in a project I found a strange problem when I was mixing  FancyBox with DataTable.
Here was the issue, when placing a link inside a table generated with DataTable and this link was set to be handle with FancyBox for showing a 'div' tag, in Mozilla Firefox and Chrome everything worked just fine, but in all Internet Explorer  nothing worked as expected.

So, I used a link as a gateway, when you click in a link inside the DataTable it update the value for the 'gateway' link and later just trigger FancyBox.

Try it your self!
Of course, first download DataTable and FancyBox.

Here is the HTML code:
Email Name
Email Name
To:
Message:


Here is the JavaScript code:








This is what you should see at the end: